org.hibernate.type.NullableType nullSafeGet could not read column value from result set: CONTRIB23_35_; 無法轉(zhuǎn)換為內(nèi)部表示
我在解決該反常的方式是:
1.依據(jù)提醒肯定展現(xiàn)問題的數(shù)據(jù)類別.(過濾無須要的檢驗(yàn),削減耗費(fèi)在該問題上的工夫淘寶商城:?炊闯J侵饕獑栴}).
2.核查數(shù)據(jù)庫字段類別與POJO類的字段數(shù)據(jù)類別是否相稱.
-
3.檢驗(yàn)數(shù)據(jù)庫字段內(nèi)的value.
如:你的數(shù)據(jù)庫字段類別為number那么在手動(dòng)照射POJO時(shí)也許你會(huì)把它寫成int類別這么本身是不曾錯(cuò)的(在你數(shù)據(jù)庫內(nèi)的值不曾超出 int的長度前).然而由于數(shù)據(jù)庫的字段類別為number那么在測驗(yàn)時(shí)或許你會(huì)手動(dòng)插入一些值.而值的長度超出int所能接納的長度。那么在過程運(yùn)行時(shí)對該字段舉行g(shù)et時(shí)就會(huì)展現(xiàn)上面的差錯(cuò)。這是其一。
hibernate幾個(gè)問題
Excel單元格中的回車/換行 Alt+Enter
2008-2-2 9:45:13 org.hibernate.util.JDBCExceptionReporter logExceptions
嚴(yán)重: 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]
--數(shù)據(jù)庫中沒有“isupdate”字段
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
嚴(yán)重: 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不能確定是哪個(gè)表的
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
————基本的 類型轉(zhuǎn)換錯(cuò)誤
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焦點(diǎn)問題
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了一個(gè)新對象,在未保存之前將它保存進(jìn)了一個(gè)新new的對象。
問題1,quartz 1.6 配置問題。需要使用common-collection-1.3.jar
信息: 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
at 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.EOFException
at 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;
我用的數(shù)據(jù)庫是mysql,在通過pojo類自動(dòng)生成的類中,未為字段指定type,hibernate對自動(dòng)為其指定,如果它所生成的type不能被反序列化,就會(huì)拋出java.util.ServilizableException
比如我產(chǎn)生異常的原因是我建立了一個(gè)string[]類型的字段,但在對應(yīng)的.hbm.xml文件中我沒有顯式定義它的類型,hibernate自動(dòng)為其指定了類型,該類型不能被反序列化。
2008-1-29 14:06:31 org.hibernate.util.JDBCExceptionReporter logExceptions
嚴(yán)重: Invalid value for getInt() - '2008-01-18 12:12:12' in column 24
2008-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});===
嚴(yán)重: line 1:143: expecting IDENT, found '.'
2008-2-3 0:41:01 org.apache.catalina.core.StandardWrapperValve invoke
嚴(yán)重: 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]
_____多了一個(gè)點(diǎn)
java.net.SocketException: java.net.ConnectException: Connection refused: connect
————數(shù)據(jù)庫未啟動(dòng)
嚴(yán)重: Servlet.service() for servlet tijianServlet threw exception
java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!
————忘了怎么解決的了,反正不是大問題。
嚴(yán)重: 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虛擬集中代碼未跟上,不能保持同步,重啟虛擬機(jī)就好了。
嚴(yán)重: 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 query
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'tjsendreag0_.tj_sendreagent' in 'field list'
————配置文件hbr.xml中寫的tj_sendreagent字段,在數(shù)據(jù)庫中找不到。
1,TextField控件textField_Maker.setEnabled(false);為禁用true為可用。
2,
GroupBox groupBox_GeRenJiHuo = new GroupBox();
groupBox_GeRenJiHuo.setWidth(new Extent(300, Extent.PX));
groupBox_GeRenJiHuo.setTitle("個(gè)人預(yù)約激活");
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("團(tuán)隊(duì)預(yù)約激活");
groupBox_TuanDuiJiHuo.setInsets(new Insets(new Extent(20, Extent.PX)));
row_JiHuo.add(groupBox_TuanDuiJiHuo);
第二個(gè)是內(nèi)部20的間隙。第一個(gè)沒表現(xiàn)。
本文出自:億恩科技【1tcdy.com】
服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|