异常总结
2015-08-13 13:24
399 查看
Association references unmapped class异常:
1.某一个类没有映射文件(*.hbm.xml)
2.该映射文件没有注册到hibernate.cfg.xml中。
3.映射文件的文件名不对
4.映射的类路径有错误
QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in:
没有获取导数据源
java.sql.SQLException: Callable statments not supported.:驱动包有问题
Expected MultipartHttpServletRequest: is a MultipartResolver configured?] with root cause:spring上传文件没有配置muiltpart解析器:解决之道
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
Error occured processing XML 'org/springframework/transaction/interceptor/TransactionInterceptor'. See Error Log for more details:
加入jar包:com.springsource.org.aopalliance-1.0.0.jar
java.lang.NoClassDefFoundError: javax/persistence/EntityListeners:
加入jar包:ejb3-persistence.jar
org/aopalliance/intercept/MethodInterceptor:
加入jar包:com.springsource.org.aopalliance-1.0.0.jar
struts2如果浏览器访问不到action:
加入jar包:struts2-core-2.3.24.jar
Unable to load configuration. - Class: java.net.AbstractPlainSocketImpl:
解决:
第一种: 将struts.xml声明部分替换成 struts2-core-2.xxx.jar包中struts-default.xml声明部分即可.
第二种: 连上网就不会出现这个错误.
java.lang.NoClassDefFoundError: ognl/PropertyAccessor:
解决:加入ognl表达式的jar包
struts2.3和Hibernate 4.3同时使用的时候会出现一个错误“$$_javassist_0 cannot be cast to javassist.util.proxy.Proxy”
解决方案:只保留Hibernate的javassist的jar包就行
ognl.MethodFailedException: Method "list" failed for object com.tanghaibin.view.DepartmentAction@76daf0b [java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I]
解决之道:antlr_2.72jar冲突,检查是否存在多个此版本不同的jar包
attempt to create delete event with null entity:
原因:删除为空的对象会抛出此异常
解决之道:在删除前判断该对象是否为空
An association from the table t_role_privilege refers to an unmapped class
解决之道:
1,检查你的hibernate.cfg.xml文件中是否添加了 <mapping resource="xxxx.hbm.xml"/>
2,检查你的hibernate.cfg.xml文件中的相关联的两个<mapping resource=""/>的顺序,可能有其中一个需要引用另一个,但是另一个却还没有编译,就是说被用作外 键的表要放在前面
3,检查你的*.hbm.xml文件名是否正确
4, 检查你的*.hbm.xml里面类全名
struts2:
当提交表单提交给action的时候,如果有input标签,则必须有value标签,否则会报:
No result defined for action com.tanghaibin.view.RoleAction and result input - action
1.某一个类没有映射文件(*.hbm.xml)
2.该映射文件没有注册到hibernate.cfg.xml中。
3.映射文件的文件名不对
4.映射的类路径有错误
QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in:
没有获取导数据源
java.sql.SQLException: Callable statments not supported.:驱动包有问题
Expected MultipartHttpServletRequest: is a MultipartResolver configured?] with root cause:spring上传文件没有配置muiltpart解析器:解决之道
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
Error occured processing XML 'org/springframework/transaction/interceptor/TransactionInterceptor'. See Error Log for more details:
加入jar包:com.springsource.org.aopalliance-1.0.0.jar
java.lang.NoClassDefFoundError: javax/persistence/EntityListeners:
加入jar包:ejb3-persistence.jar
org/aopalliance/intercept/MethodInterceptor:
加入jar包:com.springsource.org.aopalliance-1.0.0.jar
struts2如果浏览器访问不到action:
加入jar包:struts2-core-2.3.24.jar
Unable to load configuration. - Class: java.net.AbstractPlainSocketImpl:
解决:
第一种: 将struts.xml声明部分替换成 struts2-core-2.xxx.jar包中struts-default.xml声明部分即可.
第二种: 连上网就不会出现这个错误.
java.lang.NoClassDefFoundError: ognl/PropertyAccessor:
解决:加入ognl表达式的jar包
struts2.3和Hibernate 4.3同时使用的时候会出现一个错误“$$_javassist_0 cannot be cast to javassist.util.proxy.Proxy”
解决方案:只保留Hibernate的javassist的jar包就行
ognl.MethodFailedException: Method "list" failed for object com.tanghaibin.view.DepartmentAction@76daf0b [java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I]
解决之道:antlr_2.72jar冲突,检查是否存在多个此版本不同的jar包
attempt to create delete event with null entity:
原因:删除为空的对象会抛出此异常
解决之道:在删除前判断该对象是否为空
An association from the table t_role_privilege refers to an unmapped class
解决之道:
1,检查你的hibernate.cfg.xml文件中是否添加了 <mapping resource="xxxx.hbm.xml"/>
2,检查你的hibernate.cfg.xml文件中的相关联的两个<mapping resource=""/>的顺序,可能有其中一个需要引用另一个,但是另一个却还没有编译,就是说被用作外 键的表要放在前面
3,检查你的*.hbm.xml文件名是否正确
4, 检查你的*.hbm.xml里面类全名
struts2:
当提交表单提交给action的时候,如果有input标签,则必须有value标签,否则会报:
No result defined for action com.tanghaibin.view.RoleAction and result input - action
相关文章推荐
- Spring Data JPA - “No Property Found for Type” Exception
- AVL树的构造实现
- Unity 场景异步加载
- [LeetCode155] Min Stack
- jQuery简要dom操作
- T-SQL CROSS APPLY、MERGE
- Mac 下Versions的 svn无法上传 .a 文件的问题
- 手机短信验证接口推荐
- spark向量、矩阵类型
- XShell安装和配置(系统为虚拟机中的centos7)
- CentOS7.1配置源
- iOS利用Runtime自定义控制器POP手势动画(经典)
- 字节序与字节对齐
- [LeetCode156] Binary Tree Upside Down
- maven jetty
- Android如何快速打出100个渠道apk
- [经典算法题]寻找数组中第K大的数的方法总结
- 数据恢复陶工西数500GWD5000AAKX-08U6AA0摔敲盘不认紫色线圈磁头开盘恢复数据
- 缓存清理
- DOS命令之net use命令详细解释