[GLASSFISH-19069] Backslash is removed from JVM Options Created: 11/Sep/12  Updated: 06/Mar/13  Resolved: 06/Mar/13

Status: Resolved
Project: glassfish
Component/s: rest-interface
Affects Version/s: 3.1.2
Fix Version/s: 4.0_b82_EE7MS7, 4.0

Type: Bug Priority: Blocker
Reporter: mkarg Assignee: Jason Lee
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Win7 Pro (64 Bit), JDK 1.6.0_26

Tags: console


On Windows, the official separator character is a backslash. Least Windows users or administrators actually know that on other OS it is a forward slash. So when typing in a JVM Option that has a path value, they will type in a backslash.

But when restarting the domain, the backslash is gone. The GUI shows the path without any backslashes.

This is a blocker as nobody could gess how to fix it, so if the option is essential for the particular use case, GlassFish cannot be configured to run.

As Windows people do not know that a forward slash will do, this is a blocker for those people. The GUI not even tells that the backslash is not accepted or that it should be replaced by a forward slash. Typical *ix-developer agnostic way to think about the world: "There is no Windows, and even if there would be something like that, it would not have any impact on me." Well, it HAS impact.

Comment by Tom Mueller [ 11/Sep/12 ]

Changing the subcategory to admin_gui.

The asadmin manual page has the following content:

For the Windows operating system in single mode, a backslash
() is required to escape the colon ( and the backslash

asadmin create-jvm-options --target test-server
-e -Dlocation=c\:\\sun

The reason that the : has to be escaped is because the : is the separator for multiple JVM options. The escape character is \. And so therefore, the \ has to be escaped too. This is independent of the path separator on Windows being a \.

The bug being reported here is in the console. In any JVM option, any backslash in the value has to be escaped with a backslash when processed by the system. However, the console is not adding this escaping when it is processing the value.

Comment by mkarg [ 11/Sep/12 ]

I want to mention that GUI users possibly will never read the asadmin manual (why should they? if they like to hack the CLI they won't use the GUI) and so will not understand the explanation you gave (nor accept it, since the GUI not necessarily must be a wrapper around the CLI).

About asadmin: Instead of escaping characters that you need as separators it would be much more intuitive (and needs less insight) if you simply use a blank as a separator, just as all other Windows CLI programs do.

Comment by Anissa Lam [ 12/Feb/13 ]

Fix by HCF (3/25)

Comment by Anissa Lam [ 12/Feb/13 ]

Issues need to be addressed before 4.0 HCF (3/25)

Comment by Anissa Lam [ 19/Feb/13 ]

I have fixed the GUI code to add the blackslash as the escape char. It should be passing in the correct value for the payload now.
However, in saving the jvm option, it is a FAILURE. With the following error in the response

JVM option \ABC is invalid because it does not start with a '-'

I am transferring this to REST. If this is not REST issue, please assign to backend or let me know what should console pass in.

To reproduce, best is create a cluster, thus resulting a temp config to work with.

  • create cluster ABC
  • go to ABC-config -> JVM Settings of the tree.
  • go to JVM options tab
  • delete all the JVM options (for easier debugging).
  • click SAVE

Now, you have an empty JVM options table. Add the following:


Click Save.
You will see the above error on screen.

You will see the following logged in server.log, showing the endpoints and payload, which has added the backslash for escaping the colon and th blackslash itself.

[#|2013-02-18T21:00:13.338-0800|SEVERE|glassfish 4.0|org.glassfish.admingui|_ThreadID=118;_ThreadName=admin-listener(5);_TimeMillis=1361250013338;_LevelValue=1000;|RestResponse.getResponse() gives FAILURE. endpoint = 'http://localhost:4848/management/domain/configs/config/cluster-ABC-config/java-config/jvm-options'; attrs = '

{profiler=false, target=cluster-ABC-config, -Dfile=C\:\\ABC}


Comment by Jason Lee [ 06/Mar/13 ]

I have committed a fix and regression test for this issue in r60095.

Generated at Wed Sep 28 04:55:13 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.