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属性;