Maven+SSM框架下项目开发常见异常及解决方案(二)
2017-08-03 17:18
405 查看
1.
原因: mybatis的mapper文件中,XXXMapper.xml 文件中 增、改等方法参数类型存在错误。
解决方法: 参数类型为 parameterType 而非 parameterMap
2.
原因:在controller层中,autowired注解下的service层为该层的接口类而非实现类
解决方法:查找错误的自动装配类型,将实现类改为接口类
3.
原因: jsp 页面中尝试获取了请求作用域中对象未包含的属性
解决方法: 找到报错的对象的正确属性,并修改jsp中的错误属性
4.
原因: sql语言格式错误(注意如果基本格式没有错误的话,那就看看标点是不是用错了,尤其看最后一个字段值设置完毕后是不是多加了一个逗号)
解决方法: 修改错误的sql语句
5.提交表单信息时报错
原因: 提交的表单中的字段可能存在问题,eg:某个字段的数据库类型是int 但是提交的字段中却包含字母、特殊符号等
解决方法: 检查表单中所有字段类型是否对应model层实体类的属性类型
Servlet.service() for servlet [SpringMVC] in context with path [/biglovewj] threw exception [Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.biglovewj.dto.Daily] with root cause java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for com.biglovewj.dto.User
原因: mybatis的mapper文件中,XXXMapper.xml 文件中 增、改等方法参数类型存在错误。
解决方法: 参数类型为 parameterType 而非 parameterMap
2.
Servlet.service() for servlet [SpringMVC] in context with path [/biglovewj] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diningController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.biglovewj.service.impl.DiningService com.biglovewj.controller.DiningController.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.biglovewj.service.impl.DiningService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}] with root cause org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.biglovewj.service.impl.DiningService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
原因:在controller层中,autowired注解下的service层为该层的接口类而非实现类
解决方法:查找错误的自动装配类型,将实现类改为接口类
3.
Servlet.service() for servlet jsp threw exception javax.el.PropertyNotFoundException: Property 'col_linkName' not found on type com.biglovewj.dto.Collectivity
原因: jsp 页面中尝试获取了请求作用域中对象未包含的属性
解决方法: 找到报错的对象的正确属性,并修改jsp中的错误属性
4.
Servlet.service() for servlet [SpringMVC] in context with path [/biglovewj] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorE a4bf xception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'XXX'' at line
原因: sql语言格式错误(注意如果基本格式没有错误的话,那就看看标点是不是用错了,尤其看最后一个字段值设置完毕后是不是多加了一个逗号)
解决方法: 修改错误的sql语句
5.提交表单信息时报错
type Status report description The request sent by the client was syntactically incorrect.
原因: 提交的表单中的字段可能存在问题,eg:某个字段的数据库类型是int 但是提交的字段中却包含字母、特殊符号等
解决方法: 检查表单中所有字段类型是否对应model层实体类的属性类型
相关文章推荐
- Maven+SSM框架下项目开发常见异常及解决方案(三)
- Maven+SSM框架下项目开发常见异常及解决方案(一)
- 使用Maven基于ssm框架的完整商务管理开发项目(02)
- 使用Maven基于ssm框架的完整商务管理开发项目(01)
- 整合SSM框架的maven项目pom.xml的常见配置
- Maven版本的ssm框架项目常见依赖pom.xml
- 某教育平台项目开发之--使用SSM框架开发过程遇到的问题总结
- Maven构建SSM框架JavaWeb项目pom.xml文件整理
- 基于IdeaIDE的ssm整合框架的maven管理项目,利用映射自动生成dao层,pojo层,mappers层
- 基于IdeaIDE的ssm整合框架的maven管理项目,利用映射自动生成dao层,pojo层,mappers层
- struts2.1.8+hibernate2.5.6+spring3.0(ssh2三大框架)常见异常原因和解决方案
- maven开发ssm框架所遇到的问题:
- 【实战\Java SSM快速开发仿慕课网在线教育平台项目笔记】第1章 课程项目整体概述(整体介绍及Eclipse,Maven,新浪SAE软件平台介绍)
- eclipse maven项目整合SSM框架(亲测有效)
- MyEclipse使用Maven创建web项目+搭建SSM框架教
- SSM框架重构达内NETCTOSS项目——(4)处理异常
- ssm框架的maven项目实战
- eclipse构建maven项目整合SSM(spring+springMVC+mybatis)框架
- eclipse开发java的web项目时使用SSM框架的方法
- SSM 框架 Maven项目 项目整合 SpringMVC