java.lang.IllegalStateException: JBAS014805: Could not get main file: standalone.xml. Specified files must be relative to the configuration dir: .../standalone/configuration

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6.x

Issue

  • How to change the default location of standalone.xml
  • Refer to a custom standalone.xml directory
  • JBoss is looking for the app-specific standalone file inside the general "standalone/configuration" folder while there is more specific standalone-evtSvr.xml in "standalone-evtSvr/configuration"
========================================================================

  JBoss Bootstrap Environment
  JBOSS_HOME: /opt/jboss/eap620/
  JAVA: /usr/java/jdk1.7.0_25/bin/java
  JAVA_OPTS:  -server -XX:+UseCompressedOops -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

10:28:54,315 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final-redhat-2
10:28:54,954 ERROR [stderr] (main) java.lang.IllegalStateException: JBAS014805: Could not get main file: standalone-evtSvr.xml. Specified files must be relative to the configuration dir: /opt/jboss/eap620/standalone/configuration
10:28:54,955 ERROR [stderr] (main)      at org.jboss.as.controller.persistence.ConfigurationFile.determineMainFile(ConfigurationFile.java:168)
10:28:54,956 ERROR [stderr] (main)      at org.jboss.as.controller.persistence.ConfigurationFile.<init>(ConfigurationFile.java:95)
10:28:54,956 ERROR [stderr] (main)      at org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:393)
10:28:54,957 ERROR [stderr] (main)      at org.jboss.as.server.Main.determineEnvironment(Main.java:257)
10:28:54,957 ERROR [stderr] (main)      at org.jboss.as.server.Main.main(Main.java:88)
10:28:54,958 ERROR [stderr] (main)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:28:54,958 ERROR [stderr] (main)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
10:28:54,958 ERROR [stderr] (main)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
10:28:54,959 ERROR [stderr] (main)      at java.lang.reflect.Method.invoke(Method.java:601)
10:28:54,959 ERROR [stderr] (main)      at org.jboss.modules.Module.run(Module.java:292)
10:28:54,960 ERROR [stderr] (main)      at org.jboss.modules.Main.main(Main.java:455)

Resolution

If you want to change the default location of the standalone.xml file, then you need to specify the parameter -Djboss.server.config.dir which points to the directory where the configured standalone.xml resides.

NOTE JBoss expects to find the *.properties files there too. So you need to copy those files over to where you have the standalone*.xml files.

The startup command becomes something like:
/opt/jboss/eap620/bin/standalone.sh -b hostname -c standalone.xml -Djboss.server.config.dir /path-to/your-custom-standalone-dir/

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.