Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix whitespaces #2109

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

kalinchan
Copy link

Credit to @breakponchito

See payara/Payara#4551

The following block of code process the arguments to prepare the execution of the broker:

openmq/mq/main/mq-jmsra/jmsra-ra/src/main/java/com/sun/messaging/jms/blc/EmbeddedBrokerRunner.java at master · eclipse-ee4j/openmq

the following block:

   if (brokerExtraArgs != null && !("".equals(brokerExtraArgs))) {
        StringTokenizer st = new StringTokenizer(brokerExtraArgs, " ");
        while (st.hasMoreTokens()) {
            String t = st.nextToken();
            v.add(t);
        }
    }

process the brokerArgs and separates considering the delimiter as a white space, that is why when sending the following attribute:

brokerArgs= -jrehome "C:\Program Files\Java\jdk-11.0.12"
is processed as follows:

-jrehome
"C:\Program
Files\Java\jdk-11.0.12"
this is saved on a Vector that is processed after

then the following block of code validates the sequence of parameters. The expected case is waiting the path after the property -jrehome but after the previous separation we have two values after the property:

openmq/mq/main/mq-broker/broker-core/src/main/java/com/sun/messaging/jmq/jmsserver/Broker.java at master · eclipse-ee4j/openmq

that is why the following exception is thrown because the third position is not expected

openmq/mq/main/mq-broker/broker-core/src/main/java/com/sun/messaging/jmq/jmsserver/Broker.java at master · eclipse-ee4j/openmq

[2021-10-20T17:49:14.044-0500] [Payara 5.2021.9-SNAPSHOT] [SEVERE] [] [] [tid: _ThreadID=150 _ThreadName=JMS_PROXY_default_JMS_host-kernel(1) SelectorRunner] [timeMillis: 1634770154044] [levelValue: 1000] [[
java.lang.IllegalArgumentException: unknown option Files\Java\jdk-11.0.12"

@kalinchan kalinchan requested a review from pzygielo October 3, 2024 11:39
@pzygielo

This comment was marked as resolved.

@pzygielo

This comment was marked as resolved.

@pzygielo
Copy link
Contributor

Credit to @breakponchito

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants