tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Peremsky <mperem...@yahoo.com>
Subject Re: Listener won't start -> NoClassDefFoundError
Date Wed, 25 Apr 2007 00:42:18 GMT
Thanks, switching to a ServletContextListener resolved the problem.
   
  

Pid <p@pidster.com> wrote:
  Mike Peremsky wrote:
> If it helps at all I am running on Windows XP.

If it's in the webapp directory, that explains it.
It's not in the same classloader.

You probably want ServletContextListener, rather than a 
LifecycleListener. The latter is a Tomcat interface, rather than a 
Servlet spec definition - which would be more useful to you.

Lifecycle is server related as opposed to application.

You'll need to add a 
attribute to your web.xml to make it work.


p



> Mike Peremsky wrote:
> 
> 
> Pid 
wrote: Rashmi Rubdi wrote:
>> Hi Mike,
>>
>> Someone has posted a solution to the new error you're getting:
>> http://mail-archives.apache.org/mod_mbox/tomcat-users/200512.mbox/%3C6.2.3.4.1.20051221120332.03c03fd0@pop.knowledgeplatform.com%3E

>>
>>
>> their solution was under:
>>
>> 6. Edited Tomcat 'server.xml' (in the 'conf' folder). Removed the line:
>>
> 
> 
> This only disables APR usage. Using APR is an improvement in most 
> cases, as it permits Tomcat to take advantage of native library code.
> This solution won't solve the problem below.
> 
> This just produced an additional error in the catalina log file:
> 
> Apr 23, 2007 9:39:50 AM org.apache.catalina.core.StandardContext start
> SEVERE: Error listenerStart
> Apr 23, 2007 9:39:50 AM org.apache.catalina.core.StandardContext start
> SEVERE: Context [/fs] startup failed due to previous errors
> 
> 
>> On 4/22/07, Mike Peremsky wrote:
>>> OK, I just reinstalled Tomcat 5.5.23 to resolve an issue with Tomcat 
>>> starting up. Now I have an issue with my listener not starting up. The 
>>> class in question LifecycleListener exists in the 
>>> %CATALINA_HOME%\server\lib\catalina.jar file. Do I need to set a 
>>> switch or something when calling startup.bat or setting something else 
>>> to use listeners? Why would it have an issue loading/finding 
>>> catalina.jar? There are no other error messages in my log file.
> 
> 
> Where is the jar with com.sf.listener.SingletonLoader?
> If it's not in server/lib (with catalina.jar) it won't share the right 
> classloader, and thus is unable to 'see' the interface class.
> 
> What function does it perform in your web application?
> 
> 
> This is not an additional jar file. It is a class in my webapp directory. It's purpose
is to load all the singletons for my application at application startup. So that there is
no visible delay at code execution time while data is loaded from the database.
> 
> 
> 
> 
> 
>>> Apr 22, 2007 10:31:32 PM org.apache.catalina.core.StandardContext 
>>> listenerStart
>>> SEVERE: Error configuring application listener of class 
>>> com.sf.listener.SingletonLoader
>>> java.lang.NoClassDefFoundError: org/apache/catalina/LifecycleListener
>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>>> at 
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>>> at 
>>> org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)

>>>
>>> at 
>>> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)

>>>
>>>
>>>
>>> The messages in the catalina.2007-04-22.log file are:
>>>
>>> Apr 22, 2007 10:31:31 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: 
>>> c:\java\jdk1.5.0_11\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program 
>>> Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\CA\SHARED~1\SCANEN~1;C:\PROGRA~1\CA\ETRUST~1;C:\Program

>>> Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\IDM 
>>> Computer 
>>> Solutions\UltraEdit-32;c:\java\jdk1.5.0_11\bin;c:\ant\bin;c:\apache-tomcat-5.5.23\bin

>>>
>>> Apr 22, 2007 10:31:31 PM org.apache.coyote.http11.Http11BaseProtocol init
>>> INFO: Initializing Coyote HTTP/1.1 on http-8080
>>> Apr 22, 2007 10:31:31 PM org.apache.catalina.startup.Catalina load
>>> INFO: Initialization processed in 625 ms
>>> Apr 22, 2007 10:31:31 PM org.apache.catalina.core.StandardService start
>>> INFO: Starting service Catalina
>>> Apr 22, 2007 10:31:31 PM org.apache.catalina.core.StandardEngine start
>>> INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
>>> Apr 22, 2007 10:31:31 PM org.apache.catalina.core.StandardHost start
>>> INFO: XML validation disabled
>>> Apr 22, 2007 10:31:32 PM org.apache.catalina.core.StandardContext start
>>> SEVERE: Error listenerStart
>>> Apr 22, 2007 10:31:32 PApr 22, 2007 10:31:32 PM 
>>> org.apache.catalina.core.StandardContext start
>>> SEVERE: Context [/fs] startup failed due to previous errors
>>> M org.apache.coyote.http11.Http11BaseProtocol start
>>> INFO: Starting Coyote HTTP/1.1 on http-8080
>>> Apr 22, 2007 10:31:32 PM org.apache.jk.common.ChannelSocket init
>>> INFO: JK: ajp13 listening on /0.0.0.0:8009
>>> Apr 22, 2007 10:31:32 PM org.apache.jk.server.JkMain start
>>> INFO: Jk running ID=0 time=0/31 config=null
>>> Apr 22, 2007 10:31:32 PM org.apache.catalina.storeconfig.StoreLoader load
>>> INFO: Find registry server-registry.xml at classpath resource
>>> Apr 22, 2007 10:31:32 PM org.apache.catalina.startup.Catalina start
>>> INFO: Server startup in 1578 ms
>>>
>>> - Mike
>>>
>>>
>>>
>>> ---------------------------------
>>> Ahhh...imagining that irresistible "new car" smell?
>>> Check outnew cars at Yahoo! Autos.
>> ---------------------------------------------------------------------
>> 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
>>
>>
> 
> 
> 
> 
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos. 
> 
> 
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check outnew cars at Yahoo! Autos.



       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message