ClassNotFoundException when running a Spring + Maven2 project on Tomcat 6 from within Eclipse 3.5

后端 未结 4 667
醉梦人生
醉梦人生 2020-12-28 18:53

When trying to launch a Web project from within Eclipse I get:


SEVERE: Error configuring application listener of class org.springframework.web.context.Conte         


        
相关标签:
4条回答
  • 2020-12-28 19:11

    I had the same symptom with a different cause. I had to edit my .classpath file. The maven entry:

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

    ...was lacking the attributes tag shown here. When I added the attributes tag the problem went away. I'm very curious how to configure that in the eclipse ui.

    0 讨论(0)
  • 2020-12-28 19:19

    Note that the steps to install the WTP integration have changed.

    See: Maven/Tomcat Projects In Eclipse Indigo/3.7

    0 讨论(0)
  • 2020-12-28 19:29

    From time to time, face with same problem.

    For some strange reason, this problem could be fixed this way

    1) Right mouse click on project Maven -> Disable Maven Dependencies

    2) Right mouse click on project Maven -> Enable Maven Dependencies

    0 讨论(0)
  • 2020-12-28 19:34

    You seem to have both Eclipse IAM and M2Eclipse stuff in your .classpath. I would do some cleanup:

    • Use only one of these plugin (I suggest using M2Eclipse).
    • Delete your project from Eclipse's workspace, delete the .classpath and .project and Import the project as a Maven project again.

    Update: To get WTP support with M2Eclipse, you need to install the Maven Integration for WTP from the m2eclipse Extras update site: http://download.eclipse.org/m2e-wtp/releases/ as illustrated below:

    enter image description here

    0 讨论(0)
提交回复
热议问题