Announcement Announcement Module
Collapse
No announcement yet.
NoClassDefFoundError ContextLoaderListener when running in tc server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoClassDefFoundError ContextLoaderListener when running in tc server

    I have created a new roo project in STS 2.2.1 with Roo RC3 and when I deploy to TC server I get the following message:

    SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListe ner
    java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener

    I can run on the command line with mvn tomcat:run without a problem.

    The spring jars appear in the referenced libraries and in the project classpath.

    Any ideas??

    I previously had STS 2.1.0 with Roo RC1 installed, which I have deleted now.

  • #2
    serenapotts,

    I'm not able to reproduce this error with STS 2.2.1 and the contained tc Server. Here is what I did:

    1. Extracted/installed STS 2.2.1
    2. Created a new Roo project with the "New Roo Project" wizard
    3. Setup persistence
    4. Created a basic entity with two fields
    5. Created a scaffolding controller for the created entity
    6. Deployed the project to the embedded tc Server in STS (from the Servers view)
    7. Open my web app in my browser. All works!

    What am I doing differently then you?

    The class that is missing in your case is actually being loaded out of the servlet-api.jar inside the lib directory of tc Server. Can you check that this jar is there?

    Christian

    Comment


    • #3
      I have cleaned the .project and .classpath files and rebuilt and deployed to STS and it deploys now. I did have STS 2.1.0 previously installed and some projects in that with RC1. But new projects were giving me the error too. Anyway thanks but all seems to be working now.

      Comment


      • #4
        Flex Roo on tc server issue

        Same problem here.

        persistence setup --provider HIBERNATE --database H2_IN_MEMORY
        flex setup
        entity --class ~.domain.Product
        field number --type java.lang.Integer --fieldName productId --notNull
        flex remoting all --package ~.service

        Deployed to tc server Dev Edition v2.0:

        PHP Code:
        1-okt-2010 2:40:19 com.springsource.tcserver.security.PropertyDecoder <init>
        INFOtc Runtime property decoder using memory-based key
        1
        -okt-2010 2:40:20 com.springsource.tcserver.security.PropertyDecoder <init>
        INFOtcServer Runtime property decoder has been initialized in 416 ms
        1
        -okt-2010 2:40:20 com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
        INFO
        Started up JMX registry on 127.0.0.1:6969 in 195 ms
        1
        -okt-2010 2:40:20 org.apache.coyote.http11.Http11Protocol init
        INFO
        Initializing Coyote HTTP/1.1 on http-8080
        1
        -okt-2010 2:40:20 org.apache.catalina.startup.Catalina load
        INFO
        Initialization processed in 1046 ms
        1
        -okt-2010 2:40:20 org.apache.catalina.core.StandardService start
        INFO
        Starting service Catalina
        1
        -okt-2010 2:40:20 org.apache.catalina.core.StandardEngine start
        INFO
        Starting Servlet EngineSpringSource tc Runtime/2.0.3.RELEASE
        1
        -okt-2010 2:40:20 org.apache.catalina.startup.HostConfig deployDescriptor
        INFO
        Deploying configuration descriptor manager.xml
        1
        -okt-2010 2:40:21 org.apache.catalina.startup.HostConfig deployDescriptor
        INFO
        Deploying configuration descriptor RooFlexWebstore.xml
        1
        -okt-2010 2:40:21 org.apache.catalina.core.StandardContext listenerStart
        SEVERE
        Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
        java
        .lang.ClassNotFoundExceptionorg.springframework.web.context.ContextLoaderListener
            at org
        .apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
            
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
            
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4078)
            
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
            
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
            
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
            
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:568)
            
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
            
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
            
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
            
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1282)
            
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
            
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
            
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
            
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:807)
            
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
            
        at org.apache.catalina.core.StandardService.start(StandardService.java:519)
            
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
            
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
            
        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:289)
            
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
        1-okt-2010 2:40:21 org.apache.catalina.core.StandardContext listenerStart
        SEVERE
        Skipped installing application listeners due to previous error(s)
        1-okt-2010 2:40:21 org.apache.catalina.core.StandardContext start
        SEVERE
        Error listenerStart
        1
        -okt-2010 2:40:21 org.apache.catalina.core.StandardContext start
        SEVERE
        Context [/RooFlexWebstorestartup failed due to previous errors
        2010
        -10-01 02:40:23,542 WARN  [org.springframework.jmx.support.JmxUtils][main] - Found more than one MBeanServer instanceReturning first from list. 
        Latest STS, Flex Roo and Roo.

        Any ideas on how to fix this?

        Rebuild redeploy didn't seem to fix it and dont know how to do this:
        "I have cleaned the .project and .classpath"

        Thanks a lot in advance, would be awesome to get Flex Roo running somehow.

        Jochen

        EDIT: Managed to fix this...I think I just rightclicked the project >spring tools>update maven dependencies>
        Last edited by Dr.Drane; Oct 9th, 2010, 07:21 AM.

        Comment

        Working...
        X