You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Giancarlo Frison <fr...@nimbuzz.com> on 2007/11/22 16:23:38 UTC

class loading problem: NoClassDefFoundError: javax/servlet/http/HttpSessionListener

Hi all,

I have Tomcat/6.0.14 and i'm trying to launch the catalina.sh throught
this script:

export JAVA_HOME="/opt/java"
export CATALINA_HOME="/opt/tomcat"
export CATALINA_BASE="/srv/webx"
export JAVA_OPTS="-Denvironment=test \
      -Xmx3800m -Xms3800m -Xmn2g -Xss128k -XX:+UseParallelGC
-XX:ParallelGCThreads=20 \
      -Dcom.sun.management.jmxremote \
      -Dcom.sun.management.jmxremote.port=9092 \
      -Dcom.sun.management.jmxremote.ssl=false \
      -Dcom.sun.management.jmxremote.authenticate=false"
"${CATALINA_HOME}/bin/catalina.sh" start

sometimes I encounter errors in logs/localhost* as

SEVERE: Skipped installing application listeners due to previous error(s)
Nov 22, 2007 3:09:53 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Error configuring application listener of class
com.nimbuzz.webx.jee.UserSessionListener
java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

instead catalina.out reports:

INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
Nov 22, 2007 3:09:53 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive webx.war
Nov 22, 2007 3:09:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Nov 22, 2007 3:09:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/webx] startup failed due to previous errors

the catalina.properties is the default version:
common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar
server.loader=
shared.loader=

the $catalina.home/lib contains these jars:
annotations-api.jar  catalina-ha.jar  catalina-tribes.jar 
jasper-el.jar  jasper-jdt.jar  servlet-api.jar    tomcat-dbcp.jar    
tomcat-i18n-fr.jar
catalina-ant.jar     catalina.jar     el-api.jar          
jasper.jar     jsp-api.jar     tomcat-coyote.jar  tomcat-i18n-es.jar 
tomcat-i18n-ja.jar

I'm wondering what mistake I done.
Someone can help me?

Giancarlo Frison

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


RE: class loading problem: NoClassDefFoundError: javax/servlet/http/HttpSessionListener

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Giancarlo Frison [mailto:frison@nimbuzz.com] 
> Subject: class loading problem: NoClassDefFoundError: 
> javax/servlet/http/HttpSessionListener
> 
> java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionListener

The above is frequently caused by having the servlet-api.jar in your
webapp's WEB-INF/lib directory.  You must not have the same jar in
multiple places in a single branch of the classloader tree.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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


Re: class loading problem: NoClassDefFoundError: javax/servlet/http/HttpSessionListener

Posted by Giancarlo Frison <fr...@nimbuzz.com>.
Absolutely no. The WEB-INF/lib contains:
commons-codec-1.3.jar        commons-httpclient-3.1-rc1.jar 
jta.jar           quartz-all-1.6.0.jar  stringtree-json-2.0.5.jar 
commons-collections-3.2.jar  commons-logging.jar            
log4j-1.2.14.jar  spring.jar            xmlpull.jar                xpp3.jar

CATALINA_HOME and CATALINA_BASE are different. Would it be this the
reason? Have I to set something specific on catalina.properties or
wherever for such case?


Pid ha scritto:
> Have you inadvertently included a jar file with the servlet-api in your
> WEB-INF/lib directory?
>
> That often causes problems like this.
>
> p
>
>   


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


Re: class loading problem: NoClassDefFoundError: javax/servlet/http/HttpSessionListener

Posted by Pid <p...@pidster.com>.
Have you inadvertently included a jar file with the servlet-api in your
WEB-INF/lib directory?

That often causes problems like this.

p


Giancarlo Frison wrote:
> Hi all,
> 
> I have Tomcat/6.0.14 and i'm trying to launch the catalina.sh throught
> this script:
> 
> export JAVA_HOME="/opt/java"
> export CATALINA_HOME="/opt/tomcat"
> export CATALINA_BASE="/srv/webx"
> export JAVA_OPTS="-Denvironment=test \
>       -Xmx3800m -Xms3800m -Xmn2g -Xss128k -XX:+UseParallelGC
> -XX:ParallelGCThreads=20 \
>       -Dcom.sun.management.jmxremote \
>       -Dcom.sun.management.jmxremote.port=9092 \
>       -Dcom.sun.management.jmxremote.ssl=false \
>       -Dcom.sun.management.jmxremote.authenticate=false"
> "${CATALINA_HOME}/bin/catalina.sh" start
> 
> sometimes I encounter errors in logs/localhost* as
> 
> SEVERE: Skipped installing application listeners due to previous error(s)
> Nov 22, 2007 3:09:53 PM org.apache.catalina.core.StandardContext
> listenerStart
> SEVERE: Error configuring application listener of class
> com.nimbuzz.webx.jee.UserSessionListener
> java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionListener
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> 
> instead catalina.out reports:
> 
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
> Nov 22, 2007 3:09:53 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive webx.war
> Nov 22, 2007 3:09:53 PM org.apache.catalina.core.StandardContext start
> SEVERE: Error listenerStart
> Nov 22, 2007 3:09:53 PM org.apache.catalina.core.StandardContext start
> SEVERE: Context [/webx] startup failed due to previous errors
> 
> the catalina.properties is the default version:
> common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar
> server.loader=
> shared.loader=
> 
> the $catalina.home/lib contains these jars:
> annotations-api.jar  catalina-ha.jar  catalina-tribes.jar 
> jasper-el.jar  jasper-jdt.jar  servlet-api.jar    tomcat-dbcp.jar    
> tomcat-i18n-fr.jar
> catalina-ant.jar     catalina.jar     el-api.jar          
> jasper.jar     jsp-api.jar     tomcat-coyote.jar  tomcat-i18n-es.jar 
> tomcat-i18n-ja.jar
> 
> I'm wondering what mistake I done.
> Someone can help me?
> 
> Giancarlo Frison
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


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