This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OpenJMS cannot connect to DB after idle several hours

 
Dante Tang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I got a problem... after idle for several hours, when I use the sample program to send presistent message, PersistenceException thrown. The root cause of it is a SQLException, Communication link failure.
The problem remains until I restart OpenJMS server.
Does anyone knows how to tackle this? Is it possible to restart OpenJMS programmatically?
Many Many Thanks in advance.
Best Regards,
Dante

Here are the exceptions for your reference:

javax.jms.JMSException: Failed to make message persistent: org.exolab.jms.persistence.PersistenceException:
Failed to add message=ID:193095ea-b867-1004-88f4-6a8c0867c808, destination=MM1InQueue (1)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at org.exolab.jms.server.rmi.RmiJmsServerSession_Stub.sendMessage(Unknown Source)
at org.exolab.jms.client.rmi.RmiJmsSessionStub.sendMessage(RmiJmsSessionStub.java:174)
at org.exolab.jms.client.JmsSession.sendMessage(JmsSession.java:676)
at org.exolab.jms.client.JmsMessageProducer.sendMessage(JmsMessageProducer.java:238)
at org.exolab.jms.client.JmsQueueSender.send(JmsQueueSender.java:156)
at org.exolab.jms.client.JmsQueueSender.send(JmsQueueSender.java:113)
at openjms.examples.client.console.SimpleSender.main(SimpleSender.java:141)
org.exolab.jms.persistence.PersistenceException:
java.sql.SQLException: Communication link failure: java.io.IOException
at org.gjt.mm.mysql.MysqlIO.clearAllReceive(Unknown Source)
at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(Unknown Source)
at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:207)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:207)
at org.exolab.jms.persistence.Messages.add(Messages.java:190)
at org.exolab.jms.persistence.RDBMSAdapter.addMessage(RDBMSAdapter.java:365)
at org.exolab.jms.messagemgr.MessageMgr.addPersistentMessage(MessageMgr.java:369)
at org.exolab.jms.messagemgr.MessageMgr.add(MessageMgr.java:281)
at org.exolab.jms.server.JmsServerSession.sendMessage(JmsServerSession.java:350)
at org.exolab.jms.server.rmi.RmiJmsServerSession.sendMessage(RmiJmsServerSession.java:174)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
at java.lang.Thread.run(Thread.java:484)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic