Results 1 to 7 of 7

Thread: STS 3.1.0.RELEASE not working out of the box for me due to NoClassDefFoundErrors

  1. #1
    Join Date
    Oct 2012
    Posts
    8

    Default STS 3.1.0.RELEASE not working out of the box for me due to NoClassDefFoundErrors

    Hi,

    Here is what I did:
    1. I downloaded STS [integrated with J2EE Eclipse]
    2. I created a Spring MVC application using the template in STS. No new code has been added from my side yet.
    3. I did a build of the Spring MVC application within STS and that worked without a problem
    4. I deployed the MVC application to the bundled server: “VMWare vFabric tc Server Developer Edition v2.7” and attempted to start it.

    My NoClassDefFoundErrors started when I started the server in step #4 above. Here is what I believe is missing:
    a. NoClassDefFoundError for NestedRuntimeException - To solve this, I separately downloaded Spring 3.1.0 release and copied all the jars under the "dist" directory to the following directory for the tc server: springsource/vfabric-tc-server-developer-2.7.2.RELEASE/tomcat-7.0.30.A.RELEASE/lib
    b. I then ran into error for org/apache/commons/logging/LogFactory - To solve this, I added 3 sl4j jars to the lib directory: slf4j-api-1.5.10.jar, slf4j-log4j12-1.5.10.jar, jcl-over-slf4j-1.5.10.jar
    c. Then, I got an error for org/apache/log4j/Level - So, I added log4j-1.2.15.jar

    This still did not solve the problem. So, I have a bigger question:
    Does the STS tc server not work out of the box for an application created with the template (with no user code) OR am I doing something wrong?
    I strongly believe that the patching I am doing with jars is probably not the recommended way - so, could someone please help me out? I have already spent 3 days looking at this.
    If you need any more details about what I am doing or exact error stack traces, please let me know.

    Regards

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    There must be something wrong with your install. Did the exact same thing a couple of days ago (Spring MVC application), simply added it to the server (in STS), press start and it ran.

    So maybe you did something weird in your deployment? Also you shouldn't add those libraries to the server they should be part of your application and hence should be in the WEB-INF/lib directory of your appplication.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Oct 2012
    Posts
    8

    Default

    Quote Originally Posted by Marten Deinum View Post
    There must be something wrong with your install. Did the exact same thing a couple of days ago (Spring MVC application), simply added it to the server (in STS), press start and it ran.

    So maybe you did something weird in your deployment? Also you shouldn't add those libraries to the server they should be part of your application and hence should be in the WEB-INF/lib directory of your appplication.
    I am afraid, I need more specific help. To provide you with more details about my install and errors:

    1. I followed instructions @ http://manueljordan.wordpress.com/20...ce-tool-suite/
    2. The errors I am seeing are at the bottom of this reply.
    3. My application does not have a WEB-INF/lib directory. I have attached a screenshot of my application structure.


    ----
    ERRORS:
    Oct 17, 2012 9:30:24 AM com.springsource.tcserver.security.PropertyDecoder <init>
    INFO: tc Runtime property decoder using memory-based key
    Oct 17, 2012 9:30:24 AM com.springsource.tcserver.security.PropertyDecoder <init>
    INFO: tcServer Runtime property decoder has been initialized in 479 ms
    Oct 17, 2012 9:30:27 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    Oct 17, 2012 9:30:28 AM com.springsource.tcserver.serviceability.rmi.JmxSo cketListener init
    INFO: Started up JMX registry on 127.0.0.1:6969 in 359 ms
    Oct 17, 2012 9:30:28 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 4242 ms
    Oct 17, 2012 9:30:28 AM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Oct 17, 2012 9:30:28 AM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: VMware vFabric tc Runtime 2.7.2.RELEASE/7.0.30.A.RELEASE
    Oct 17, 2012 9:30:28 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor C:\MyProgramFiles\SpringSTS_EclipseJuno\springsour ce\vfabric-tc-server-developer-2.7.2.RELEASE\base-instance\conf\Catalina\localhost\MasterFrameworkMV C.xml
    Oct 17, 2012 9:30:28 AM org.apache.catalina.startup.SetContextPropertiesRu le begin
    WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MasterFrameworkMVC' did not find a matching property.
    Oct 17, 2012 9:30:30 AM org.apache.catalina.core.ContainerBase addChildInternal
    SEVERE: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MasterFrameworkMVC]]
    at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:154)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:618)
    at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:650)
    at org.apache.catalina.startup.HostConfig$DeployDescr iptor.run(HostConfig.java:1582)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.NoClassDefFoundError: org/springframework/core/NestedRuntimeException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader. java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :615)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:2904)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:1173)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1681)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1559)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader. java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :615)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:2904)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:1173)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1681)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1559)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader. java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :615)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:2904)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:1173)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1681)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1559)
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.jav a:2291)
    at java.lang.Class.getDeclaredFields(Class.java:1743)
    at org.apache.catalina.util.Introspection.getDeclared Fields(Introspection.java:87)
    at org.apache.catalina.startup.WebAnnotationSet.loadF ieldsAnnotation(WebAnnotationSet.java:261)
    at org.apache.catalina.startup.WebAnnotationSet.loadA pplicationListenerAnnotations(WebAnnotationSet.jav a:90)
    at org.apache.catalina.startup.WebAnnotationSet.loadA pplicationAnnotations(WebAnnotationSet.java:65)
    at org.apache.catalina.startup.ContextConfig.applicat ionAnnotationsConfig(ContextConfig.java:405)
    at org.apache.catalina.startup.ContextConfig.configur eStart(ContextConfig.java:881)
    at org.apache.catalina.startup.ContextConfig.lifecycl eEvent(ContextConfig.java:369)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecyc leEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInte rnal(StandardContext.java:5173)
    at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:150)
    ... 11 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.core.NestedRuntimeException
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1559)
    ... 49 more
    Oct 17, 2012 9:30:30 AM org.apache.catalina.startup.HostConfig deployDescriptor
    SEVERE: Error deploying configuration descriptor C:\MyProgramFiles\SpringSTS_EclipseJuno\springsour ce\vfabric-tc-server-developer-2.7.2.RELEASE\base-instance\conf\Catalina\localhost\MasterFrameworkMV C.xml
    java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MasterFrameworkMVC]]
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:904)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:618)
    at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:650)
    at org.apache.catalina.startup.HostConfig$DeployDescr iptor.run(HostConfig.java:1582)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Oct 17, 2012 9:30:30 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\MyProgramFiles\SpringSTS_EclipseJuno\springsour ce\vfabric-tc-server-developer-2.7.2.RELEASE\base-instance\webapps\manager
    Oct 17, 2012 9:30:31 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\MyProgramFiles\SpringSTS_EclipseJuno\springsour ce\vfabric-tc-server-developer-2.7.2.RELEASE\base-instance\webapps\ROOT
    Oct 17, 2012 9:30:31 AM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-bio-8080"]
    Oct 17, 2012 9:30:31 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 3000 ms


    ----

    SpringMVCApp.jpg

  4. #4
    Join Date
    Oct 2012
    Posts
    8

    Default

    The problem on my install is resolved. However, I don't have a satisfactory explanation for why it is now gone. A few things that I did are:

    a. Force a Maven build on the project so that the dependencies are downloaded
    b. Clean the project [Project-->Clean]
    c. Go to: Window-->Preferences-->Maven and then Unselect the "Do not automatically update dependencies from remote repositories" [I am not sure I want this in the long term]

    I requested a colleague at work to install following the instructions I did and he is now getting the same problem. The above did not solve the problem for him. So, this is an unsatisfactory end to this but now I am going to move on to actually developing code using the MVC template. Thanks for the reply Marten - appreciate it!

    Regards

  5. #5
    Join Date
    Oct 2012
    Location
    Krakow, Poland
    Posts
    12

    Default

    Quote Originally Posted by utester View Post
    1. I followed instructions @ http://manueljordan.wordpress.com/20...ce-tool-suite/
    (...)
    3. My application does not have a WEB-INF/lib directory.
    Hi utester,

    Any chance for sharing the application? I would import it into my workspace and see if I get the same stack trace.

    Cheers,
    --
    Tomasz Zarna
    Software Engineer, IDE Tools
    Committer, Eclipse Platform, Orion, EGit
    http://tasktop.com

  6. #6
    Join Date
    Jun 2012
    Location
    San Francisco
    Posts
    2

    Default

    I have the same issue when trying to use the MVC Template (Spring Version: 3.1.0.RELEASE
    Build Id: 201210061306). I use the defaults that Spring gives me and when I run the http://localhost:8080/PerformanceMVC...views/home.jsp. I receive HTTP Status 404 - type Status report
    message - description The requested resource () is not available. I'm running on vFabric tc Runtime 2.7.1.RELEASE/7.0.29.A.RELEASE

    Any ideas?

  7. #7
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey!

    Quote Originally Posted by SJohann View Post
    I have the same issue when trying to use the MVC Template (Spring Version: 3.1.0.RELEASE
    Build Id: 201210061306). I use the defaults that Spring gives me and when I run the http://localhost:8080/PerformanceMVC...views/home.jsp. I receive HTTP Status 404 - type Status report
    message - description The requested resource () is not available. I'm running on vFabric tc Runtime 2.7.1.RELEASE/7.0.29.A.RELEASE
    I guess your project is called "PerformanceMVC", right? And you deployed that from within your workspace via drag&drop into tc Server? What happens if you just try http://localhost:8080/PerformanceMVC? That is working for me. The web.xml is configured to delegate the root of your app to the main dispatcher servlet of Spring, which then controls the views, etc.

    HTH,
    Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •