Spring+SpringMVC+MyBaties问题总结(二
来源:互联网 发布:sql over 用法 编辑:程序博客网 时间:2024/06/01 21:31
问题5、启动服务时报以下异常
nested exception is java.lang.NoSuchMethodError: o
rg.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(Lorg/springframework/beans/factory/xml/ParserContext;Lorg/w3c/dom/Element;)V
解决方法:引入的spring 相关jar包中存在多个版本问题,仔细排除即可。
问题6、启动tomcat服务时,数据源连接的url和指定的url莫名的不一致,报的异常是本机ip
解决方法:db配置文件的username或password后面有空格,删除空格;或者是因为配置文件的编码格式与项目编码格式不统一。
问题7、spring版本由4.0.4升级到4.1.1,项目启动时报异常:
java.lang.ClassNotFoundException: org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
解决方法:4.0.4升级到4.1.1后,spring-web.jar中没有了MappingJacksonHttpMessageConverter类
添加以下依赖包后,该问题解决,不知道为什么,有知道的大侠给解释下。
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.0</version>
</dependency>
问题8、解决了问题7后,访问首页出现以下异常
严重: Servlet.service() for servlet [jsp] in context with path [/FHM] threw exception [javax.servlet.ServletException: Servlet execution threw an exception] with root cause
java.lang.NoSuchFieldError: STANDARD_NUMBER_TYPES
at org.springframework.web.context.request.ServletRequestAttributes.<clinit>(ServletRequestAttributes.java:55)
at org.springframework.web.servlet.FrameworkServlet.buildRequestAttributes(FrameworkServlet.java:1026)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
...严重: Servlet.service() for servlet [jsp] in context with path [/---] threw exception [javax.servlet.ServletException: Servlet execution threw an exception] with root cause
java.lang.NoClassDefFoundError: Could not initialize class org.springframework.web.context.request.ServletRequestAttributes
at org.springframework.web.servlet.FrameworkServlet.buildRequestAttributes(FrameworkServlet.java:1026)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:719)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:465)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:390)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:317)
解决方法:maven库中的包与项目中WEB-INF/lib中存在版本不一致的包(删除lib下4.0.4相关的jar包后解决问题)。
问题9、点击登录按钮出现以下异常
严重: Servlet.service() for servlet [springMvc] in context with path [/FHM] threw exception [Handler processing failed; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonGenerator.setCurrentValue(Ljava/lang/Object;)V] with root cause
java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonGenerator.setCurrentValue(Ljava/lang/Object;)V
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:445)
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:29)
解决方法:依赖包json-core需要对应的升级到2.5.0ps:如问题8一样,如果WEB-INF/lib中存在不一致的版本jar,需要将其删除。
- Spring+SpringMVC+MyBaties问题总结(二
- Spring+SpringMVC+MyBaties问题总结(一)
- Spring+SpringMVC+MyBaties问题总结(三)
- spring+springMVC+mybaties 搭建
- Spring+springmvc+mybaties框架整合
- Spring+SpringMVC+MyBaties学习笔记(二)集成Spring SpringMVC MyBatis
- springMVC+spring+mybaties ||struts+spring+hibernate
- Mybaties入门 Mybatis与SpringMVC,spring整合
- 简单的 spring + springMVC + mybaties 框架搭建
- Spring+SpringMVC+MyBaties学习笔记(一)环境搭建
- Java-----SSM(SpringMVC+Spring+mybaties)框架整合
- springMVC+mybaties 报错
- spring和springMVC的面试问题总结
- Spring整合Mybaties
- spring整合mybaties
- cxf+mybaties+spring
- Java知识总结---整合SpringMVC+Mybatis+Spring(二)
- mybaties日常开发总结
- 欢迎使用CSDN-markdown编辑器
- MySQL的SET字段类型
- base64加密
- Android 各屏幕密度下推荐图标尺寸
- 安卓性能优化之Activity和Fragment通过onSaveInstanceState()保存和恢复数据
- Spring+SpringMVC+MyBaties问题总结(二
- #Codeforces 343 [div2] D. Babaei and Birthday Cake 【线段树优先队列查询优化】
- Android开发尽最大能力省图片内存占用方案
- mongodb 3.x for java
- android activity跳转传类出错
- ${sessionScope.user}的使用方法
- Http、TCP/IP协议与Socket
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- 关于C语言程序条件编译的简单使用方法