2011-04-06 69 views
0

我是新來的春天和iBatis.I試圖整合兩者,我已經放置了所有需要的罐子。但仍然是拋出以下異常。 我覺得我可以找到一個相應的jar。但是我無法想象它。任何人都可以幫助我解決這個問題。

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver$1 
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:839) 
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) 
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) 
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 


root cause 

java.lang.NoClassDefFoundError: org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver$1 
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.findBestExceptionHandlerMethod(AnnotationMethodHandlerExceptionResolver.java:176) 
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.doResolveException(AnnotationMethodHandlerExceptionResolver.java:131) 
    org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:136) 
    org.springframework.web.servlet.DispatcherServlet.processHandlerException(DispatcherServlet.java:987) 
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:811) 
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) 
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) 
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 


root cause 

java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver$1 
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) 
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) 
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.findBestExceptionHandlerMethod(AnnotationMethodHandlerExceptionResolver.java:176) 
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver.doResolveException(AnnotationMethodHandlerExceptionResolver.java:131) 
    org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:136) 
    org.springframework.web.servlet.DispatcherServlet.processHandlerException(DispatcherServlet.java:987) 
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:811) 
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) 
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) 
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 

在此先感謝。 Janardhan。

回答

2

我假設你正在使用彈簧3.0(因爲此類不舊版本存在),因此缺少類是spring-webmvc-3.x.x.jar,如:

http://repo1.maven.org/maven2/org/springframework/spring-webmvc/3.0.5.RELEASE/

+0

我放在彈簧webmvc-3.0 .RELEASE-sources jar.But仍然是同樣的問題。 – Janardhan 2011-04-06 07:36:59

+0

然後我在類路徑中添加了同樣的類......但徒勞的 – Janardhan 2011-04-06 07:38:12

+0

對不起,但您認爲在* -sources.jar中有什麼意思?它包含的不是類的來源。而且你需要採用與其他彈簧瓶完全相同的spring-webmvc版本,所以如果你真的使用spring 3.0.5,那麼就採用「spring-webmvc-3.0.5.jar(不帶」sources「) 。 – HefferWolf 2011-04-06 13:47:12