Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1340823

Summary: (6.4.z) Standalone/domain server base directory is not exported correctly by standalone.sh/domain.sh
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Juraj Duráni <jdurani>
Component: distributionAssignee: jboss-set
Status: CLOSED NOTABUG QA Contact: Petr Kremensky <pkremens>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.8CC: bmaxwell, cobrien, fnasser, jpallich, msochure, pgier
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-14 11:09:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1305444    

Description Juraj Duráni 2016-05-30 11:12:06 UTC
Description of problem:
Recommended way to run EAP is to create a copy of JBOSS_HOME/standalone or JBOSS_HOME/domain directory and then execute standalone.sh/domain.sh against those directories, e.g.:
>>> path is relative to JBOSS_HOME
>>> ./domain.sh -Djboss.domain.base.dir=domain_master
>>> ./standalone.sh -Djboss.server.base.dir=standalone_tmp

If scripts standalone.sh/domain.sh are executed outside JBOSS_HOME dir with related options, then server throws FileNotFoundException. Example:

*********Domain*********
>>> cd  ${JBOSS_HOME}
>>> cd bin
>>> ./domain.sh -Djboss.domain.base.dir=domain_tmp
[jdurani@localhost bin]$ ./domain.sh -Djboss.domain.base.dir=domain_tmp
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/jdurani/redhat/data-virtualization/eap/tmp2

  JAVA: /usr/java/default/bin/java

  JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.modules.policy-permissions=true

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

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Unable to read the logging configuration from 'file:/home/jdurani/redhat/data-virtualization/eap/tmp2/bin/domain_tmp/configuration/logging.properties' (java.io.FileNotFoundException: /home/jdurani/redhat/data-virtualization/eap/tmp2/bin/domain_tmp/configuration/logging.properties (Adresár alebo súbor neexistuje))
...
...

-------------------------------------------------
-------------------------------------------------


*********Standalone*********
>>> cd  ${JBOSS_HOME}
>>> cd bin
>>> ./standalone.sh -Djboss.server.base.dir=standalone_tmp
[jdurani@localhost bin]$ ./standalone.sh -Djboss.server.base.dir=standalone_tmp
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/jdurani/redhat/data-virtualization/eap/tmp2

  JAVA: /usr/java/default/bin/java

  JAVA_OPTS:  -server -XX:+UseCompressedOops -verbose:gc -Xloggc:"/home/jdurani/redhat/data-virtualization/eap/tmp2/bin/standalone_tmp/log/gc.log" -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.modules.policy-permissions=true

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

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Unable to read the logging configuration from 'file:/home/jdurani/redhat/data-virtualization/eap/tmp2/bin/standalone_tmp/configuration/logging.properties' (java.io.FileNotFoundException: /home/jdurani/redhat/data-virtualization/eap/tmp2/bin/standalone_tmp/configuration/logging.properties (Adresár alebo súbor neexistuje))
java.lang.IllegalStateException: JBAS018701: Configuration directory does not exist: standalone_tmp/configuration
	at org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:387)
	at org.jboss.as.server.Main.determineEnvironment(Main.java:265)
	at org.jboss.as.server.Main.main(Main.java:93)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.jboss.modules.Module.run(Module.java:312)
	at org.jboss.modules.Main.main(Main.java:473)
[jdurani@localhost bin]$

Comment 1 Brad Maxwell 2016-06-21 16:40:30 UTC
You should use the absolute path to the directory, when run from with in the $JBOSS_HOME directory it works because the path is relative.  When not in the $JBOSS_HOME directory it would need the absolute path.  If an absolute path is not used, then it is considered relative to the directory you are running the command, which when you are in the $JBOSS_HOME directory will work if the base dir you specify exists in that directory.

./domain.sh -Djboss.domain.base.dir=/absolute/path/domain_master
./standalone.sh -Djboss.server.base.dir=/absolute/path/standalone_tmp

Comment 5 Juraj Duráni 2016-07-14 11:09:04 UTC
Closing this as a not a bug. directory should be set relatively to actual directory or as a full path.