-->
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: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Com
PostPosted: Sat Jul 21, 2012 4:08 am 
Newbie

Joined: Sat Jul 30, 2011 3:14 am
Posts: 5
I built an desktop application where running lots of threads which is working perfect in local pc.
but when I deployed it on a remote server few time it work's fine but after some time getting this exception -

Code:
** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
MESSAGE: Communications link failure

Last packet sent to the server was 19233 ms ago.

STACKTRACE:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 19233 ms ago.

        at sun.reflect.GeneratedConstructorAccessor36.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2874)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2764)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3286)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1852)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1975)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2476)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1583)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1725)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
        at org.hibernate.loader.Loader.doQuery(Loader.java:662)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2150)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
        at org.hibernate.loader.Loader.list(Loader.java:2024)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
        at glb.chatmeter.dao.LocalSearchDao.getLocalStaticIDByPageUrl(LocalSearchDao.java:533)
        at glb.chatmeter.manager.LocalSearchManager.getLocalStaticIDByPageUrl(LocalSearchManager.java:76)
        at glb.chatmeter.crawler.facebook.FaceBookPageProvider.saveLocalStaticData(FaceBookPageProvider.java:228)
        at glb.chatmeter.crawler.facebook.FaceBookPageProvider.getFacebookData(FaceBookPageProvider.java:139)
        at glb.chatmeter.crawler.facebook.FaceBookPageProvider.run(FaceBookPageProvider.java:53)

Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
        at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
        at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
       at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2330)
       at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2775)
        ... 22 more

** END NESTED EXCEPTION **

        at sun.reflect.GeneratedConstructorAccessor65.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
        at com.mysql.jdbc.Util.getInstance(Util.java:378)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:985)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
        at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1102)
        at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:3906)
        at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:3872)
        at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4015)
        at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.hibernate.util.GetGeneratedKeysHelper.prepareStatement(GetGeneratedKeysHelper.java:45)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:435)
        at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:93)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1948)
        ... 23 more
Hibernate: insert into chatmeter2_crawlertest.proxy_log (CMLocationId, NoOfTried, DateTime, IPAddress, PortNo, ProxyUser, ProxyPassword, Provider, PageURL, PageSource, FailReason) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
org.hibernate.exception.JDBCConnectionException: could not insert: [glb.chatmeter.db.ProxyLog]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:72)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1986)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
        at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
        at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:529)
        at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:521)
        at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:517)


after this exception not saving/selecting/updating any record-


Not :- when I am going to execute any query checking session and if session available using current session other wise creating new session.

calling rollback(); when getting exception save or update time.
but not closing session any where.

is any one help me what is the problem.
This same problem I am getting in my web application to after some time after some time automatic it shows this exception.


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.