ssh学习笔记(1)
来源:互联网 发布:吱道二手车淘宝店 编辑:程序博客网 时间:2024/05/16 10:53
学习struts2、hibernate、spring也有一段时间了。 这两天集成三个框架,做了个小小的实例。练习过程中出现的异常真的是层出不穷、五花八门搞得我头都大了,其中这几个错误让我记忆犹深。
第一个:<br /> Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMe解决办法是:
1.去掉类路径上的关于Hibernate的3个lib
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
2.加入Spring中的以下4个lib
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
cglib-nodep-2.1_3.jar
原因是:spring中的asm jar包和hibernate里的asm jar包冲突,得删除当中一个。
第二个:<br />Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 55<br />execution(*com.compss.sevice.impl.ProductManagerImpl.*(..))<br />可能出现的问题是:*com.compss.sevice.impl.ProductManagerImpl * 后面要留一个空格。
第三个:
Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.springframework.transaction.config.TxNamespaceHandler] for namespace [http://www.springframework.org/schema/tx]: problem with handler class file or dependent class; nested exception is java.lang.AbstractMethodError: org.springframework.transaction.config.TxNamespaceHandler.init()V
可能原因是: struts2.x 版本的问题,我开始时用的struts2.1.6出现这个错误始终没有解决,而换成struts2.0.14后就没有出现这个问题了。
第四个:
java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity
这个问题也让看半天没看明白,网上的答案也是五花八门。
但最后还是从网上找到了这个答案。
一般是因为jsp页面传的对象属性不对 如:
<s:textfield name="author.username" label="name"></s:textfield>
但action中是 Author a; 故应修改为:
<s:textfield name="a.username" label="name"></s:textfield>
- ssh学习笔记(1)
- SSH学习笔记1
- ssh框架学习笔记(1)
- SSH框架学习笔记(1)
- SSH学习问题笔记1
- (转)ssh学习笔记
- ssh学习笔记(2)
- SSH学习笔记(一)
- SSH学习笔记(一)
- Spring学习笔记(四)----SSH整合
- SSH框架学习笔记(一)
- ssh注解学习笔记(一)
- SSH学习笔记【一】
- ssh学习笔记
- SSH学习笔记
- SSH视频学习笔记
- SSH学习笔记(一)
- SSH学习笔记(二)
- sql优化---oracle hint样例
- Dnn相关站点
- oracle中数字串判断函数探究
- AJAX
- cy7c68013a的方波程序
- ssh学习笔记(1)
- js获得浏览器高度和宽度 参数
- Cross-browser NPAPI extensions for plugin scriptability
- Microsoft Expression 3 新功能简介
- 我也来CSDN
- (三)数组中存储对象
- 沈阳-工业城市的信息化建设
- DOM的四个基本接口
- JAVA获取系统时间