Geronimo
  1. Geronimo
  2. GERONIMO-6270 Re-enable multiple instances support in one installation
  3. GERONIMO-6281

Geronimo home.dir is being used when server.dir should be used instead for SnapshotConfigXMLBuilder, ActiveMQ, and Karaf

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0-beta-1
    • Fix Version/s: 3.0.0, 3.0-beta-2
    • Component/s: ActiveMQ, javaee6
    • Security Level: public (Regular issues)
    • Labels:
    • Environment:

      Linux x86, Red Hat Enterprise Linux Server release 5.4 (Tikanga); Java JDK1.6.0_25

      Description

      This issue is related to GERONIMO-6270 , GERONIMO-6175 , GERONIMO-6174 , GERONIMO-5987 , and is being used to specifically track modifications related to correctly using the following properties:

      1. org.apache.geronimo.home.dir (GERONIMO_HOME)
      2. org.apache.geronimo.server.dir (GERONIMO_SERVER - new shell variable introduced in GERONIMO-6275)
      3. karaf.base
      4. karaf.home

      Primary issue to be resolved: The org.apache.geronimo.home.dir property (GERONIMO_HOME) is being referenced when the org.apache.geronimo.server.dir property (GERONIMO_SERVER) should be instead.

      I have identified three places in Geronimo errors are occurring due to improper use of the above java properties:

      1. SnapshotConfigXMLBuilder - originally reported in GERONIMO-6270
      2. ActiveMQ - is reported in a comment of GERONIMO-5987 , and is being reported here as requested.
      3. Karaf - is additionally reported in GERONIMO-6174 .

      Note the three issues in startup:

      1. Karaf initialization script etc/shell.init.script
        • Error in initialization script: /opt/geronimo3/etc/shell.init.script (No such file or directory)
        • Reason:
          • This is because karaf.home/etc/shell.init.script is being accessed when instead it should be karaf.base/etc/shell.init.script
        • Solution:
          • The {karaf.base}

            property should be the same value as the

            {org.apache.geronimo.server.dir}

            property

        • Affected Code:
          • framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/RunClientMojo.java
          • framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
          • trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties
          • trunk/framework/features/framework/src/main/distribution/text/etc/system.properties
          • trunk/framework/features/client/src/main/filtered-resources/resources/instances/client/etc/system.properties
          • trunk/framework/features/client/src/main/filtered-resources/resources/instances/client/etc/org.ops4j.pax.url.mvn.cfg
          • trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java
          • trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java
          • trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java
          • trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
        • These code files are affected, but in relation to specifying the repository
          • trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/org.ops4j.pax.url.mvn.cfg
          • trunk/framework/features/framework/src/main/distribution/text/etc/org.ops4j.pax.url.mvn.cfg
      2. SnapshotConfigXMLBuilder var/monitoring/ directory
        • (A) ERROR [SnapshotConfigXMLBuilder] Could not make the directory /opt/geronimo3/var/monitoring/
        • (B) ERROR [SnapshotConfigXMLBuilder] /opt/geronimo3/var/monitoring/snapshot-config.xml (Not a directory)
        • Reason:
          • This is because SnapshotConfigXMLBuilder is looking for $PWD/var/monitoring
        • Solution:
          • SnapshotConfigXMLBuilder should instead be using a full path to var/monitoring, i.e. org.apache.geronimo.server.dir/var/monitoring
        • Affected code:
          • trunk/plugins/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/ejb/snapshot/SnapshotProcessor.java
          • trunk/plugins/monitoring/agent-jar/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
      3. ActiveMQ var/activemq/ directory and Lock File
        • WARN [AMQPersistenceAdapter] Waiting to Lock the Store var/activemq
        • Reason:
          • This is because the ActiveMQ will create and use a var directory relative to the path in which Geronimo was started (Note this may not be the actual GERONIMO_HOME or GERONIMO_SERVER directory).
          • If two Geronimo instances are started from the same directory, they will share the same var directory, thus they will both want to use the same ActiveMQ lock file. This will conflict in the usage of other files in var/activemq too.
        • Solution:
          • ActiveMQ should instead be using a full path to var/activemq, i.e. org.apache.geronimo.server.dir/var/activemq
        • Affected code:
          • trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java

      Setup for reproducing the errors:
      Follow the example for running multiple instances within the Geronimo Wiki, here:

      1. https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances
      2. Then remove the GERONIMO_HOME/var and GERONIMO_HOME/etc directories
      3. Create an empty file $PWD/var/monitoring to prevent SnapshotConfigXMLBuilder from creating $PWD/var/monitoring when it discovers it does not exist

      The errors can be reproduced setting up Geronimo as directed and using the start procedure below, resulting with the startup output given. The patch in GERONIMO-6275 was applied which allows the easier start procedure of Geronimo instances. However, the patch is not necessary to reproduce the errors. Use the start scripts in the above mentioned wiki page for "running multiple geronimo instances" as an alternative. The snapshot geronimo-tomcat7-javaee6-3.0-SNAPSHOT-20111220 was used for testing.

      Example showing both the issue with Karaf and SnapshotConfigXMLBuilder

      [ger@server /opt/geronimo3]# /bin/rm -r var
      [ger@server /opt/geronimo3]# mkdir var; touch var/monitoring
      [ger@server /opt/geronimo3]# env JAVA_HOME=/usr/jdk1.6.0 GERONIMO_SERVER=/opt/geronimo3/gserv1 /opt/geronimo3/bin/geronimo run
      Using GERONIMO_HOME:   /opt/geronimo3
      Using GERONIMO_SERVER: /opt/geronimo3/gserv1
      Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/var/temp
      Using JRE_HOME:        /usr/jdk1.6.0/jre
                                                                
           ______                       _                       
          / ____/___  _________  ____  (_)____ ___  ____        
         / / __ / _ \/ ___/ __ \/ __ \/ // __ `__ \/ __ \  
        / /_/ //  __/ /  / /_/ / / / / // / / / / / /_/ /       
        \____/ \___/_/   \____/_/ /_/_//_/ /_/ /_/\____/    
      
        Apache Geronimo (3.0-SNAPSHOT)
      
      Hit '<tab>' for a list of available commands
      and '[cmd] --help' for help on a specific command.
      Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Geronimo.
      
      Error in initialization script: /opt/geronimo3/etc/shell.init.script (No such file or directory)
      geronimo> Booting Geronimo Kernel (in Java 1.6.0_25)...
      Starting Geronimo Application Server v3.0-SNAPSHOT
      [*****************************           ]  73%  35s  Loading agent-car-jmx                                   2012-02-17 16:30:59,710 ERROR [SnapshotConfigXMLBuilder] Could not make the directory /opt/geronimo3/var/monitoring/
      2012-02-17 16:30:59,711 ERROR [SnapshotConfigXMLBuilder] /opt/geronimo3/var/monitoring/snapshot-config.xml (Not a directory)
      [****************************************] 100%  45s Startup complete                                         
        Listening on Ports:
          1150 0.0.0.0 CORBA Naming Service
          1199 0.0.0.0 RMI Naming
          1627 0.0.0.0 Derby Connector
          2101 0.0.0.0 OpenEJB SSL ORB Adapter
          4301 0.0.0.0 OpenEJB Daemon
          6982 0.0.0.0 OpenEJB ORB Adapter
          8109 0.0.0.0 Tomcat Connector AJP TomcatAJPConnector
          8180 0.0.0.0 Tomcat Connector HTTP BIO TomcatWebConnector
          8543 0.0.0.0 Tomcat Connector HTTPS BIO TomcatWebSSLConnector
         10099 0.0.0.0 JMX Remoting Connector
         61716 0.0.0.0 ActiveMQ Transport Connector
      
        Started Application Modules:
          EAR: org.apache.geronimo.plugins/console-tomcat/3.0-SNAPSHOT/car
          JAR: org.apache.geronimo.configs/mejb/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.configs/activemq-ra/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.configs/system-database/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.plugins.monitoring/agent-ds/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.plugins.monitoring/mconsole-ds/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.plugins/uddi-db/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.configs/remote-deploy-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.configs/uddi-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.configs/welcome-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins.monitoring/mconsole-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/activemq-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/debugviews-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/openejb-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/plancreator-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/plugin-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/sysdb-console-tomcat/3.0-SNAPSHOT/car
      
        Web Applications:
          /
          /activemq
          /console
          /console-base
          /debug-views
          /juddi
          /monitoring
          /openejb-server
          /plan-creator
          /plugin
          /remote-deploy
          /system-database
      
      Geronimo Application Server started
      

      Example showing ActiveMQ creating var directory relative to the path Geronimo was started.
      Obviously if a second Geronimo instance was started, there would be a conflict with the ActiveMQ lock file.

      [ger@server /opt]# pwd
      /opt
      [ger@server /opt]# ls -l var
      ls: var: No such file or directory
      [ger@server /opt]# env JAVA_HOME=/usr/jdk1.6.0 GERONIMO_SERVER=/opt/geronimo3/gserv1 /opt/geronimo3/bin/geronimo run
      Using GERONIMO_HOME:   /opt/geronimo3
      Using GERONIMO_SERVER: /opt/geronimo3/gserv1
      Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/var/temp
      Using JRE_HOME:        /usr/jdk1.6.0/jre
                                                                
           ______                       _                       
          / ____/___  _________  ____  (_)____ ___  ____        
         / / __ / _ \/ ___/ __ \/ __ \/ // __ `__ \/ __ \  
        / /_/ //  __/ /  / /_/ / / / / // / / / / / /_/ /       
        \____/ \___/_/   \____/_/ /_/_//_/ /_/ /_/\____/    
      
        Apache Geronimo (3.0-SNAPSHOT)
      
      Hit '<tab>' for a list of available commands
      and '[cmd] --help' for help on a specific command.
      Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Geronimo.
      
      geronimo> Booting Geronimo Kernel (in Java 1.6.0_25)...
      Starting Geronimo Application Server v3.0-SNAPSHOT
      [****************                        ]  42%  11s  Loading openjpa2                                        2012-02-17 16:03:45,759 WARN  [aries] Managed persistence context support is no longer available for use with the Aries Blueprint container
      [****************************************] 100%  47s Startup complete                                         
        Listening on Ports:
          1150 0.0.0.0 CORBA Naming Service
          1199 0.0.0.0 RMI Naming
          1627 0.0.0.0 Derby Connector
          2101 0.0.0.0 OpenEJB SSL ORB Adapter
          4301 0.0.0.0 OpenEJB Daemon
          6982 0.0.0.0 OpenEJB ORB Adapter
          8109 0.0.0.0 Tomcat Connector AJP TomcatAJPConnector
          8180 0.0.0.0 Tomcat Connector HTTP BIO TomcatWebConnector
          8543 0.0.0.0 Tomcat Connector HTTPS BIO TomcatWebSSLConnector
         10099 0.0.0.0 JMX Remoting Connector
         61716 0.0.0.0 ActiveMQ Transport Connector
      
        Started Application Modules:
          EAR: org.apache.geronimo.plugins/console-tomcat/3.0-SNAPSHOT/car
          JAR: org.apache.geronimo.configs/mejb/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.configs/activemq-ra/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.configs/system-database/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.plugins.monitoring/agent-ds/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.plugins.monitoring/mconsole-ds/3.0-SNAPSHOT/car
          RAR: org.apache.geronimo.plugins/uddi-db/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.configs/remote-deploy-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.configs/uddi-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.configs/welcome-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins.monitoring/mconsole-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/activemq-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/debugviews-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/openejb-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/plancreator-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/plugin-console-tomcat/3.0-SNAPSHOT/car
          WAR: org.apache.geronimo.plugins/sysdb-console-tomcat/3.0-SNAPSHOT/car
      
        Web Applications:
          /
          /activemq
          /console
          /console-base
          /debug-views
          /juddi
          /monitoring
          /openejb-server
          /plan-creator
          /plugin
          /remote-deploy
          /system-database
      
      Geronimo Application Server started
      ^D
      2012-02-17 16:16:26,021 WARN  [aries] Managed persistence context support is no longer available for use with the Aries Blueprint container
      2012-02-17 16:16:26,022 WARN  [context] The TransactionSynchronizationRegistry used to manage persistence contexts is no longer available. Managed persistence contexts will no longer be able to integrate with JTA transactions, and will behave as if no there is no transaction context at all times until a new TransactionSynchronizationRegistry is available. Applications using managed persistence contexts may not work correctly until a new JTA Transaction services implementation is available.
      
      [ger@server /opt]# ls -l
      total 4
      drwxr-xr-x 17 root root 4096 Feb 17 14:17 geronimo3
      drwxr-xr-x 3  root root 4096 Feb 17 16:04 var
      [ger@server /opt]# tree /opt/var
      /opt/var
      `-- activemq
          |-- journal
          |   |-- data-1
          |   `-- data-control
          |-- kr-store
          |   |-- data
          |   |   |-- index-container-roots
          |   |   `-- lock
          |   `-- state
          |       |-- data-kaha-1
          |       |-- data-store-state-1
          |       |-- hash-index-store-state_state
          |       |-- index-kaha
          |       |-- index-store-state
          |       |-- index-transactions-state
          |       `-- lock
          `-- lock
      
      5 directories, 12 files
      
      1. geronimo-6281-activemq.patch
        3 kB
        Russell E Glaue
      2. geronimo-6281-activemq-config-substitutions.patch
        0.8 kB
        Russell E Glaue
      3. geronimo-6281-karaf.patch
        0.8 kB
        Russell E Glaue
      4. geronimo-6281-snapshot.patch
        2 kB
        Russell E Glaue
      5. geronimo-6281-trunk-karaf.patch
        2 kB
        Russell E Glaue

        Issue Links

          Activity

          Hide
          Russell E Glaue added a comment -

          geronimo-6281-activemq.patch
          Modifies: plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java

          This patch adds a finalized variable (pathToVarActiveMQ) that defines the full path to "GERONIMO_SERVER/var/activemq/". This variable is then used in each place the "var/activemq/" working directory needs to be provided.

          Show
          Russell E Glaue added a comment - geronimo-6281-activemq.patch Modifies: plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java This patch adds a finalized variable (pathToVarActiveMQ) that defines the full path to "GERONIMO_SERVER/var/activemq/". This variable is then used in each place the "var/activemq/" working directory needs to be provided.
          Hide
          Russell E Glaue added a comment -

          geronimo-6281-snapshot.patch
          Modifies:
          plugins/monitoring/agent-jar/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
          plugins/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/ejb/snapshot/SnapshotProcessor.java

          This patch changes the construction of org.apache.geronimo.home.dir/var/monitoring/ to org.apache.geronimo.server.dir/var/monitoring/

          Show
          Russell E Glaue added a comment - geronimo-6281-snapshot.patch Modifies: plugins/monitoring/agent-jar/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java plugins/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/ejb/snapshot/SnapshotProcessor.java This patch changes the construction of org.apache.geronimo.home.dir/var/monitoring/ to org.apache.geronimo.server.dir/var/monitoring/
          Hide
          Russell E Glaue added a comment -

          geronimo-6281-karaf.patch
          Modifies: framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties

          This patch changes karaf.home with karaf.base for defining the path to (1) etc/shell.init.script, and (2) etc/equinox-debug.properties

          I initially misunderstood that karaf.base being set to "geronimoBase" is actually the same as being set to "org.apache.geronimo.server.dir". After reading through the procedure in "framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java" I see this is all being set correctly.

          After this change, my initial testing shows this fixes the reported issue with Karaf.

          Show
          Russell E Glaue added a comment - geronimo-6281-karaf.patch Modifies: framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties This patch changes karaf.home with karaf.base for defining the path to (1) etc/shell.init.script, and (2) etc/equinox-debug.properties I initially misunderstood that karaf.base being set to "geronimoBase" is actually the same as being set to "org.apache.geronimo.server.dir". After reading through the procedure in "framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java" I see this is all being set correctly. After this change, my initial testing shows this fixes the reported issue with Karaf.
          Hide
          Russell E Glaue added a comment -

          geronimo-6281-trunk-karaf.patch
          Modifies:
          trunk/framework/features/framework/src/main/distribution/text/etc/system.properties
          trunk/framework/features/client/src/main/filtered-resources/resources/instances/client/etc/system.properties

          This changes use of karaf.home to karaf.base in configuration files located only in trunk and are not found in branches/3.0-beta

          Show
          Russell E Glaue added a comment - geronimo-6281-trunk-karaf.patch Modifies: trunk/framework/features/framework/src/main/distribution/text/etc/system.properties trunk/framework/features/client/src/main/filtered-resources/resources/instances/client/etc/system.properties This changes use of karaf.home to karaf.base in configuration files located only in trunk and are not found in branches/3.0-beta
          Hide
          Russell E Glaue added a comment -

          The remaining files reported with the Karaf issue can actually be combined into their own issues, as follows:

          1. Issue: Server/Client start
            • Affected Code from branches/3.0-beta:
              • framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/RunClientMojo.java
              • framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
              • framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java
              • framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java
          2. Other Issue: Karaf Repository is the same as GERONIMO_HOME/repository - both should be changed at the same time. We'll open another jira for this
            • Additional Affected Code from trunk/
              • framework/features/client/src/main/filtered-resources/resources/instances/client/etc/org.ops4j.pax.url.mvn.cfg
          Show
          Russell E Glaue added a comment - The remaining files reported with the Karaf issue can actually be combined into their own issues, as follows: Issue: Server/Client start Affected Code from branches/3.0-beta: framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/RunClientMojo.java framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java Other Issue: Karaf Repository is the same as GERONIMO_HOME/repository - both should be changed at the same time. We'll open another jira for this Additional Affected Code from trunk/ framework/features/client/src/main/filtered-resources/resources/instances/client/etc/org.ops4j.pax.url.mvn.cfg
          Hide
          Forrest Xia added a comment -

          Hi Russell,

          Thanks for providing these patches. I am going through these patches one by one.

          Firstly, I think geronimo-6281-activemq.patch won't help resolve the issue when starting another instance within a same installation. To fix the issue, a configuration change should be made against "newinstance/var/config/config-substitutions.properties" like this:

          activemq.data = newinstance/var/activemq

          Will post more when touching other patches

          Show
          Forrest Xia added a comment - Hi Russell, Thanks for providing these patches. I am going through these patches one by one. Firstly, I think geronimo-6281-activemq.patch won't help resolve the issue when starting another instance within a same installation. To fix the issue, a configuration change should be made against "newinstance/var/config/config-substitutions.properties" like this: activemq.data = newinstance/var/activemq Will post more when touching other patches
          Hide
          Forrest Xia added a comment -

          Committed "geronimo-6281-snapshot.patch" to 3.0-beta@1291782 and trunk@1291784, thanks!

          Show
          Forrest Xia added a comment - Committed "geronimo-6281-snapshot.patch" to 3.0-beta@1291782 and trunk@1291784, thanks!
          Hide
          Forrest Xia added a comment -

          Committed "geronimo-6281-karaf.patch" to 3.0-beta@1291786 and trunk@1291787, thanks!

          Show
          Forrest Xia added a comment - Committed "geronimo-6281-karaf.patch" to 3.0-beta@1291786 and trunk@1291787, thanks!
          Hide
          Russell E Glaue added a comment -

          If we change the "activemq.data" property in "newinstance/var/config/config-substitutions.properties", then it MUST be changed as follows:

          activemq.data = /fullpathto/geronimo_home/newinstance/var/activemq

          Refer to the example I gave "showing ActiveMQ creating var directory relative to the path Geronimo was started". You can see that "activemq.data" is relative to the current working directory.

          So this means there is a potential problem when starting Geronimo as a Unix init service. If the init script does not "change directory" to GERONIMO_HOME, and "activemq.data = newinstance/var/activemq" then you will end up with ActiveMQ deploying all its files in "/etc/newinstance/var/activemq"

          I really believe we need to change the ActiveMQ to use GERONIMO_SERVER as the root working path instead of the current path Geronimo is in upon startup.

          Show
          Russell E Glaue added a comment - If we change the "activemq.data" property in "newinstance/var/config/config-substitutions.properties", then it MUST be changed as follows: activemq.data = /fullpathto/geronimo_home/newinstance/var/activemq Refer to the example I gave "showing ActiveMQ creating var directory relative to the path Geronimo was started". You can see that "activemq.data" is relative to the current working directory. So this means there is a potential problem when starting Geronimo as a Unix init service. If the init script does not "change directory" to GERONIMO_HOME, and "activemq.data = newinstance/var/activemq" then you will end up with ActiveMQ deploying all its files in "/etc/newinstance/var/activemq" I really believe we need to change the ActiveMQ to use GERONIMO_SERVER as the root working path instead of the current path Geronimo is in upon startup.
          Hide
          Russell E Glaue added a comment -

          Let's keep in mind GERONIMO-5164 GERONIMO-5988 . We want to be able to deploy a new instance of Geronimo with very little or no manual configuration in config-substitutions.

          If we leave as last proposed, setting activemq.data will be a requirement for any Geronimo instance, including the default.

          The workaround is for the shell to change directory to GERONIMO_SERVER before executing the startup procedure.
          -RG

          Show
          Russell E Glaue added a comment - Let's keep in mind GERONIMO-5164 GERONIMO-5988 . We want to be able to deploy a new instance of Geronimo with very little or no manual configuration in config-substitutions. If we leave as last proposed, setting activemq.data will be a requirement for any Geronimo instance, including the default. The workaround is for the shell to change directory to GERONIMO_SERVER before executing the startup procedure. -RG
          Hide
          Russell E Glaue added a comment -

          I just found this bug: GERONIMO-6272: server can not be started if installation path contains bracket "()"
          This is definitely related, and the resolution as I proposed will also resolve GERONIMO-6272

          Here is why:

          • When we start Geronimo, our start scripts take care of remove all unsafe characters and resolve sym links
          • GERONIMO_HOME, GERONIMO_SERVER are safe paths before being based on to startup the JVM
          • ActiveMQ uses the working directory path which may not be safe, as is the case with GERONIMO-6272

          This is another reason to change ActiveMQ to use GERONIMO_SERVER.
          ActiveMQ seems to want to use a variable named $

          {activemq.base}

          , but it does not appear to be set in Geronimo.

          Show
          Russell E Glaue added a comment - I just found this bug: GERONIMO-6272 : server can not be started if installation path contains bracket "()" This is definitely related, and the resolution as I proposed will also resolve GERONIMO-6272 Here is why: When we start Geronimo, our start scripts take care of remove all unsafe characters and resolve sym links GERONIMO_HOME, GERONIMO_SERVER are safe paths before being based on to startup the JVM ActiveMQ uses the working directory path which may not be safe, as is the case with GERONIMO-6272 This is another reason to change ActiveMQ to use GERONIMO_SERVER. ActiveMQ seems to want to use a variable named $ {activemq.base} , but it does not appear to be set in Geronimo.
          Hide
          Russell E Glaue added a comment -

          Where this should be done or not, when setting
          activemq.data = $

          {activemq.base}/var/activemq
          I receive this error output when I attempt to use ${activemq.base}

          in config-substitutions:

          WARN [JexlEngine] org.apache.aries.blueprint.ext.JexlExpressionParser.evaluate@56![0,13]: 'activemq.base;' undefined variable activemq.base

          It is similar to the error in GERONIMO-6272
          ActiveMQ is not able to find a safe path on its own. Thus Geronimo must configure a safe path for ActiveMQ.

          Show
          Russell E Glaue added a comment - Where this should be done or not, when setting activemq.data = $ {activemq.base}/var/activemq I receive this error output when I attempt to use ${activemq.base} in config-substitutions: WARN [JexlEngine] org.apache.aries.blueprint.ext.JexlExpressionParser.evaluate@56! [0,13] : 'activemq.base;' undefined variable activemq.base It is similar to the error in GERONIMO-6272 ActiveMQ is not able to find a safe path on its own. Thus Geronimo must configure a safe path for ActiveMQ.
          Hide
          Russell E Glaue added a comment -

          Okay,
          I figured out how to, for the time being, resolve this issue in a way that if this were done the user would not have to change activemq.data in config-substitutions.properties to account for a Geronimo instance configuration.

          Set activemq.data in GERONIMO_SERVER/var/config/config-substitions.properties to the following:

          activemq.data = $

          {org.apache.geronimo.server.dir}

          /var/activemq

          With the patch from GERONIMO-6275 applied, which always sets org.apache.geronimo.server.dir on startup, this will work. I consider this a temporary fix, however. I still advocate for ActiveMQ to internally use org.apache.geronimo.server.dir as the root path to activemq.data only if activemq.data is a relative path.

          Show
          Russell E Glaue added a comment - Okay, I figured out how to, for the time being, resolve this issue in a way that if this were done the user would not have to change activemq.data in config-substitutions.properties to account for a Geronimo instance configuration. Set activemq.data in GERONIMO_SERVER/var/config/config-substitions.properties to the following: activemq.data = $ {org.apache.geronimo.server.dir} /var/activemq With the patch from GERONIMO-6275 applied, which always sets org.apache.geronimo.server.dir on startup, this will work. I consider this a temporary fix, however. I still advocate for ActiveMQ to internally use org.apache.geronimo.server.dir as the root path to activemq.data only if activemq.data is a relative path.
          Hide
          Russell E Glaue added a comment -

          geronimo-6281-activemq-config-substitutions.patch
          This patch makes changes in config-substitution.properties are previously discussed.

          This patch is only a suggestion. However, it does resolve the issue with ActiveMQ documented in this jira.

          Show
          Russell E Glaue added a comment - geronimo-6281-activemq-config-substitutions.patch This patch makes changes in config-substitution.properties are previously discussed. This patch is only a suggestion. However, it does resolve the issue with ActiveMQ documented in this jira.
          Hide
          Forrest Xia added a comment -

          config-substitution.properties is dynamically generated when server is built, no source change for 3.0-beta. I've applied your config-substitutions patch into trunk@1292160. thanks!

          Show
          Forrest Xia added a comment - config-substitution.properties is dynamically generated when server is built, no source change for 3.0-beta. I've applied your config-substitutions patch into trunk@1292160. thanks!
          Hide
          Forrest Xia added a comment -

          Agreed that keep minimal manual steps when creating a new instance, however, PortOffset is a MUST change for any new instance if we don't expect a port conflict with the default server instance.

          In other words, keeping the changes happened in one place(config-substitutions.properties) is an acceptable way I think the user could be happy with

          For activemq.data, you just need to use a relative path for a new instance. For example, if the instance name is GERONIMO_SERVER=inst1, then you set it like this:
          activemq.data=inst1/var/activemq

          No need to add a absolute path there.

          Can we close this jira?

          Show
          Forrest Xia added a comment - Agreed that keep minimal manual steps when creating a new instance, however, PortOffset is a MUST change for any new instance if we don't expect a port conflict with the default server instance. In other words, keeping the changes happened in one place(config-substitutions.properties) is an acceptable way I think the user could be happy with For activemq.data, you just need to use a relative path for a new instance. For example, if the instance name is GERONIMO_SERVER=inst1, then you set it like this: activemq.data=inst1/var/activemq No need to add a absolute path there. Can we close this jira?
          Hide
          Russell E Glaue added a comment -

          "
          For activemq.data, you just need to use a relative path for a new instance. For example, if the instance name is GERONIMO_SERVER=inst1, then you set it like this:
          activemq.data=inst1/var/activemq

          No need to add a absolute path there.
          "

          The problem is that ActiveMQ access "activemq.data" relative to the directory you are in when you start Geronimo.
          That is if you start Geronimo, without the no configured instances, like this:

          • $ cd /opt
          • $ export GERONIMO_HOME=/opt/geronimo
          • $ /opt/geronomo/bin/geronimo start
            Then ActiveMQ uses the following path as "activemq.data":
          • /opt/var/activemq

          In this scenario, we want ActiveMQ to use GERONIMO_HOME/var/activemq, and not PWD/var/activemq
          For the configured instance example you provide, ActiveMQ would create /opt/inst1/var/activemq. It would not use /opt/geronimo/inst1/var/activemq as you would expect.

          Now take for example that I want to start Geronimo as a unix service.
          If GERONIMO_HOME=/opt/geronimo
          And the unix service starts geronimo in / (file system root)
          ActiveMQ will create /var/activemq
          ActiveMQ does not use GERONIMO_HOME/var/activemq as you would be expecting

          Geronimo will fail to start if it is being started by a non-root user since ActiveMQ will not have permissions to create /var/activemq

          How do we address this?
          My recommendation is to change ActiveMQ to use org.apache.geronimo.server.dir as the base path and not PWD.

          Show
          Russell E Glaue added a comment - " For activemq.data, you just need to use a relative path for a new instance. For example, if the instance name is GERONIMO_SERVER=inst1, then you set it like this: activemq.data=inst1/var/activemq No need to add a absolute path there. " The problem is that ActiveMQ access "activemq.data" relative to the directory you are in when you start Geronimo. That is if you start Geronimo, without the no configured instances, like this: $ cd /opt $ export GERONIMO_HOME=/opt/geronimo $ /opt/geronomo/bin/geronimo start Then ActiveMQ uses the following path as "activemq.data": /opt/var/activemq In this scenario, we want ActiveMQ to use GERONIMO_HOME/var/activemq , and not PWD/var/activemq For the configured instance example you provide, ActiveMQ would create /opt/inst1/var/activemq . It would not use /opt/geronimo/inst1/var/activemq as you would expect. Now take for example that I want to start Geronimo as a unix service. If GERONIMO_HOME=/opt/geronimo And the unix service starts geronimo in / (file system root) ActiveMQ will create /var/activemq ActiveMQ does not use GERONIMO_HOME/var/activemq as you would be expecting Geronimo will fail to start if it is being started by a non-root user since ActiveMQ will not have permissions to create /var/activemq How do we address this? My recommendation is to change ActiveMQ to use org.apache.geronimo.server.dir as the base path and not PWD.
          Hide
          Forrest Xia added a comment -

          Yes, as you said, it uses $PWD as the root dir, I does not notice that before

          I made a change in order to use o.a.g.server.dir property for activemq.data.

          3.0-beta@1292631, 3.0 trunk@1292632

          thanks!

          Show
          Forrest Xia added a comment - Yes, as you said, it uses $PWD as the root dir, I does not notice that before I made a change in order to use o.a.g.server.dir property for activemq.data. 3.0-beta@1292631, 3.0 trunk@1292632 thanks!
          Hide
          Forrest Xia added a comment -

          Russell, I set it to resolved, if not agreed, please reopen.

          Thank you for your great contribution!

          Show
          Forrest Xia added a comment - Russell, I set it to resolved, if not agreed, please reopen. Thank you for your great contribution!

            People

            • Assignee:
              Russell E Glaue
              Reporter:
              Russell E Glaue
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development