This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

OpenJMS cannot connect to DB after idle several hours  RSS feed

 
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)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!