测试login.do报错

来源:6-9 用户模块所有功能自测试

Daniel1003

2018-12-15

访问/user/login.do报下面的错
ype Exception report

message Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getContainingClass()Ljava/lang/Class;

description The server encountered an internal error that prevented it from fulfilling this request.

exception
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getContainingClass()Ljava/lang/Class;
org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1284)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:965)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

root cause
java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getContainingClass()Ljava/lang/Class;
org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.supportsReturnType(RequestResponseBodyMethodProcessor.java:83)
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.getReturnValueHandler(HandlerMethodReturnValueHandlerComposite.java:83)
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:69)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:122)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.75 logs.

写回答

2回答

Daniel1003

提问者

2018-12-21

我用了老师的pom也不行,可能是环境的问题,准备换centos试一下

0
1
about_blank
我觉得和是不是centos 没关系... 你可以把老师的项目 下载 然后打个包 启动 你看报不报异常 我估计还是jar 冲突...
2018-12-21
共1条回复

about_blank

2018-12-17

1.

如果报了这个错,一般是引入了两个重复的spring Jar包,如既引入了spring.framework 又引入了spring.core,去掉一个就好



2.很可能是spring-context-2.5.jar和spring.jar冲突了,两个中留下一个,都试试

3.检查下 你的pom 和老师视频中的依赖 是完全一样的吗

0
2
about_blank
回复
Daniel1003
你把老师项目中的pom 帖进去 试下
2018-12-20
共2条回复

从0开始 独立完成企业级Java电商网站服务端开发

前后端分离,数据库接口设计,架构设计,功能开发,上线运维

9476 学习 · 8804 问题

查看课程