ssh整合中遇到的问题及解决记录

1.

P:BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

S:问题在hibernate.cfg.xml中,需要删除<property name="current_session_context_class">thread</property>

2.

P:Caused by: java.lang.IllegalArgumentException        at org.springframework.asm.ClassReader.<init>(Unknown Source)

S:stackoverflow里面大神所讲的,是jdk不兼容

3.

P:Exception occurred during processing request: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

S:开启OpenSessionInViewFilter来阻止延迟加载的错误的时候抛出了这个异常:org.springframework.dao.InvalidDataAccessApiUsageException错误
但是在我们开启OpenSessionInViewFilter这个过滤器的时候FlushMode就已经被默认设置为了MANUAL!

给filter注入参数

 <init-param>     
   <param-name>flushMode</param-name>     
   <param-value>AUTO</param-value>     
</init-param>  

4.

P:java.lang.IllegalArgumentException: id to load is required for loading

S:如果访问*.jsp文件时,因为进行添加时,首先会先查找关联关系中的测试项目的Id ,获取到之后再进行添加的操作,如果获取不到测试项目的id,那么将会抛出一个异常,要保存的类相关联的类的id无法找到,因此需要重新从数据库中查询

5.

P:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

s:多出现在增加和修改对象的情境中,两个方法公用一个saveOrUpdate(entity)

在添加对象的jsp中应该处理好隐藏域的问题例如:<s:if test="courseTypeId!=null">
    <s:hidden name="courseTypeId"></s:hidden>
 </s:if>

6.

P:There is no Action mapped for action name courseTypeAction_getAll. - [unknown location]

S:无法生成通过spring生成action,所做的尝试有:修改struts.xml和applicationContext.xml,以及请求的相关参数,也有可能是jsp标签无法正常显示,添加的s:debug不合适;还有hibernate orm 映射文件。注意set标签添加table属性;







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

NewTech精选

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值