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