Error deploying configurationg descriptor cpas.xml

CPAS Forum (Inactive)
Error deploying configurationg descriptor cpas.xml <1629>  2007-01-08 13:54
Status: Closed
Assigned To: adam
 
I've followed the steps in setting up CPAs using Tomcat(5.5.15), PostgreSQL(8.1), and Java (1.5.0) and have set all the $PATHs and symbolic links, all on a SUSE 10 server. However, when I use the startup.sh script, I get the following error:

...
2007-01-08 17:05:11,845 [main] ERROR org.apache.catalina.startup.HostConfig - Error deploying configuration descriptor cpas.xml
java.io.IOException: java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: start: : java.lang.NoClassDefFoundError: org/apache/catalina/loader/WebappClassLoader

...
 
 
jeckels responded:  2007-01-08 17:33
It looks like Tomcat is having trouble finding the CPAS classloader.

The class that it's complaining about should be part of a standard Tomcat installation. Can you verify that your installation has a copy of catalina.jar in $TOMCAT_HOME/server/lib? Also, can you verify that there is a copy of cpasBootstrap.jar in that same directory?

Thanks,
Josh
 
<1629> responded:  2007-01-09 06:27
Yes, $TOMCAT_HOME/server/lib contains catalina.jar and cpasBootstrap.jar.

This is on a SUSE server which comes with Tomcat and Java. Unfortunately the Java version is 1.4.2 and I've installed Java 1.5.0-9. When I removed Java 1.4.2, all sorts of things broke when running $TOMCAT_HOME/bin/startup.sh because of missing jar files and symbolic links.
 
jeckels responded:  2007-01-09 13:48
Title: Error deploying configuration descriptor cpas.xml
First, please be sure that $JAVA_HOME is set and points to your Java 1.5.x installation.

Second, please enable verbose classloading so we can tell where Tomcat is looking for class files. Edit $TOMCAT_HOME/bin/catalina.sh and add a line that says:

JAVA_OPTS=-verbose:class

after the comments at the top of the file. Then try starting up the server again and attach $TOMCAT_HOME/logs/catalina.out (which should contain a lot of lines of the form "Loaded org.apache.catalina.storeconfig.IStoreFactory from file:/C:/Tomcat5.5/server/lib/catalina-storeconfig.jar") to a message here on the support board.

Thanks,
Josh
 
<1629> responded:  2007-01-10 08:45
OK, I've since reinstalled Tomcat from source and removed all Java 1.4.x versions. I'm now getting this message when running $TOMCAT_HOME/bin/startup.sh



Jan 10, 2007 11:57:38 AM org.apache.catalina.loader.WebappLoader start
SEVERE: LifecycleException
java.lang.IllegalArgumentException: Unable to find modules directory - /usr/local/modules, this can be set with -Dcpas.modulesDir=<modulesDir>
        at org.fhcrc.cpas.bootstrap.CpasBootstrapClassLoader.setResources(CpasBootstrapClassLoader.java:53)
        at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:639)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4076)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1181)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
        at java.lang.Thread.run(Thread.java:595)
Jan 10, 2007 11:57:38 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
LifecycleException: start: : java.lang.IllegalArgumentException: Unable to find modules directory - /usr/local/modules, this can be set with -Dcpas.modules
Dir=<modulesDir>
        at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:675)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4076)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1181)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
        at java.lang.Thread.run(Thread.java:595)
Jan 10, 2007 11:57:38 AM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor cpas.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: start: : java.lang.IllegalArgumentException: Unable to find modules dir
ectory - /usr/local/modules, this can be set with -Dcpas.modulesDir=<modulesDir>
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:763)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1181)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
        at java.lang.Thread.run(Thread.java:595)
 
jeckels responded:  2007-01-10 15:30
CPAS is making it further than it did before, but it's now unable to find your modules directory. Typically, this is a sibling directory of the cpaswebapp directory. If you don't specify another location, CPAS will look for it there. I'm not sure if you've explicitly set cpas.moduleDir, or if it's defaulting to /usr/local/modules because you have your webapp in /usr/local/cpaswebapp.

You have two options:

1. Move your modules directory (included as part of the .tar.gz distribution) to /usr/local/modules.
2. Edit catalina.sh and set the value of JAVA_OPTS to "-Dcpas.modulesDir=<your_modules_dir>".

Josh
 
<1629> responded:  2007-01-11 06:28
I've followed the instructions and installed everything in /usr/local/cpas. In that directory we've got cpaswebapp and modules and bin. I've gone ahead and set up a symbolic link to /usr/local/cpas/modules from /usr/local/modules.

