1、org.springframework.beans.NotWritablePropertyException(很畸形的bug)
出現(xiàn)異常的原因是在application-xxx.xml中property name的錯誤。
<property name="....">中name的名字是與bean的set方法相關(guān)的,而且要注意大小寫。一般第二個字母不能大寫
比如
public class PostManageImpl
extends BaseManage implements PostManage {
private PostDAO dao = null;
public void setPostDAO(PostDAO
postDAO){
this.dao = postDAO;
}
}
|
那么xml的定義應(yīng)該是:
<bean id="postManage"
parent="txProxyTemplate">
<property
name="target">
<bean
class="com.yz.spring.service.implement.PostManageImpl">
<property
name="postDAO"><ref bean="postDAO"/></property>對
<property name="dao"><ref bean="postDAO"/></property>錯
</bean>
</property>
</bean>
|
2、Struts中的DispatchAction中提交jsp中請求事件不能跳轉(zhuǎn)到指定頁面
原因是在DispatchAction中存在execute方法,Action會優(yōu)先執(zhí)行此方法而不會按照url傳過來的method方法執(zhí)行,所以千萬注意此處
3、Field 'id' doesn't have a default value
原因是數(shù)據(jù)庫中id屬性值沒有讓它“自動增長”
Hibernate3 錯誤: could not
initialize proxy - no Session
org.hibernate.LazyInitializationException: could not initialize proxy - no
Session
at
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
at
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
原因:
hibernate3 many-to-one的默認(rèn)選項(xiàng)是 lazy = "proxy"
解決方法:
<many-to-one> & <one-to-many> 中設(shè)置
lazy="false"
5、在使用Jbpm工作流引擎的時候,Hibernate配置文件一定要加上屬性
<property
name="hibernate.hbm2ddl.auto">update</property>
Hbm2dll.auto是數(shù)據(jù)庫表和類自動連接更新
6、jbpm與Spring整合報錯:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpmConfiguration'
defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]:
Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: a beanFactoryReference already exists for key jbpmConfiguration
解決方法:去掉struts-config.xml文件中的org.springframework.web.struts.ContextLoaderPlugIn,也就是與Spring整合的插件
posted on 2009-12-01 20:11
唯美古典 閱讀(2108)
評論(2) 編輯 收藏 所屬分類:
SSH整合