唯美古典
          Java入門,Struts,Hibernate,Spring,Groovy,Grails
          posts - 7,comments - 10,trackbacks - 0


          1、org.springframework.beans.NotWritablePropertyException(很畸形的bug

          出現異常的原因是在application-xxx.xmlproperty name的錯誤。
           ?。?/span>property name="...."name的名字是與beanset方法相關的,而且要注意大小寫。一般第二個字母不能大寫
            比如

          public class PostManageImpl extends BaseManage implements PostManage {
          private PostDAO dao = null;
          public void setPostDAO(PostDAO postDAO){
          this.dao = postDAO;
          }
          }


            那么xml的定義應該是:

          bean id="postManage" parent="txProxyTemplate"
          property name="target"
           <bean class="com.yz.spring.service.implement.PostManageImpl"
            <property name="postDAO"><ref bean="postDAO"/></property
           ?。?/span>property name="dao"><ref bean="postDAO"/></property
          ?。?/span>/bean
          /property
          /bean

          2、Struts中的DispatchAction中提交jsp中請求事件不能跳轉到指定頁面

          原因是在DispatchAction中存在execute方法,Action會優先執行此方法而不會按照url傳過來的method方法執行,所以千萬注意此處

          3、Field 'id' doesn't have a default value

          原因是數據庫中id屬性值沒有讓它“自動增長”

          4、could not initialize proxy - no Session

          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
          的默認選項是 lazy = "proxy"
          解決方法:
          <many-to-one> & <one-to-many>
          中設置 lazy="false"

          5、在使用Jbpm工作流引擎的時候,Hibernate配置文件一定要加上屬性

          <property name="hibernate.hbm2ddl.auto">update</property>

          Hbm2dll.auto是數據庫表和類自動連接更新

          6jbpmSpring整合報錯:

          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 唯美古典 閱讀(2117) 評論(2)  編輯  收藏 所屬分類: SSH整合

          FeedBack:
          # re: SSH整合常出現問題
          2009-12-03 15:19 | 張曉楓
          整合出現最BT的異常就是Jar包沖突   回復  更多評論
            
          # re: SSH整合常出現問題
          2009-12-03 15:29 | 唯美古典
          @張曉楓
          對,尤其是Spring和Hibernate的asm.2.3的jar包沖突  回復  更多評論
            

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 新津县| 曲阜市| 龙陵县| 普陀区| 温泉县| 威海市| 惠州市| 新绛县| 昌图县| 连城县| 黄梅县| 乌苏市| 勐海县| 叶城县| 潜山县| 茶陵县| 河源市| 亳州市| 大同县| 霍城县| 阳谷县| 日照市| 山东省| 沁水县| 常德市| 靖州| 龙泉市| 赞皇县| 南部县| 曲周县| 武陟县| 南充市| 循化| 靖江市| 河池市| 册亨县| 象州县| 蓬溪县| 商河县| 于都县| 涟水县|