axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rene Preissel (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TRANSPORTS-53) Shared connection in JMSConnectionFactory doesn't support reconnect
Date Wed, 17 Oct 2012 09:38:02 GMT

    [ https://issues.apache.org/jira/browse/TRANSPORTS-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477738#comment-13477738
] 

Rene Preissel commented on TRANSPORTS-53:
-----------------------------------------

The solution is an exception listener that cleansup the shared resources.

@@ -42,7 +44,9 @@ import java.util.Hashtable;
  * When used for sending messages out, the JMSConnectionFactory'ies are able to cache
  * a Connection, Session or Producer
  */
-public class JMSConnectionFactory {
+public class JMSConnectionFactory implements ExceptionListener {
 
@@ -369,6 +373,12 @@ public class JMSConnectionFactory {
     private Connection getSharedConnection() {
         if  (sharedConnection == null) {
             sharedConnection = createConnection();
+            try {
+				sharedConnection.setExceptionListener(this);
+			} catch (JMSException e) {
+				handleException("Error setting exception listener", e);
+			}
			 
@@ -403,4 +413,28 @@ public class JMSConnectionFactory {
         }
         return sharedProducer;
     }
+
+	public void onException(JMSException j) {
+		sharedConnection=null;
+		sharedSession=null;
+		sharedSession=null;
+		
+		log.warn("JMS Connection failure : " + j.getMessage());		
+	}
+
 }
                
> Shared connection in JMSConnectionFactory doesn't support reconnect
> -------------------------------------------------------------------
>
>                 Key: TRANSPORTS-53
>                 URL: https://issues.apache.org/jira/browse/TRANSPORTS-53
>             Project: Axis2 Transports
>          Issue Type: Bug
>          Components: JMS
>    Affects Versions: 1.0.0
>         Environment: Seen on JBoss 5.1.0_GA and TibcoEMS 5.1.0
>            Reporter: Rene Preissel
>
> JMSSender uses the JMSConnectionFactory to create JMS connections.
> This connection is used to send the results back to the client.
> JMSConnectionFactory uses a shared connection internally. If the JMS Server fails and
restarts this shared connection is not cleaned up. Next time a result should be send to the
client an IllegalStateException is thrown:
> javax.jms.IllegalStateException: Connection is closed
> 	at com.tibco.tibjms.TibjmsConnection._createSession(TibjmsConnection.java:2621)
> 	at com.tibco.tibjms.TibjmsConnection._createSession(TibjmsConnection.java:2601)
> 	at com.tibco.tibjms.TibjmsTopicConnection.createTopicSession(TibjmsTopicConnection.java:46)
> 	at org.apache.axis2.transport.jms.JMSOutTransportInfo.createJMSSender(JMSOutTransportInfo.java:365)
> 	at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:121)
> 	at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:119)
> 	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
> 	at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:43)
> 	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
> 	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
> 	at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
> 	at org.apache.axis2.transport.jms.JMSMessageReceiver.processThoughEngine(JMSMessageReceiver.java:196)
> 	at org.apache.axis2.transport.jms.JMSMessageReceiver.onMessage(JMSMessageReceiver.java:122)
> 	at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.handleMessage(ServiceTaskManager.java:530)
> 	at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.run(ServiceTaskManager.java:442)
> 	at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:58)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message