Uploaded image for project: '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
    • Status: Resolved
    • Priority: 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
      

        Attachments

        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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: