Tomcat & Spring Web - Class Not Found Exception org.springframework.web.context.ContextLoaderListener

前端 未结 3 2083

I get the following exception when I try to start Tomcat through Eclipse (via right click on Project, Run As -> Run on Server).

SEVERE: Error configuring app         


        
3条回答
  •  独厮守ぢ
    2020-12-04 15:17

    The easiest way to tell what Eclipse will put in your war file for server deployments is to do a right click -> Export -> WAR file. You can then uncompress this and see what's inside.

    If you open up ".settings/org.eclipse.wst.common.component" you should see the definition of the web tools webapp, and see something like:

    
    
        
        
        
        
        
    
    
    

    On your build path in Eclipse, make sure "Maven Dependencies" appears in Libraries. The last versions of the m2eclipse plugin and WST should automatically pick up the Maven dependencies and drop them in WEB-INF/lib inside your war file.

    Last but not least, you may want to consider picking up the latest copy of SpringSource Tool Suite (STS). STS has a number of good features, including bundling the latest m2eclipse and WST. You can still use it with Tomcat (or their version of Tomcat), and it has some archetypes and tutorials in there to get a webapp working quickly.

    Enjoy!

提交回复
热议问题