struts2+Hibernate遇到的问题总结
来源:互联网 发布:mac更改输入法快捷键 编辑:程序博客网 时间:2024/05/14 13:35
本人用的是tomcat8.x+struts2.3+Hibernate4.3.6+Spring4.1.1
问题1:
错误提示,java.lang,nofoundclass....找不到类或者方法,但是又确实写了....
解决方案:重启tomcat服务器
问题2:
<package name="admin" namespace="/admin" extends="struts-default"><default-action-ref name="index"></default-action-ref><action name="index"><result>/admin/index.html</result></action><action name="*-*" class="com.wp.action.{1}Action" method="{2}"><result>/admin/{1}-{2}.jsp</result><result name="input">/admin/{1}-{2}.jsp</result></action></package>
用了通配符设置后,再用default-action-ref后无效,网上找了好久,参考了http://rguess.iteye.com/blog/1884807,有人说是个bug,个人认为也是这样.
必须改成这样
<span style="font-size:18px;"><package name="admin" namespace="/admin" extends="struts-default"><default-action-ref name="index"></default-action-ref><action name="index"><result>/admin/index.html</result></action><action name="Category-*" class="com.wp.action.CategoryAction" method="{1}"><result>/admin/Category-{1}.jsp</result><result name="input">/admin/Category-{1}.jsp</result></action></package></span>
问题3:
官网上写的是获取sessionfactory是这样Configuration cfg=new Configuration().configure();SessionFactory sf = cfg.buildSessionFactory(new StandardServiceRegistryBuilder().build());但是我用的时候,总是报Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set这个错.Google后改成了这样:
Configuration configuration = new Configuration(); configuration.configure(); ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings( configuration.getProperties()).build(); SessionFactory sf = configuration.buildSessionFactory(serviceRegistry);
就没错了....具体原因不详..如果有哪位大大知道为什么,希望不吝赐教...
问题4:
Spring3.2.4当使用aop的注解时候 出现这个错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodIntercepto
看到
java.lang.NoClassDefFoundError
应该首先想到的就是少包,网上查了半天,原来是缺少aopalliance.jar包,下载地址 http://sourceforge.net/projects/aopalliance/files/ 参考博文:http://coolhorse168.iteye.com/blog/789511 在此感谢
问题5:
Spring3.2.4使用aop注解需要加入的包有aspectjwaver.jar aspectjrt.jar aopalliance.jar三个
问题6:
Spring3.x与Hibernate4.x整合时会出现
ERROR: HHH000302: Unable to construct current session context [org.springframework.orm.hibernate4.SpringSessionContext] 这种问题,换成Spring4.1.1 就可以了
问题7:
struts2遇到了一个奇葩问题,Eclipse配置Struts2问题:ClassNotFoundException: org...dispatcher.ng.filter.StrutsPrepareAndExecuteFilter,最后上Google百度一下得到了这位大大的一篇博客,原文地址,http://blog.csdn.net/njnu_mjn/article/details/6684661在此感谢!!!
随着本人学习进度,持续更新
0 0
- struts2+Hibernate遇到的问题总结
- struts2与hibernate整合遇到的问题
- struts2+spring+hibernate使用中遇到的问题(转载)
- struts2+hibernate用实体类做外键时遇到的一个问题
- 配置Spring+struts2+hibernate时遇到的问题
- struts2+hibernate+spring整合过程中遇到的问题
- struts2遇到的问题
- Struts2遇到的问题
- Hibernate遇到的问题
- hibernate 遇到的问题
- Hibernate遇到的问题
- 遇到的hibernate 问题
- Hibernate 中遇到的一些问题(总结)
- 下午sping+hibernate配置遇到的小问题总结下
- 升级spring和hibernate到4遇到的问题总结
- hibernate自动生成表遇到的问题总结。
- 开发遇到问题之总结---接触到的hibernate
- 第一个hibernate程序以及遇到的问题总结
- 单向链表
- 一个匹配数字和字母密码的正则表达式
- java中JNI的使用之JNIEnv类型中方法的使用
- 把二叉树打印成多行
- MySQL基本知识点
- struts2+Hibernate遇到的问题总结
- loop设备及losetup命令介绍
- Unicode文件头的标识
- ASIHTTPRequest系列(二):文件下载
- 浏览器User-agent的解析
- 推断基本规则
- source insight 代码对齐设置
- 美日汇信赖商城让你轻松愉快购物
- 哎。。。感冒了。。