1.錯誤:object references an unsaved transient instance - save the transient instance before flushing:
com.xxxx.bean.java.Sysblog; nested exception is org.hibernate.TransientObjectException: object references an unsaved
transient instance - save the transient instance before flushing: com.xxx.bean.java.Sysblog
解決方法:沒有可預期的實例,固然就要實例化對象咯
2.錯誤:Exceptionobject references an unsaved transient instance - save the transient instance before flushing:
src.persistent.Product......
解決方法:緣由沒有爲某對象進行set設置, 如上邊的這個就是某對象沒有調用setProduct
3.錯誤:Illegal attempt to associate a collection with two open sessions......
解決方法:(hibernate的session提供了一級緩存,每一個session,對同一個id進行兩次load,不會發送兩條sql給數據庫,可是session關閉的
時候,一級緩存就失效了。
sysblogarticle.setAmount(new Long(sysblogcommentService.selcom(
sysblogarticle.getArticleid().toString()).size()));//經過文章id獲取文章評論數
sysblogarticle.setSysblogcomments(null);//關鍵
sysblogarticleService.saveOrUpdate(sysblogarticle);//將文章中評論條數修改
參考:http://javaflasher.iteye.com/blog/forum/17913
4.錯誤:Hbm映射文件都生成好後,改數據庫增長了默認值(如:將某個字段值設爲1),結果在插入的時候,數據庫那邊沒有反應。
解決方法: 在sql-type裏面定義數據庫默認值,那麼SchemeExport的時候,DDL就會加上default。而後hbm定義爲dynamic-insert="true"和
dynamic-update="true"
<hibernate-mapping>
<class name="com.tom.hibernate.EbayItem" table="EBAY_ITEM" schema="API_USER" dynamic-insert="true" dynamic-update="true">
.......
........
<property name="viewData" not-null="true" type="boolean">
<column name="viewdata" sql-type="number(1) default 0"/>
</property>
</class>
</hibernate-mapping>
5.錯誤:
2008-2-2 9:45:13 org.hibernate.util.JDBCExceptionReporter logExceptions
嚴重: Unknown column 'tjsaleresu0_.isupdate' in 'field list'
2008-2-2 9:45:13 org.hibernate.event.def.DefaultLoadEventListener onLoad
信息: Error performing load command
org.hibernate.exception.SQLGrammarException: could not load an entity: [ookj.domain.TjSaleResult#293]
--數據庫中沒有「isupdate」字段
6.錯誤:
2008-2-2 9:51:42 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 1052, SQLState: 23000
2008-2-2 9:51:42 org.hibernate.util.JDBCExceptionReporter logExceptions
嚴重: Column 'df' in where clause is ambiguous
————find("select tsr from TjSaleResult tsr, TjItemResult tir where tsr=tir.saleResultId and tir=? and df<>1", new Object
[]{tir});
————語句中的df不能肯定是哪一個表的
7.錯誤
org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: trackDate of:
ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=?
and trt.df<>1]; nested exception is org.hibernate.QueryException: could not resolve property: trackDate of:
ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=?
and trt.df<>1]
Caused by: org.hibernate.QueryException: could not resolve property: trackDate of: ookj.domain.TjReagentTrack [from
ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=? and trt.df<>1]
————問題是配置中:
private static String[][] properties={
{"getReagentTrackId","reagent_trackid","0"},
{"getReagentId","reagentid","1"},
{"getUserId","userid","1"},
{"getGuideBookId","guidebookid","1"},
{"getTrackTime","tracktime","0"}, //這裏名稱不對
{"trackStage","trackstage","0"},
{"getDf","df","0"}
————還有nd trt.trackDate=? 語句中的值有誤。
8.錯誤
java.lang.ClassCastException: ookj.domain.OokjDateTime
————基本的 類型轉換錯誤
9.錯誤
org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the
transient instance before flushing: ookj.domain.SmDept; nested exception is org.hibernate.TransientObjectException: object
references an unsaved transient instance - save the transient instance before flushing: ookj.domain.SmDept
Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient
instance before flushing: ookj.domain.SmDept
————new了一個新對象,在未保存以前將它保存進了一個新new的對象。
10.錯誤
信息: could not read column value from result set: activep19_59_; could not deserialize
Exception in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: could not deserialize; nested
exception is org.hibernate.type.SerializationException: could not deserialize
Caused by: org.hibernate.type.SerializationException: could not deserialize
我用的數據庫是mysql,在經過pojo類自動生成的類中,未爲字段指定type,hibernate對自動爲其指定,若是它所生成的type不能被反序列化
,就會拋出java.util.ServilizableException
好比我產生異常的緣由是我創建了一個string[]類型的字段,但在對應的.hbm.xml文件中我沒有顯式定義它的類型,hibernate自動爲其指定了
類型,該類型不能被反序列化。
11.錯誤
嚴重: line 1:143: expecting IDENT, found '.'
2008-2-3 0:41:01 org.apache.catalina.core.StandardWrapperValve invoke
嚴重: Servlet.service() for servlet tijianServlet threw exception
org.springframework.orm.hibernate3.HibernateQueryException: expecting IDENT, found '.' near line 1, column 143 [select
t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and
t.saleItemId..medicalGroup.df<>1]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '.'
near line 1, column 143 [select t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and
t.saleItemId.medicalGroup.block=? and t.saleItemId..medicalGroup.df<>1]
Caused by: org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '.' near line 1, column 143 [select
t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and
t.saleItemId..medicalGroup.df<>1]
_____多了一個點
12.錯誤
java.net.SocketException: java.net.ConnectException: Connection refused: connect
————數據庫未啓動
13.錯誤
嚴重: Servlet.service() for servlet tijianServlet threw exception
java.lang.NoSuchMethodError: ookj.service.SendReagentService.saveTjSendReagent
(Lookj/domain/TjReagent;Lookj/domain/SaleGuideBook;)[Ljava/lang/String;
————Tomcat\Java虛擬集中代碼未跟上,不能保持同步,重啓虛擬機就行了。
偶嘀錯誤集合 [轉貼 2007-03-04 15:19:00]
1. 作Hibernate多對一的時候遇到錯誤
(1)org.apache.jasper.JasperException: Error creating bean with name 'sf' defined in ServletContext resource [/WEB-
INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.PropertyNotFoundException:
Could not find a getter for person in class com.accp.vo.Course
由於配置文件中的一個 <many-to-one name="person" ../> 中的person屬性名稱寫錯了.
還有緣由以下:
1)getter()方法寫錯了,沒有按照javaBean的規則寫.
2)*.hmb.xml中的屬性名和pojo中的是否一致.注意:屬性名是否多了空格.
(2).Hibernate多對一報錯:
save the transient instance before flushing
具體錯誤爲在one-to-many中,對many進行save時,因爲沒有加入one的外建,致使錯誤。
具體解決方法:
(1)、在one的hbm文件中 invest=true
(2)、在many保存前務必要求one的存在
2.spring+struts+hibernate 項目debug總結
(1) javax.servlet.ServletException: Cannot retrieve mapping for action /companyNews
struts-config.xml中沒有寫相關companyNews的action.
(2) 在myeclipse增長一個jar包時候,先打開項目properties,選擇java build path --> libraries -->add external JARs 選擇到須要的
jar包,加入後,發現,他這個包加載的是絕對路徑,而咱們的項目須要cvs共享,沒法commit到cvs服務器。myeclipse有如下提示信息:
2 build path entries are missing.
解決辦法是,關閉myeclipse,用notepad打開項目目錄下的 .classpath, 手動修改爲相對路徑,而且檢 查,指定的相對路徑中是否真正添
加了jar包,啓動myeclipse就能夠上傳新添加的jar包了。
(3) 在使用junit/StrutsTest時候,報錯:
java.lang.UnsupportedClassVersionError: junit/framework/TestListener (Unsupported major.minor version 49.0)
緣由是若是是jdk1.4的話,只能使用junit3.8如下版本,若是是使用jdk1.5的話,必須使用junit4.0 以上版本。
(4) Cannot find ActionMappings or ActionformBeans collection
緣由是:web.xml文件中沒有配置struts-config.xml的相關信息。
(5) org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml
or the jar files deployed with this application
缺乏jstl的相關jar和web.xml配置
jstl.jar
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
<taglib-location>/WEB-INF/fmt-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
<taglib-location>/WEB-INF/c-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
<taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
<taglib-location>/WEB-INF/x-rt.tld</taglib-location>
</taglib>
(5) Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
standard.jar沒有放在lib裏面
(6) 建立oracle表的時候,使用了,role和comment關鍵字,建議不要將這兩個關鍵字做爲表名和字段名。
建議用toad或plsql developer建立表,這樣軟件會提示關鍵字。
(7) [ERROR] XMLHelper - Error parsing XML: XML InputStream(18) Attribute name "column" associated with an element type "key"
must be followed by the ' = ' character.
[ERROR] Configuration - Could not configure datastore from input stream <org.dom4j.DocumentException: Error on line 18 of
document : Attribute name "column" associated with an element type "key"
must be followed by the ' = ' character. Nested exception: Attribute name "column" associated with an element type "key" must
be followed by the ' = ' character.>org.dom4j.DocumentException: Error
on line 18 of document : Attribute name "column" associated with an element type "key" must be followed by the ' = '
character. Nested exception: Attribute name "column" associated with an element
type "key" must be followed by the ' = ' character.
xml 語法錯誤,key語法中應該相似這樣的寫法 <key column="id">
(8) hibernate3,對象中一對多的one方,必須寫private Set pays=new HashSet();,不然包錯java.lang.NullPointerException ,
而hibernate2中private Set pays;卻不報錯;
(9) [DEBUG] AbstractSaveEventListener - generated identifier: 1, using strategy: org.hibernate.id.IncrementGenerator
org.hibernate.PropertyValueException: not-null property references a null or transient value: com.xxx.yyy.company
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
<many to one >中的設置應該設置爲not-null="false" ,設置爲not-null="true"則報以上錯誤
(10) org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance
before flushing: com.xxx.yyy.Company
在save的同時也須要save其餘的表,而後再flush()
(11) Parse Fatal Error at line 12 column 1
struts-config.xml文件被修改,語法錯誤。檢查語法。
(12)org.hibernate.QueryException: could not resolve property: userid of:
com.xxx.yyy.Pay
使用到外鍵userid的時候,必須使用userinfo.userid方法才能獲得。
(13)javax.naming.NameNotFoundException: Name hibernate_connection_factory is not
bound in this Context 緣由:hibernate的數據庫映射.xml文件有配置錯誤,致使hibernate_connection_factory沒法綁定數據庫。
例如many-to-one設置了之後,仍然在其中設置相沖突的<property>屬性。
(14) [WARN] RequestProcessor - Unhandled Exception thrown: class java.lang.NullPointerException
必須將使用到的對象new起來。
(15) GROUP BY 表達式的查詢必須知足以下:
select 子句後的每一項必需出如今group by 子句中,除非該項使用了彙集函數。(16) org.hibernate.TransientObjectException: object references an unsaved transientinstance - save the transient instance before flushing: com.xxx.yyy.Company要級聯保存,屢次session.save()(17)java.lang.IllegalArgumentException: id to load is required for loading緣由:session.load(Company.class,payForm.getCompanyId());load()方法第二個參數必須是searlizable,而且必須是和數據庫映射類的屬性值類型一致,即便強制轉換都不行。(18) [INFO] DefaultLoadEventListener - Error performing load command <org.hibernate.ObjectNotFoundException: No row with thegiven identifier exists: [com.xxx.yyy.Company#0]>org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xxx.yyy.Company#0]表示你如今查詢的對象所關聯的對象有問題,通常是由於數據的問題(該對象所關聯的對象找不到),數據的錯誤,影響了程序正常執行。(19)eclipse 3.1,myeclipse 4錯誤Deployment is out of date due to changes in the underlying project contents . You'll need to mannally 'Redeploy' the projectto update the deployed archive.緣由tomcat 中部署的某個文件的拒絕訪問影響了部署。重啓後,去除tomcat中部署的文件。從新在eclipse中設置部署。爲何須要重啓?由於:google desktop軟件正在對我部署的一個300MB大文件進行索引,鎖定了這個大文件,我估計google desktop須要對這個文件索引半個小時以上。所以,eclipse沒法對過去部署的文件,作先刪除後從新部署的工做。(20) ERROR LazyInitializationException:19 - could not initialize proxy - the owning Session was closedorg.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed解決辦法。cmpy=(CompanyEdit)ss.load(CompanyEdit.class,companyId1);Hibernate.initialize(cmpy);//強制初始化cmpy,不然ss.close()後,cmpy將消失.(21) javascript錯誤行: 56字符: 45錯誤: 未結束的字符串常量代碼: 0是編碼的問題!用ANSI編碼另存後就行了。(22) [WARN] JDBCExceptionReporter - SQL Error: 904, SQLState: 42000[ERROR] JDBCExceptionReporter - ORA-00904: 無效列名 [INFO] DefaultLoadEventListener - Error performing load command<org.hibernate.exception.SQLGrammarException: could not load an entity: [com.xxx.yyy.Sellinfo#1]>org.hibernate.exception.SQLGrammarException: could not load an entity: [com.xxx.yyy.Sellinfo#1]***.hbm.xml文件中的某個列名和數據庫中的不一樣。(23) ConnectionManager - unclosed connection, forgot to call close() on your session?緣由:沒有關閉hibernate的session的transaction。或者沒有關閉session(24) [WARN] SellCommentDAO - org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (removedeleted object from associations): [com.xxx.yyy.SellComment#7]緣由:父親對象(one方)設置cascade="save-update" 時,直接刪除子對象時,會報錯,處理方法:save信息須要級聯操做,delete時候也要用相同的原理。SellComment sellComment=new SellComment();sellComment = (SellComment)session.load(SellComment.class,sellCommentId);//獲取兒子對象Long sellInfoId=sellComment.getSellInfo().getSellId();//獲取父親idSellInfo sellinfo=(SellInfo)session.load(SellInfo.class,sellInfoId);//獲取父親對象sellInfo.getSellComments().remove(sellComment);//斷絕父子關係sellComment.setSellInfo(null);//斷絕子父關係session.delete(sellComment);//刪除兒子session.flush();偶嘀錯誤集合 [轉貼 2007-03-04 15:19:00] 1. 作Hibernate多對一的時候遇到錯誤(1)org.apache.jasper.JasperException: Error creating bean with name 'sf' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.PropertyNotFoundException:Could not find a getter for person in class com.accp.vo.Course由於配置文件中的一個 <many-to-one name="person" ../> 中的person屬性名稱寫錯了.還有緣由以下:1)getter()方法寫錯了,沒有按照javaBean的規則寫.2)*.hmb.xml中的屬性名和pojo中的是否一致.注意:屬性名是否多了空格.(2).Hibernate多對一報錯:save the transient instance before flushing具體錯誤爲在one-to-many中,對many進行save時,因爲沒有加入one的外建,致使錯誤。具體解決方法:(1)、在one的hbm文件中 invest=true(2)、在many保存前務必要求one的存在2.spring+struts+hibernate 項目debug總結(1) javax.servlet.ServletException: Cannot retrieve mapping for action /companyNewsstruts-config.xml中沒有寫相關companyNews的action.(2) 在myeclipse增長一個jar包時候,先打開項目properties,選擇java build path --> libraries -->add external JARs 選擇到須要的jar包,加入後,發現,他這個包加載的是絕對路徑,而咱們的項目須要cvs共享,沒法commit到cvs服務器。myeclipse有如下提示信息:2 build path entries are missing.解決辦法是,關閉myeclipse,用notepad打開項目目錄下的 .classpath, 手動修改爲相對路徑,而且檢 查,指定的相對路徑中是否真正添加了jar包,啓動myeclipse就能夠上傳新添加的jar包了。(3) 在使用junit/StrutsTest時候,報錯:java.lang.UnsupportedClassVersionError: junit/framework/TestListener (Unsupported major.minor version 49.0)緣由是若是是jdk1.4的話,只能使用junit3.8如下版本,若是是使用jdk1.5的話,必須使用junit4.0 以上版本。(4) Cannot find ActionMappings or ActionformBeans collection緣由是:web.xml文件中沒有配置struts-config.xml的相關信息。(5) org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xmlor the jar files deployed with this application缺乏jstl的相關jar和web.xml配置jstl.jar<taglib><taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri><taglib-location>/WEB-INF/fmt.tld</taglib-location></taglib><taglib><taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri><taglib-location>/WEB-INF/fmt-rt.tld</taglib-location></taglib><taglib><taglib-uri>http://java.sun.com/jstl/core</taglib-uri><taglib-location>/WEB-INF/c.tld</taglib-location></taglib><taglib><taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri><taglib-location>/WEB-INF/c-rt.tld</taglib-location></taglib><taglib><taglib-uri>http://java.sun.com/jstl/sql</taglib-uri><taglib-location>/WEB-INF/sql.tld</taglib-location></taglib><taglib><taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri><taglib-location>/WEB-INF/sql-rt.tld</taglib-location></taglib><taglib><taglib-uri>http://java.sun.com/jstl/x</taglib-uri><taglib-location>/WEB-INF/x.tld</taglib-location></taglib><taglib><taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri><taglib-location>/WEB-INF/x-rt.tld</taglib-location></taglib>(5) Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLVstandard.jar沒有放在lib裏面(6) 建立oracle表的時候,使用了,role和comment關鍵字,建議不要將這兩個關鍵字做爲表名和字段名。建議用toad或plsql developer建立表,這樣軟件會提示關鍵字。(7) [ERROR] XMLHelper - Error parsing XML: XML InputStream(18) Attribute name "column" associated with an element type "key"must be followed by the ' = ' character.[ERROR] Configuration - Could not configure datastore from input stream <org.dom4j.DocumentException: Error on line 18 ofdocument : Attribute name "column" associated with an element type "key"must be followed by the ' = ' character. Nested exception: Attribute name "column" associated with an element type "key" mustbe followed by the ' = ' character.>org.dom4j.DocumentException: Erroron line 18 of document : Attribute name "column" associated with an element type "key" must be followed by the ' = 'character. Nested exception: Attribute name "column" associated with an elementtype "key" must be followed by the ' = ' character.xml 語法錯誤,key語法中應該相似這樣的寫法 <key column="id">(8) hibernate3,對象中一對多的one方,必須寫private Set pays=new HashSet();,不然包錯java.lang.NullPointerException ,而hibernate2中private Set pays;卻不報錯;(9) [DEBUG] AbstractSaveEventListener - generated identifier: 1, using strategy: org.hibernate.id.IncrementGeneratororg.hibernate.PropertyValueException: not-null property references a null or transient value: com.xxx.yyy.companyat org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)<many to one >中的設置應該設置爲not-null="false" ,設置爲not-null="true"則報以上錯誤(10) org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instancebefore flushing: com.xxx.yyy.Company在save的同時也須要save其餘的表,而後再flush()(11) Parse Fatal Error at line 12 column 1struts-config.xml文件被修改,語法錯誤。檢查語法。(12)org.hibernate.QueryException: could not resolve property: userid of:com.xxx.yyy.Pay使用到外鍵userid的時候,必須使用userinfo.userid方法才能獲得。(13)javax.naming.NameNotFoundException: Name hibernate_connection_factory is notbound in this Context 緣由:hibernate的數據庫映射.xml文件有配置錯誤,致使hibernate_connection_factory沒法綁定數據庫。例如many-to-one設置了之後,仍然在其中設置相沖突的<property>屬性。(14) [WARN] RequestProcessor - Unhandled Exception thrown: class java.lang.NullPointerException必須將使用到的對象new起來。(15) GROUP BY 表達式的查詢必須知足以下:select 子句後的每一項必需出如今group by 子句中,除非該項使用了彙集函數。(16) org.hibernate.TransientObjectException: object references an unsaved transientinstance - save the transient instance before flushing: com.xxx.yyy.Company要級聯保存,屢次session.save()(17)java.lang.IllegalArgumentException: id to load is required for loading緣由:session.load(Company.class,payForm.getCompanyId());load()方法第二個參數必須是searlizable,而且必須是和數據庫映射類的屬性值類型一致,即便強制轉換都不行。(18) [INFO] DefaultLoadEventListener - Error performing load command <org.hibernate.ObjectNotFoundException: No row with thegiven identifier exists: [com.xxx.yyy.Company#0]>org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xxx.yyy.Company#0]表示你如今查詢的對象所關聯的對象有問題,通常是由於數據的問題(該對象所關聯的對象找不到),數據的錯誤,影響了程序正常執行。(19)eclipse 3.1,myeclipse 4錯誤Deployment is out of date due to changes in the underlying project contents . You'll need to mannally 'Redeploy' the projectto update the deployed archive.緣由tomcat 中部署的某個文件的拒絕訪問影響了部署。重啓後,去除tomcat中部署的文件。從新在eclipse中設置部署。爲何須要重啓?由於:google desktop軟件正在對我部署的一個300MB大文件進行索引,鎖定了這個大文件,我估計google desktop須要對這個文件索引半個小時以上。所以,eclipse沒法對過去部署的文件,作先刪除後從新部署的工做。(20) ERROR LazyInitializationException:19 - could not initialize proxy - the owning Session was closedorg.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed解決辦法。cmpy=(CompanyEdit)ss.load(CompanyEdit.class,companyId1);Hibernate.initialize(cmpy);//強制初始化cmpy,不然ss.close()後,cmpy將消失.(21) javascript錯誤行: 56字符: 45錯誤: 未結束的字符串常量代碼: 0是編碼的問題!用ANSI編碼另存後就行了。(22) [WARN] JDBCExceptionReporter - SQL Error: 904, SQLState: 42000[ERROR] JDBCExceptionReporter - ORA-00904: 無效列名 [INFO] DefaultLoadEventListener - Error performing load command<org.hibernate.exception.SQLGrammarException: could not load an entity: [com.xxx.yyy.Sellinfo#1]>org.hibernate.exception.SQLGrammarException: could not load an entity: [com.xxx.yyy.Sellinfo#1]***.hbm.xml文件中的某個列名和數據庫中的不一樣。(23) ConnectionManager - unclosed connection, forgot to call close() on your session?緣由:沒有關閉hibernate的session的transaction。或者沒有關閉session(24) [WARN] SellCommentDAO - org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (removedeleted object from associations): [com.xxx.yyy.SellComment#7]緣由:父親對象(one方)設置cascade="save-update" 時,直接刪除子對象時,會報錯,處理方法:save信息須要級聯操做,delete時候也要用相同的原理。SellComment sellComment=new SellComment();sellComment = (SellComment)session.load(SellComment.class,sellCommentId);//獲取兒子對象Long sellInfoId=sellComment.getSellInfo().getSellId();//獲取父親idSellInfo sellinfo=(SellInfo)session.load(SellInfo.class,sellInfoId);//獲取父親對象sellInfo.getSellComments().remove(sellComment);//斷絕父子關係sellComment.setSellInfo(null);//斷絕子父關係session.delete(sellComment);//刪除兒子session.flush();2008-2-2 9:45:13 org.hibernate.util.JDBCExceptionReporter logExceptions嚴重: Unknown column 'tjsaleresu0_.isupdate' in 'field list'2008-2-2 9:45:13 org.hibernate.event.def.DefaultLoadEventListener onLoad信息: Error performing load commandorg.hibernate.exception.SQLGrammarException: could not load an entity: [ookj.domain.TjSaleResult#293]--數據庫中沒有「isupdate」字段2008-2-2 9:51:42 org.hibernate.util.JDBCExceptionReporter logExceptions警告: SQL Error: 1052, SQLState: 230002008-2-2 9:51:42 org.hibernate.util.JDBCExceptionReporter logExceptions嚴重: Column 'df' in where clause is ambiguous————find("select tsr from TjSaleResult tsr, TjItemResult tir where tsr=tir.saleResultId and tir=? and df<>1", new Object[]{tir});————語句中的df不能肯定是哪一個表的org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: trackDate of: ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=? and trt.df<>1]; nested exception is org.hibernate.QueryException: could not resolve property: trackDate of: ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=? and trt.df<>1]Caused by: org.hibernate.QueryException: could not resolve property: trackDate of: ookj.domain.TjReagentTrack [from ookj.domain.TjReagentTrack trt where trt.trackStage=? and trt.trackDate=? and trt.userId=? and trt.df<>1]————問題是配置中: private static String[][] properties={ {"getReagentTrackId","reagent_trackid","0"}, {"getReagentId","reagentid","1"}, {"getUserId","userid","1"}, {"getGuideBookId","guidebookid","1"}, {"getTrackTime","tracktime","0"}, //這裏名稱不對 {"trackStage","trackstage","0"}, {"getDf","df","0"}————還有nd trt.trackDate=? 語句中的值有誤。java.lang.ClassCastException: ookj.domain.OokjDateTime————基本的 類型轉換錯誤 String sql = "from TjReagentTrack trt where trt.trackStage=? and trt.trackTime like ? and trt.userId=? and trt.df<>1"; List<TjReagentTrack> list_reagenttrack = srs.find(sql, new Object[]{TjReagentTrack.TRACKSTAGE_QU, "%"+new OokjDate(new Date()).toString()+"%", su}); ApplicationInstance.getActive().setFocusedComponent(textField_Register);————Echo2焦點問題org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: ookj.domain.SmDept; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: ookj.domain.SmDeptCaused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: ookj.domain.SmDept————new了一個新對象,在未保存以前將它保存進了一個新new的對象。問題1,quartz 1.6 配置問題。須要使用common-collection-1.3.jar信息: could not read column value from result set: activep19_59_; could not deserializeException in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserializeCaused by: org.hibernate.type.SerializationException: could not deserializeat org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:217)at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)at org.hibernate.type.SerializableType.get(SerializableType.java:39)at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2096)at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)at org.hibernate.loader.Loader.getRow(Loader.java:1206)at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)at org.hibernate.loader.Loader.doQuery(Loader.java:701)at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)at org.hibernate.loader.Loader.doList(Loader.java:2220)at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)at org.hibernate.loader.Loader.list(Loader.java:2099)at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:849)at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)at ookj.dao.pub.impl.CommonDaoImpl.find(CommonDaoImpl.java:96)at ookj.service.impl.BasicServiceImpl.find(BasicServiceImpl.java:45)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)at $Proxy1.find(Unknown Source)at ookj.ui.barcode.BarCodePerson.returnBookFromCode(BarCodePerson.java:63)at ookj.ui.barcode.BarCodePerson.getFengMian(BarCodePerson.java:44)at ookj.ui.barcode.BarCodePerson.main(BarCodePerson.java:28)Caused by: java.io.EOFExceptionat java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)at java.io.ObjectInputStream.readStreamHeader(Unknown Source)at java.io.ObjectInputStream.<init>(Unknown Source)at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:252)at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:209)... 40 more++++++<property column="sendfei" length="16" name="sendFei" type="java.math.BigDecimal" />++++======<many-to-one column="activeplace" name="activePlace" class="ookj.domain.SmDept" />======org.hibernate.type.SerializationException could not deserialize;我用的數據庫是mysql,在經過pojo類自動生成的類中,未爲字段指定type,hibernate對自動爲其指定,若是它所生成的type不能被反序列化,就會拋出java.util.ServilizableException好比我產生異常的緣由是我創建了一個string[]類型的字段,但在對應的.hbm.xml文件中我沒有顯式定義它的類型,hibernate自動爲其指定了類型,該類型不能被反序列化。2008-1-29 14:06:31 org.hibernate.util.JDBCExceptionReporter logExceptions嚴重: Invalid value for getInt() - '2008-01-18 12:12:12' in column 242008-1-29 14:06:32 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions信息: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]2008-1-29 14:06:32 org.springframework.jdbc.support.SQLErrorCodesFactory <init>信息: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]++++<property column="prereportdate" length="6" name="preReportDate" type="java.lang.Integer" />+++++====<property column="prereportdate" length="20" name="preReportDate" type="java.lang.String" />===Expected positional parameter count: 1, actual parameters: [] [select m from TjMedicalName m, TjSaleResult s where s.guideBookId = ? and s.df<>1 and s.saleItemId.medicalGroup.medicalId=m.medicalId]++++bs.find("select m from TjMedicalName m, TjSaleResult s where s.guideBookId = ? and s.df<>1 and s.saleItemId.medicalGroup.medicalId=m.medicalId");+++====bs.find("select m from TjMedicalName m, TjSaleResult s where s.guideBookId = ? and s.df<>1 and s.saleItemId.medicalGroup.medicalId=m.medicalId", new Object[]{sgb});===嚴重: line 1:143: expecting IDENT, found '.'2008-2-3 0:41:01 org.apache.catalina.core.StandardWrapperValve invoke嚴重: Servlet.service() for servlet tijianServlet threw exceptionorg.springframework.orm.hibernate3.HibernateQueryException: expecting IDENT, found '.' near line 1, column 143 [select t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and t.saleItemId..medicalGroup.df<>1]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '.' near line 1, column 143 [select t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and t.saleItemId..medicalGroup.df<>1]Caused by: org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '.' near line 1, column 143 [select t.saleItemId.medicalGroup from ookj.domain.TjSaleResult t where t.guideBookId=? and t.saleItemId.medicalGroup.block=? and t.saleItemId..medicalGroup.df<>1]_____多了一個點java.net.SocketException: java.net.ConnectException: Connection refused: connect————數據庫未啓動嚴重: Servlet.service() for servlet tijianServlet threw exceptionjava.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!————忘了怎麼解決的了,反正不是大問題。嚴重: Servlet.service() for servlet tijianServlet threw exceptionjava.lang.NoSuchMethodError: ookj.service.SendReagentService.saveTjSendReagent(Lookj/domain/TjReagent;Lookj/domain/SaleGuideBook;)[Ljava/lang/String;————Tomcat\Java虛擬集中代碼未跟上,不能保持同步,重啓虛擬機就行了。嚴重: Unknown column 'tjsendreag0_.tj_sendreagent' in 'field list'org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute queryCaused by: org.hibernate.exception.SQLGrammarException: could not execute queryCaused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'tjsendreag0_.tj_sendreagent' in 'field list'————配置文件hbr.xml中寫的tj_sendreagent字段,在數據庫中找不到。1,TextField控件textField_Maker.setEnabled(false);爲禁用true爲可用。2, GroupBox groupBox_GeRenJiHuo = new GroupBox(); groupBox_GeRenJiHuo.setWidth(new Extent(300, Extent.PX)); groupBox_GeRenJiHuo.setTitle("我的預定激活"); RowLayoutData groupBox_GeRenJiHuoLayoutData = new RowLayoutData(); groupBox_GeRenJiHuoLayoutData.setInsets(new Insets(new Extent(20, Extent.PX))); groupBox_GeRenJiHuo.setLayoutData(groupBox_GeRenJiHuoLayoutData); row_JiHuo.add(groupBox_GeRenJiHuo); GroupBox groupBox_TuanDuiJiHuo = new GroupBox(); groupBox_TuanDuiJiHuo.setWidth(new Extent(300, Extent.PX)); groupBox_TuanDuiJiHuo.setTitle("團隊預定激活"); groupBox_TuanDuiJiHuo.setInsets(new Insets(new Extent(20, Extent.PX))); row_JiHuo.add(groupBox_TuanDuiJiHuo);第二個是內部20的間隙。第一個沒表現。