Spring常見問題

1.NoClassDefFoundError: org/springframework/context/event/EventListenerFactory
spring的jar包不一致或者確實包。

2.java.lang.IncompatibleClassChangeError :
class org.springframework.core.type.classreading.ClassMetadataReadingVisitor
has interface org.springframework.asm.ClassVisitor as super class
spring.core包和spring.asm包衝突 ,去掉一個。

3.No mapping found for HTTP request with URI… in DispatcherServlet with name
spring-servlet.xml添加 <mvc:default-servlet-handler/>

4.”mvc:annotation-driven” 的前綴 “mvc”未綁定
沒有引入了命名空間。在xml的beans裏面加入如下代碼即可

xmlns:mvc="http://www.springframework.org/schema/mvc"  

http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd 

5.java.lang.NoClassDefFoundError: org/springframework/context/ConfigurableApplicationContext 或
Error configuring application listener of class org.springframework.web.context

如果Eclipse的BuildPath裏面不缺jar包並且在 ProjectProperties>>DeploymentAssembly裏面定義的lib都包含齊全,那麼有可能jar包沒有被deploy到tomcat裏面路徑可能是:\WorkSpace.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\ProjectNameXXX\WEB-INF\lib。手動將jar包扔進去可解決tomcat報”NoClassDefFoundError”錯誤。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章