Hello Tomcatters,

I am at loggerheads with a webapp that I was only provided as a
closed source WAR file.
I should mention that I am not a Java Servlet/JSP or Tomcat
hacker.

When I start Tomcat it throws an exception with regard to that
webapp's listener class.
As far as I understand the term "listener" seems to be a bit of a
misnomer
as no listening socktet (which I guess is termed a "connector" in
J2EE speech) is concerned
but rather a callback method provided by some webapp derived
class.

In $CATALINA_HOME/logs/catalina.out there appears following
entry:

Apr 4, 2008 3:09:11 PM org.apache.catalina.core.StandardContext
start
SEVERE: Error listenerStart
Apr 4, 2008 3:09:11 PM org.apache.catalina.core.StandardContext
start
SEVERE: Context [/aDISWeb] startup failed due to previous errors


...while in $CATALINA_HOME/logs/localhost.$(date +%Y-%m-%d).log
I can see the following exception handler trace:


Apr 4, 2008 3:09:11 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener
instance of class de.astec.aDISWeb.aDISEngine
java.lang.UnsatisfiedLinkError: no aDISWeb in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at
de.astec.aDISWeb.aDISEngine.contextInitialized(aDISEngine.java:13
2)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardCo
ntext.java:3764)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.ja
va:4216)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(Container
Base.java:760)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.jav
a:740)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
544)
        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfi
g.java:626)
        at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConf
ig.java:553)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java
:488)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138
)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.
java:311)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Life
cycleSupport.java:120)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1
022)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:736
)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1
014)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java
:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.ja
va:448)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java
:700)
        at
org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


I verified that the aDISEngine class file is present and readable
by user tomcat

# find $CATALINA_HOME/webapps -type f -name aDISEngine.class -ls
 34478    8 -rw-r--r--   1 tomcat   apache       5700 Sep 24
2007
/var/www/tomcat/current/webapps/aDISWeb/WEB-INF/classes/de/astec/
aDISWeb/aDISEngine.class


The JVM thread was started with these args:

# echo $(ps -o args= -p $(pgrep java))
/usr/java/jre1.5.0_12/bin/java -server -Dname=aDISWeb -Xms192m
-Xmx1024m -XX:NewSize=64m -XX:MaxNewSize=256m
-Djava.awt.headless=true
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/var/www/tomcat/current/conf/logg
ing.properties
-Djava.endorsed.dirs=/var/www/tomcat/current/common/endorsed
-Djava.io.tmpdir=/var/www/tomcat/current/temp
-Dcatalina.base=/var/www/tomcat/current
-Dcatalina.home=/var/www/tomcat/current -cp
/var/www/tomcat/current/bin/bootstrap.jar:/var/www/tomcat/current
/bin/commons-logging-api.jar
org.apache.catalina.startup.Bootstrap start


>From procfs I can verify that the JVM thread was started with
correctly set LD_LIBRARY_PATH


# tr \\0 \\012 < /proc/$(pgrep java)/environ|grep LIB
LD_LIBRARY_PATH=/usr/java/jre1.5.0_12/lib/amd64/server:/usr/java/
jre1.5.0_12/lib/amd64:/usr/java/jre1.5.0_12/../lib/amd64:/usr/loc
al/lib:/var/www/apache/modules


I also tried supplying to the JVM in $CATALINA_HOME/bin/setenv.sh
the additional switch
-Djava.library.path=/var/www/tomcat/current/webapps/aDISWeb/WEB-I
NF/classes/de/astec/aDISWeb

But there was no difference when I started Tomcat with this
setting.
I also assume that this is redundant as all lib paths for
deployed webapps should automatically be known to the JVM,
provided that the WAR file was complying to Tomcat's/SUN's
Servlet Specifications.


When I try to HEAD the webapp's servlet's mapping 
Tomcat serves me a 404.


# lwp-request -m head -S http://localhost:8081/aDISWeb/app
HEAD http://localhost:8081/aDISWeb/app --> 404 /aDISWeb/app
Connection: close
Date: Fri, 04 Apr 2008 13:34:02 GMT
Server: Apache-Coyote/1.1
Content-Length: 988
Content-Type: text/html;charset=utf-8
Client-Date: Fri, 04 Apr 2008 13:34:02 GMT
Client-Peer: 127.0.0.1:8081
Client-Response-Num: 1



However, I found out that when I wrap the listener tag in a
comment
within the deployment descriptor file,
and restart tomcat,
that I then don't get the listener error (of course not ;-)
and can successfully HEAD or GET the mapping.

# rcsdiff -r1.1 web.xml
=================================================================
==
RCS file: web.xml,v
retrieving revision 1.1
diff -r1.1 web.xml
21c21
<   <listener>
<listener-class>de.astec.aDISWeb.aDISEngine</listener-class>
</listener>
---
>   <!-- <listener>
<listener-class>de.astec.aDISWeb.aDISEngine</listener-class>
</listener> -->


# lwp-request -m head -S http://localhost:8081/aDISWeb/app
HEAD http://localhost:8081/aDISWeb/app --> 200 OK
Connection: close
Date: Fri, 04 Apr 2008 13:41:54 GMT
Server: Apache-Coyote/1.1
Content-Length: 1513
Content-Type: text/html;charset=UTF-8
Client-Date: Fri, 04 Apr 2008 13:41:54 GMT
Client-Peer: 127.0.0.1:8081
Client-Response-Num: 1


# lwp-request -m HEAD http://localhost:8081/aDISWeb/app|grep -i
content-length
Content-Length: 1513
# lwp-request -m GET http://localhost:8081/aDISWeb/app|wc -c
1513


What can I do to make it work with the listener class enabled
though?
Have I missed something?


Faithfully





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to