struts2.1.8+spring2.5.6+hibernate3.2框架搭建错误

来源:互联网 发布:网络购物合同纠纷管辖 编辑:程序博客网 时间:2024/05/20 17:59

1.java.lang.RuntimeException: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
    at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
。。。。。。。

出现此错误的原因:你添加了struts2-codebehind-plugin包,去掉就OK了

2.严重: Actual exception
Could not load class org.apache.struts2.jsf.FacesSetupInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/D:/ghl/apache-tomcat-6.0.20/wtpwebapps/SS/WEB-INF/lib/struts2-jsf-plugin-2.1.8.1.jar!/struts-plugin.xml:35:97
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:202)

解决:
删除:struts2-jsf-plugin-2.1.8.1.jar
3.严重: Actual exception
Could not load class org.apache.struts2.portlet.interceptor.PortletAwareInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/D:/ghl/apache-tomcat-6.0.20/wtpwebapps/SS/WEB-INF/lib/struts2-portlet-plugin-2.1.8.1.jar!/struts-plugin.xml:48:114
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:202)

解决
删除:struts2-portlet-plugin-2.1.8.1.jar

4.asm包的冲突,去掉asm2.2.3(如果去掉asm的话,还会显示出错)。

5.osgi包,这一点我不太懂,搭建框架时,他们会一直报错,后来将其全部删除(3个),ok。
4.在使用form表单时,如果用action=*.action;会报404,去掉".action",ok!这一点恰好与2.0相反。
6.一个常见的hibernate错误:
org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session

出错原因:我在关联的双方都设置了cascade,所以出现了这个错误,汗。。。。
去掉<many-to-one>属性中的cascade属性,ok!