Currently in catalina.sh JAVA_OPTS is set to -verbose:class. I've changed it to what you've stated. New error now when I start about announcement.jar, a file that doesn't exist on the server:



[/usr/local/tomcat/bin] # ./startup.sh ; tail -30 ../logs/catalina.out
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.5.0_09/jre

Jan 11, 2007 9:32:57 AM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor cpas.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: start: : java.lang.RuntimeException: java.io.FileNotFoundException: /usr/local/cpas/WEB-INF/lib/announcement.jar (No such file or directory)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:763)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jan 11, 2007 9:32:58 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 11, 2007 9:32:59 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jan 11, 2007 9:32:59 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/59 config=null
Jan 11, 2007 9:32:59 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jan 11, 2007 9:32:59 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2812 ms
 
<1629> responded:  2007-01-11 11:20
Thanks for the help. We made a slight correction in pointing to /usr/local/cpas/cpaswenapp, which is the current doc base. However, two things come to mind. Starting Tomcat shows that we're pointing to JRE_HOME instead of JAVA_HOME.

Second, I now get an error about the Apache Tomcat Native library, which appears to be a problem with ARP. However, that is installed and in my LD_LIBRARY_PATH. Here is what I see when I shutdown and then startup Tomcat:

Jan 11, 2007 2:27:39 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:27:40 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jan 11, 2007 2:27:41 PM org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:27:41 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Failed shutdown of Apache Portable Runtime
Jan 11, 2007 2:27:56 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.5.0_09/jre/lib/i386/server:/usr/java/jdk1.5.0_09/jre/lib/i386:/usr/java/jdk1.5.0_09/jre/../lib/i386
Jan 11, 2007 2:27:56 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:27:56 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 966 ms
Jan 11, 2007 2:27:56 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 11, 2007 2:27:56 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Jan 11, 2007 2:27:56 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jan 11, 2007 2:28:24 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:28:25 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jan 11, 2007 2:28:25 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/35 config=null
Jan 11, 2007 2:28:25 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jan 11, 2007 2:28:25 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 28833 ms
Jan 11, 2007 2:31:10 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:31:11 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jan 11, 2007 2:31:12 PM org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:31:12 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Failed shutdown of Apache Portable Runtime
Jan 11, 2007 2:32:13 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.5.0_09/jre/lib/i386/server:/usr/java/jdk1.5.0_09/jre/lib/i386:/usr/java/jdk1.5.0_09/jre/../lib/i386
Jan 11, 2007 2:32:13 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:32:13 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1023 ms
Jan 11, 2007 2:32:13 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 11, 2007 2:32:13 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Jan 11, 2007 2:32:13 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled


Jan 11, 2007 2:32:40 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 11, 2007 2:32:40 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jan 11, 2007 2:32:41 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/35 config=null
Jan 11, 2007 2:32:41 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jan 11, 2007 2:32:41 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 27838 ms



NFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.5.0_09/jre/lib/i386/server:/usr/java/jdk1.5.0_09/jre/lib/i386:/usr/java/jdk1.5.0_09/jre/../lib/i386
 
jeckels responded:  2007-01-11 15:04
Pointing to a JRE is fine for CPAS. Our Windows installer includes just the JRE, not the full JDK, so you shouldn't run into any problems.

Additionally, the Apache Native Library is completely optional. It looks like you may need to add a -Djava.library.path=<your path> in catalina.sh to make Java find it on your system, but it's not required. This page may have some useful information. http://www.jguru.com/faq/view.jsp?EID=970296

It looks like your CPAS server started successfully, so hopefully you're now up and running.
 
<1629> responded:  2007-01-16 08:29
Well, at present, it appears that the Tomcat server can't connect to the PostgreSQL server. I've configured Postgres the correct way (noting that pg_hba.conf and postgresql.conf are set correctly) and that I can connect to the default Postgres port (5432) on the server. However, I still get the error:


org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Any idea where else I should be looking?
 
jeckels responded:  2007-01-17 14:42
$TOMCAT_HOME/conf/Catalina/localhost/cpas.xml contains the database configuration, so be sure that it's pointing at the right place.

Is your Postgres server running on a different server for your Tomcat installation? If so, you could try telnetting from the Tomcat server to the Postgres server on port 5432 to make sure that it's accepting connections from other machines. It sounds as though you've already made the edit to tell Postgres to allow connections from external machines - by default it usually does not.

We also have a small test program to test Postgres connections. It's described in this support posting:

https://cpas.fhcrc.org/announcements/home/support/thread.view?rowId=50

Josh