[jboss-jira] [JBoss JIRA] Commented: (JBAS-6725) quotes around JAVA_OPTS in run.bat

David Croft (JIRA) jira-events at lists.jboss.org
Sun Apr 5 16:24:22 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBAS-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12460669#action_12460669 ] 

David Croft commented on JBAS-6725:
-----------------------------------

I tried the caret before the pipe (^|) as suggested:
set JAVA_OPTS=-Dhttp.nonProxyHosts="localhost^|*.ldms.ibm.com" 

But it fails here because of the quotes around quotes here:
if not errorlevel == 1 (
  set "JAVA_OPTS=%JAVA_OPTS% -server"
)

Before I filed the bug report, I also tried this with the caret before the pipe but without the quotes:
set JAVA_OPTS=-Dhttp.nonProxyHosts=localhost^|*.ldms.ibm.com

This also fails at the next place you append to JAVA_OPTS using set JAVA_OPTS=%JAVA_OPTS% [something more]:

C:\jboss\bin>rem JVM memory allocation pool parameters. Modify as appropriate.
C:\jboss\bin>set JAVA_OPTS=-Dhttp.nonProxyHosts=localhost  | *.ldms.ibm.com -Dpr
ogram.name=run.bat -server -Xms128m -Xmx512m -XX:MaxPermSize=256m
'*.ldms.ibm.com' is not recognized as an internal or external command,
operable program or batch file.

It appears the problem is being caused by some whitespace being inserted on both sides of the pipe (|) during the append.

> quotes around JAVA_OPTS in run.bat
> ----------------------------------
>
>                 Key: JBAS-6725
>                 URL: https://jira.jboss.org/jira/browse/JBAS-6725
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: JBossAS-5.0.1.GA, JBossAS-5.1.0.Beta1
>         Environment: Windows XP and JDK 6
>            Reporter: David Croft
>            Assignee: Mladen Turk
>
> In JBoss 4.2.3, I was able to prepend to run.bat a JAVA_OPTS option with a pipe symbol (|) by escaping it using quote marks.
> Example:
> set JAVA_OPTS=-Dhttp.nonProxyHosts="localhost|*.ldms.ibm.com"
> In JBoss 5.0.1.GA and 5.1.0.Beta1, the run.bat script has been modified slightly so that this is no longer possible.  This modification was to wrap JAVA_OPTS with quote marks which will not parse if JAVA_OPTS already has quote marks as in the above example.  There are two places where this occurs.  Here is the first place:
> if "x%JAVA_OPTS%" == "x" (
>   set "JAVA_OPTS=-Dprogram.name=%PROGNAME%"
> ) else (
>   set "JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME%"
> )
> The first place where it occurs can be fixed by reverting to the version 4.2.3 run.bat code without quote marks:
> set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME%
> The second place it occurs is as follows:
> if not errorlevel == 1 (
>   set "JAVA_OPTS=%JAVA_OPTS% -server"
> )
> This second place can be fixed by removing the quote marks:
> if not errorlevel == 1 (
>   set JAVA_OPTS=%JAVA_OPTS% -server
> )

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list