Announcement Announcement Module
Collapse
No announcement yet.
Exception when starting tomcat Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception when starting tomcat

    Hi all

    I hope you can help

    We are trying to use spring ROo for some quick development of a small web database app we need.

    I have followed the tutorial but to no avail i have googled around and for the following error people ahve suggested adding spring web and spring-webmvc jars in to WEB-INF/lib

    This hasnt made a difference

    also spring -2.0.7.jar has been mentioned which i have just added to the projects build path.

    Im sure its something simple as its obviously just a missing jar but i can find out what...

    Thanks for help!

    Code:
    23-Nov-2009 17:10:56 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: SpringSource tc Server/6.0.20.C
    23-Nov-2009 17:10:57 org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
          at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:57)
          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
          at org.apache.catalina.core.StandardService.start(StandardService.java:516)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:587)
          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:597)
          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:290)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
    Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1384)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
          ... 17 more

  • #2
    When you build your war (using mvn package, for example) the result should amonst other jars contain a org.springframework.core-3.0.0.RC1.jar (or RC2 if you're working against trunk) in your WEB-INF/lib that has the class that's not found. Check if it's there and please do NOT add any old Spring 2.0 jars to your war: Roo apps use Spring 3.0 (well, release candidates thereof for now).

    Comment


    • #3
      You should also ensure you do NOT place any Spring-related JARs anywhere inside your web container's classpath (like server, lib, ext directories). The only Spring-related JARs you need are included in the Roo WAR (and automatically provided when you use mvn tomcat:run or run a server within STS/Eclipse).

      Comment


      • #4
        Hi,

        I'm getting a similar error starting the tomcat server within STS. The weird thing is that this error doesn't happen every time. Only occasionally I get stuck with this error, and restarting STS sometimes would make it go away, and other times it doesn't. I haven't figured out what causes it and how to make it go away. I haven't made any changes to jars in the classpath when this error appears or disappears. Any ideas?

        Code:
        May 20, 2010 3:35:06 PM org.apache.catalina.core.StandardContext listenerStart
        SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
        java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
        	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1384)
        	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
        	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3877)
        	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
        	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        	at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
        	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        	at org.apache.catalina.startup.Catalina.start(Catalina.java:587)
        	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:597)
        	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:290)
        	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
        May 20, 2010 3:35:06 PM org.apache.catalina.core.StandardContext listenerStart
        SEVERE: Skipped installing application listeners due to previous error(s)

        Comment


        • #5
          Classloader weirdness. Certainly nothing to do with Roo, though. We don't mess with your application or server classloader at any stage.

          Comment

          Working...
          X