2

while running SpringMVC program through eclipse showing below error

'Starting Tomcat v8.0 at localhost' has encountered a problem. Server Tomcat v8.0 Server at localhost failed to start.

using eclipse luna configured with tomcat 8.0

below is the relevant stacktrace of the error

Caused by: org.apache.catalina.LifecycleException: Failed to start component     [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MVCValidation    sApp7SFC]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    ... 6 more
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2499)
    at java.lang.Class.getDeclaredFields(Class.java:1811)
    at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
    at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:256)
    at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:132)
    at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
    at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:334)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:774)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5053)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more

Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.Log
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
    ... 20 more

2 Answers 2

3

As you ccn see in the root exception: Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.Log

You miss the commons-logging.jar in your classpath.

Sign up to request clarification or add additional context in comments.

1 Comment

oh! thank you so much @jens I forgot to add that jar. i am thinking why it is showing tomcat error...
2

In my non-Spring web app I had a similar problem. I solved it by checking the .classpath file and corrected this entry:

<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    <attributes>
        <attribute name="maven.pomderived" value="true"/>
        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
    </attributes>
</classpathentry>

The attribute org.eclipse.jst.component.dependency had been missing.

1 Comment

Had the same problem (Tomcat7, Spring-based webapp built with Java11)... maybe because this .classpath has been generated by call to mvn eclipse:eclipse; I should deffo continue investigating this...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.