-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Got error using hibernate2.0 to access mysql 4.023a
PostPosted: Thu Jun 02, 2005 2:34 am 
Newbie

Joined: Wed Jun 01, 2005 6:16 am
Posts: 2
使用java应用程序通过hibernate访问DB,大部分时间是可以正常运行的,在偶尔的情况下会出现如下的错误。怀疑是数据连接的问题。有其他人遇到这样的问题吗?如何
java program using hibernate 2.0 to access mysql db. normally running well, bu sometimes will hit strange error.

if anybody knows how to solve ?
thank you very much.

Hibernate config:
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/mms_gw?autoReconnect=true</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>

<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory</property>




Exception:



Caused by: net.sf.hibernate.exception.GenericJDBCException: could not load: [com.haoxi.gw.mms.entity.WaitSendRequest#18736]
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:416)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2131)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2001)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1930)
at com.haoxi.gw.util.BaseDAO.findById(BaseDAO.java:169)
... 5 more
Caused by: java.sql.SQLException: No operations allowed after connection closed.

Connection was closed due to the following exception:

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1319)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1463)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1854)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1109)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1203)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2090)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:273)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:941)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:961)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:413)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2131)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2001)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1930)
at com.haoxi.gw.util.BaseDAO.findById(BaseDAO.java:169)
at com.haoxi.gw.mms.dao.WaitSendRequestDAO.load(WaitSendRequestDAO.java:55)
at com.haoxi.gw.mms.bl.WaitSendRequestBL.findWaitSendRequest(WaitSendRequestBL.java:36)
at com.haoxi.gw.mms.d.zte.MmsZteSubmit.submitAfter(MmsZteSubmit.java:78)
at com.haoxi.gw.mms.d.MmsSubmitTask.doJob(MmsSubmitTask.java:27)
at com.haoxi.gw.util.threadpool.MainThread$ChildThread.run(MainThread.java:198)


** END NESTED EXCEPTION **



STACKTRACE:

java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1319)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1463)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1854)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1109)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1203)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2090)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:273)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:941)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:961)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:413)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2131)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2001)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1930)
at com.haoxi.gw.util.BaseDAO.findById(BaseDAO.java:169)
at com.haoxi.gw.mms.dao.WaitSendRequestDAO.load(WaitSendRequestDAO.java:55)
at com.haoxi.gw.mms.bl.WaitSendRequestBL.findWaitSendRequest(WaitSendRequestBL.java:36)
at com.haoxi.gw.mms.d.zte.MmsZteSubmit.submitAfter(MmsZteSubmit.java:78)
at com.haoxi.gw.mms.d.MmsSubmitTask.doJob(MmsSubmitTask.java:27)
at com.haoxi.gw.util.threadpool.MainThread$ChildThread.run(MainThread.java:198)


** END NESTED EXCEPTION **


at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1638)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1854)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1109)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1203)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2090)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:273)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:941)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:961)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:413)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2131)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2001)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1930)
at com.haoxi.gw.util.BaseDAO.findById(BaseDAO.java:169)
at com.haoxi.gw.mms.dao.WaitSendRequestDAO.load(WaitSendRequestDAO.java:55)
at com.haoxi.gw.mms.bl.WaitSendRequestBL.findWaitSendRequest(WaitSendRequestBL.java:36)
at com.haoxi.gw.mms.d.zte.MmsZteSubmit.submitAfter(MmsZteSubmit.java:78)
at com.haoxi.gw.mms.d.MmsSubmitTask.doJob(MmsSubmitTask.java:27)
at com.haoxi.gw.util.threadpool.MainThread$ChildThread.run(MainThread.java:198)


** END NESTED EXCEPTION **


at com.mysql.jdbc.Connection.checkClosed(Connection.java:2225)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1313)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1293)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:263)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:236)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:67)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:784)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:941)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:961)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:413)
... 9 more


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.