Skip to content

GF could not start due to conflicting JAVA_TOOL_OPTIONS #24106

Open
@dmatej

Description

@dmatej

JAVA_TOOL_OPTIONS are often used on build servers (including Eclipse GlassFish), but another JVM properties are defined in domain.xml.

That can lead to situation that GlassFish cannot start under some circumstances.

Example: domain.xml contains -Xmx512m by default. When JAVA_TOOL_OPTIONS contain Xms1g (for maven, ie.), and maven starts asadmin create-domain, these options merge to what is defined in domain.xml, and domain will not start.

Possible solutions:

  1. asadmin would exclude conflicting values from JAVA_TOOL_OPTIONS and merge
  2. asadmin would exclude conflicting value from domain.xml and merge
  3. asadmin would ignore JAVA_TOOL_OPTIONS, so domain would be started just with the configuration in domain.xml
  4. ignore the issue, it is incorrect configuration.

However I believe 3 is correct. Because domain.xml contains this configuration and it should be the only source of this configuration.

13:19:42.727875    INFO                 main           org.glassfish.main.admin.test.tool.asadmin.Asadmin.exec exec(timeout=30,000, detached=false, args=[start-domain])
Command start-domain failed.
[ERROR] Tests run: 3, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 1.913 s <<< FAILURE! - in org.glassfish.main.admin.test.OSGiCommandsITest
[ERROR] org.glassfish.main.admin.test.OSGiCommandsITest.osgiCmdSession  Time elapsed: 0.013 s  <<< FAILURE!
java.lang.AssertionError: 

Expected: asadmin succeeded
     but: was <Command start-domain failed.
Picked up JAVA_TOOL_OPTIONS: -Xms1g -Xmx3g -Xss512k -XX:+UseStringDeduplication -Djava.net.preferIPv4Stack=true
JVM failed to start: com.sun.enterprise.admin.launcher.GFLauncherException: The server exited prematurely with exit code 1.
Before it died, it produced the following output:

Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions