[GLASSFISH-18729] set VMARGS=-version cause appclient to fail Created: 14/May/12  Updated: 20/Dec/16

Status: Open
Project: glassfish
Component/s: standalone_client
Affects Version/s: 4.0_dev
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: tak09 Assignee: Tim Quinn
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Windows 7


If VMARGS=-version is set, appclient fails with "Error occurred during initialization of VM". It is difficult for a user to find the cause of the problem.

C:\eclipsews\glassfishfeedback\4801\bin>set VMARGS=-version

C:\eclipsews\glassfishfeedback\4801\bin>appclient -client .\client\warehouseClient.jar
Error occurred during initialization of VM
java.lang.Error: java.lang.ClassNotFoundException: org.glassfish.appclient.client.acc.agent.ACCAgent
at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1356)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1319)
Caused by: java.lang.ClassNotFoundException: org.glassfish.appclient.client.acc.agent.ACCAgentClassL
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2071)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1344)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1319)

Comment by Tim Quinn [ 14/May/12 ]

While I agree that this is a bug, it seems very minor to me and I have changed the priority accordingly.

The appclient command attempts to emulate the java command as much as possible. In doing so, it passes any non-ACC-specific options through to the java command it generates to actually launch the app client container. The -version option is not an ACC-specific option, as indicated in the documentation and the appclient help and usage output. So this option is passed on to the generated java command.

The help for the java command states that the -version option will display the version and then exit the JVM, without running the program.

Although the way the appclient script behaves now with -version is certainly not good, most users will have no reason to try this.

We might fix this at some point but it is a very low frequency problem and there is an easy workaround - don't specify the -version option!

Generated at Sun Jan 22 13:07:14 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.