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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,

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(
at sun.rmi.transport.StreamRemoteCall.executeCall(
at sun.rmi.server.UnicastRef.invoke(
at org.exolab.jms.server.rmi.RmiJmsServerSession_Stub.sendMessage(Unknown Source)
at org.exolab.jms.client.rmi.RmiJmsSessionStub.sendMessage(
at org.exolab.jms.client.JmsSession.sendMessage(
at org.exolab.jms.client.JmsMessageProducer.sendMessage(
at org.exolab.jms.client.JmsQueueSender.send(
at org.exolab.jms.client.JmsQueueSender.send(
at openjms.examples.client.console.SimpleSender.main(
java.sql.SQLException: Communication link failure:
at Source)
at Source)
at Source)
at Source)
at Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(
at org.exolab.jms.persistence.Messages.add(
at org.exolab.jms.persistence.RDBMSAdapter.addMessage(
at org.exolab.jms.messagemgr.MessageMgr.addPersistentMessage(
at org.exolab.jms.messagemgr.MessageMgr.add(
at org.exolab.jms.server.JmsServerSession.sendMessage(
at org.exolab.jms.server.rmi.RmiJmsServerSession.sendMessage(
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(
at sun.rmi.transport.Transport$
at Method)
at sun.rmi.transport.Transport.serviceCall(
at sun.rmi.transport.tcp.TCPTransport.handleMessages(
at sun.rmi.transport.tcp.TCPTransport$
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic