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

                 Key: GERONIMO-6281
                 URL: https://issues.apache.org/jira/browse/GERONIMO-6281
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: ActiveMQ, javaee6
    Affects Versions: 3.0-beta-1
         Environment: Linux x86, Red Hat Enterprise Linux Server release 5.4 
(Tikanga); Java JDK1.6.0_25
            Reporter: Russell E Glaue
            Priority: Minor


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:
# org.apache.geronimo.home.dir (GERONIMO_HOME)
# org.apache.geronimo.server.dir (GERONIMO_SERVER - new shell variable 
introduced in GERONIMO-6275)
# karaf.base
# 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:
# SnapshotConfigXMLBuilder - originally reported in GERONIMO-6270
# ActiveMQ - is reported in a comment of GERONIMO-5987 , and is being reported 
here as requested.
# Karaf - is additionally reported in GERONIMO-6174 .

Note the three issues in startup:
# Karaf initialization script etc/shell.init.script
-- Error in initialization script: 
/data/geronimo2/geronimo-tomcat7-javaee6-3.0-SNAPSHOT-20111220/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
# SnapshotConfigXMLBuilder var/monitoring/
-- (A) ERROR [SnapshotConfigXMLBuilder] Could not make the directory 
/data/geronimo2/geronimo-tomcat7-javaee6-3.0-SNAPSHOT-20111220/var/monitoring/
-- (B) ERROR [SnapshotConfigXMLBuilder] 
/data/geronimo2/geronimo-tomcat7-javaee6-3.0-SNAPSHOT-20111220/var/monitoring/snapshot-config.xml
 (Not a directory)
-- Reason:
--- This is because SnapshotConfigXMLBuilder is looking for 
GERONIMO_HOME/var/monitoring
-- Solution:
--- SnapshotConfigXMLBuilder should instead be looking for 
GERONIMO_SERVER/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
# ActiveMQ Lock File
-- WARN  [AMQPersistenceAdapter] Waiting to Lock the Store var/activemq
-- Reason:
--- This is because the JMSBrokerPortlet 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.
-- Solution:
--- A full path to the var directory should be used, or at least a path 
relative to org.apache.geronimo.server.dir
--- The full path to var should be within org.apache.geronimo.server.dir
-- 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:
# 
https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+multiple+Geronimo+instances
# Then remove the GERONIMO_HOME/var and GERONIMO_HOME/etc directories
# 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
{noformat:borderStyle=solid}
[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
{noformat}


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.
{noformat:borderStyle=solid}
[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
{noformat}





--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to