How to resolve Error listenerStart when deploying web-app in Tomcat 5.5?

前端 未结 4 1400
悲&欢浪女
悲&欢浪女 2020-12-04 18:04

I\'ve deployed an Apache Wicket web-application that uses Spring and Hibernate to my Tomcat 5.5 instance. When I navigate to the Tomcat Manager interface I see that the web-

4条回答
  •  一个人的身影
    2020-12-04 18:45

    /var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/jsp-api-6.0.16.jar
    /var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/servlet-api-6.0.16.jar
    

    You should not have any server-specific libraries in the /WEB-INF/lib. Leave them in the appserver's own library. It would only lead to collisions in the classpath. Get rid of all appserver-specific libraries in /WEB-INF/lib (and also in JRE/lib and JRE/lib/ext if you have placed any of them there).

    A common cause that the appserver-specific libraries are included in the webapp's library is that starters think that it is the right way to fix compilation errors of among others the javax.servlet classes not being resolveable. Putting them in webapp's library is the wrong solution. You should reference them in the classpath during compilation, i.e. javac -cp /path/to/server/lib/servlet.jar and so on, or if you're using an IDE, you should integrate the server in the IDE and associate the web project with the server. The IDE will then automatically take server-specific libraries in the classpath (buildpath) of the webapp project.

提交回复
热议问题