geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Problem during shutdown when using JMS in a GBean
Date Tue, 08 Jan 2008 18:30:48 GMT

On Jan 8, 2008, at 7:32 AM, ivanrc wrote:

>
> ┬┐witch jar contains ManagedConnectionFactoryWrapper class and  
> NameFactory
> class?.thanks.
>

ManagedConnectionFactoryWrapper is currently in  
org.apache.geronimo.components:geronimo-connector:2.0.2:jar and used  
to be in org.apache.geronimo.modules:geronimo-connector:??:jar.

NameFactory is in org.apache.geronimo.modules:geronimo-j2ee:*:jar

hope this helps
david jencks

>
>
>
> Glenn Owen wrote:
>>
>>
>> Hmm, seems like the rollback of the message on the queues was due to
>> another problem. So we may not care so much, that Geronimo is  
>> throwing
>> the exception on shutdown.
>>
>> However, I'm still looking into this problem, because we get a  
>> similar
>> "Got duplicate deregisterConnection for client:" exception when  
>> shutting
>> down Geronimo if an MDB had sent any messages to another MDB.
>>
>>
>> -------- Forwarded Message --------
>> From: Glenn Owen <glenn.owen@eventiontech.com>
>> To: user@geronimo.apache.org
>> Subject: Problem during shutdown when using JMS in a GBean
>> Date: Thu, 01 Mar 2007 11:43:38 -0400
>>
>> I have a problem trying to utilize a JMS queue from a GBean in  
>> Geronimo
>> 1.1.1.
>>
>> I believe I have correctly injected the Queue & Factory, as writing
>> messages
>> to the queue seems to work just fine, the problem occurs when  
>> Geronimo is
>> restarted.
>> I get an error on shutdown, that unfortunately has the side effect of
>> restoring
>> all the messages into the queues, so they get reprocessed on next
>> start-up.
>>
>> Here's the important bits of the code (I've removed the Queue  
>> injection
>> parts to simplify things)
>>
>> geronimo-application.xml:
>>
>>   <sys:reference name="MyQueueFactory">
>>       <sys:name>ProxyConnectionFactory</sys:name>
>>   </sys:reference>
>>
>> GBean Info:
>>
>> 		infoBuilder.addReference("MyQueueFactory",
>> 				   ManagedConnectionFactoryWrapper.class,
>> 				   NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
>>
>> 		infoBuilder.setConstructor(new String[] {"MyQueueFactory"});
>>
>>
>> GBean Constructor:
>>
>>    public MyProxy (ManagedConnectionFactoryWrapper pFactoryWrapper) {
>> 		
>> 		jmsFactory = (QueueConnectionFactory)
>> pFactoryWrapper.getConnectionFactory();
>> 				
>> 		QueueConnection sendQueueConn = (QueueConnection)
>> jmsFactory.createConnection();
>>
>>                  // do regular Queue type stuff ...
>>
>> 		sendQueueConn.close();
>>
>>
>> and during Geronimo shutdown I get.....
>>
>> 11:06:49,469 WARN  [BrokerContainerImpl] Got duplicate
>> deregisterConnection for client: ID:laptop-38073-1172761593045-18:0
>> 11:06:49,474 WARN  [TransportChannelSupport] Caught exception  
>> dispatching
>> message and no ExceptionListener registered:  
>> javax.jms.JMSException: Error
>> reading socket: java.io.EOFException
>> javax.jms.JMSException: Error reading socket: java.io.EOFException
>> 	at
>> org.activemq.util.JMSExceptionHelper.newJMSException 
>> (JMSExceptionHelper.java:49)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.doClose 
>> (TcpTransportChannel.java:509)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.run 
>> (TcpTransportChannel.java:330)
>> 	at java.lang.Thread.run(Thread.java:595)
>> Caused by: java.io.EOFException
>> 	at java.io.DataInputStream.readByte(DataInputStream.java:243)
>> 	at
>> org.activemq.io.AbstractWireFormat.readPacket 
>> (AbstractWireFormat.java:230)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.run 
>> (TcpTransportChannel.java:313)
>> 	... 1 more
>> 11:06:49,503 INFO  [ActiveMQManagedConnection] Error occured  
>> during close
>> of a JMS connection.
>> javax.jms.JMSException: syncSendTimedOut: connection no longer OK
>> 	at
>> org.activemq.ActiveMQConnection.syncSendPacket 
>> (ActiveMQConnection.java:1403)
>> 	at
>> org.activemq.ActiveMQConnection.sendConnectionInfoToBroker 
>> (ActiveMQConnection.java:1628)
>> 	at org.activemq.ActiveMQConnection.close(ActiveMQConnection.java: 
>> 763)
>> 	at
>> org.activemq.ra.ActiveMQManagedConnection.destroy 
>> (ActiveMQManagedConnection.java:225)
>> 	at
>> org.apache.geronimo.connector.outbound.SinglePoolConnectionIntercepto 
>> r.internalDestroy(SinglePoolConnectionInterceptor.java:121)
>> 	at
>> org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionIn 
>> terceptor.destroy(AbstractSinglePoolConnectionInterceptor.java:138)
>> 	at
>> org.apache.geronimo.connector.outbound.TransactionEnlistingIntercepto 
>> r.destroy(TransactionEnlistingInterceptor.java:98)
>> 	at
>> org.apache.geronimo.connector.outbound.TransactionCachingInterceptor. 
>> destroy(TransactionCachingInterceptor.java:113)
>> 	at
>> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.de 
>> stroy(ConnectionHandleInterceptor.java:75)
>> 	at
>> org.apache.geronimo.connector.outbound.TCCLInterceptor.destroy 
>> (TCCLInterceptor.java:57)
>> 	at
>> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor. 
>> destroy(ConnectionTrackingInterceptor.java:86)
>> 	at
>> org.apache.geronimo.connector.outbound.AbstractConnectionManager.doSt 
>> op(AbstractConnectionManager.java:169)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.destroyInstance 
>> (GBeanInstance.java:1143)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStop( 
>> GBeanInstanceState.java:337)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop 
>> (GBeanInstanceState.java:188)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.stop 
>> (GBeanInstance.java:548)
>> 	at
>> org.apache.geronimo.kernel.basic.BasicKernel.stopGBean 
>> (BasicKernel.java:423)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop 
>> (GBeanInstanceState.java:180)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.stop 
>> (GBeanInstance.java:548)
>> 	at
>> org.apache.geronimo.kernel.basic.BasicKernel.stopGBean 
>> (BasicKernel.java:423)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop 
>> (GBeanInstanceState.java:180)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.stop 
>> (GBeanInstance.java:548)
>> 	at
>> org.apache.geronimo.kernel.basic.BasicKernel.stopGBean 
>> (BasicKernel.java:423)
>> 	at
>> org.apache.geronimo.kernel.config.KernelConfigurationManager 
>> $ShutdownHook.run(KernelConfigurationManager.java:310)
>> 	at
>> org.apache.geronimo.kernel.basic.BasicKernel.notifyShutdownHooks 
>> (BasicKernel.java:668)
>> 	at
>> org.apache.geronimo.kernel.basic.BasicKernel.shutdown 
>> (BasicKernel.java:645)
>> 	at org.apache.geronimo.kernel.KernelGBean.shutdown 
>> (KernelGBean.java:378)
>> 	at
>> org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$ 
>> $1cccefc9.invoke(<generated>)
>> 	at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>> 	at
>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke 
>> (FastMethodInvoker.java:38)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke 
>> (GBeanOperation.java:122)
>> 	at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke 
>> (GBeanInstance.java:852)
>> 	at
>> org.apache.geronimo.kernel.basic.BasicKernel.invoke 
>> (BasicKernel.java:239)
>> 	at
>> org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke 
>> (MBeanGBeanBridge.java:168)
>> 	at
>> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke 
>> (DynamicMetaDataImpl.java:213)
>> 	at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java: 
>> 220)
>> 	at
>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke 
>> (DefaultMBeanServerInterceptor.java:815)
>> 	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke 
>> (JmxMBeanServer.java:784)
>> 	at
>> javax.management.remote.rmi.RMIConnectionImpl.doOperation 
>> (RMIConnectionImpl.java:1408)
>> 	at
>> javax.management.remote.rmi.RMIConnectionImpl.access$100 
>> (RMIConnectionImpl.java:81)
>> 	at
>> javax.management.remote.rmi.RMIConnectionImpl 
>> $PrivilegedOperation.run(RMIConnectionImpl.java:1245)
>> 	at java.security.AccessController.doPrivileged(Native Method)
>> 	at
>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation 
>> (RMIConnectionImpl.java:1348)
>> 	at
>> javax.management.remote.rmi.RMIConnectionImpl.invoke 
>> (RMIConnectionImpl.java:782)
>> 	at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke 
>> (DelegatingMethodAccessorImpl.java:25)
>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java: 
>> 294)
>> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
>> 	at java.security.AccessController.doPrivileged(Native Method)
>> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
>> 	at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages 
>> (TCPTransport.java:466)
>> 	at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run 
>> (TCPTransport.java:707)
>> 	at java.lang.Thread.run(Thread.java:595)
>>
>>
>> If don't do the connection close(), I get a different error.....
>>
>> 11:26:28,171 WARN  [BrokerContainerImpl] No clientID available for  
>> client:
>> brokerConnector-client:(10268338) : TcpTransportChannel:
>> Socket[addr=/127.0.0.1,port=40729,localport=61616]
>> 11:26:28,175 WARN  [ActiveMQManagedConnection] Connection failed:
>> javax.jms.JMSException: Error reading socket: java.io.EOFException
>> 11:26:28,180 WARN  [GeronimoConnectionEventListener]
>> connectionErrorOccurred called with null
>> javax.jms.JMSException: Error reading socket: java.io.EOFException
>> 	at
>> org.activemq.util.JMSExceptionHelper.newJMSException 
>> (JMSExceptionHelper.java:49)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.doClose 
>> (TcpTransportChannel.java:509)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.run 
>> (TcpTransportChannel.java:330)
>> 	at java.lang.Thread.run(Thread.java:595)
>> Caused by: java.io.EOFException
>> 	at java.io.DataInputStream.readByte(DataInputStream.java:243)
>> 	at
>> org.activemq.io.AbstractWireFormat.readPacket 
>> (AbstractWireFormat.java:230)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.run 
>> (TcpTransportChannel.java:313)
>> 	... 1 more
>> 11:26:28,185 INFO  [ActiveMQManagedConnection] Error occured  
>> during close
>> of a JMS connection.
>> javax.jms.JMSException: syncSendTimedOut: connection no longer OK
>> 	at
>> org.activemq.ActiveMQConnection.syncSendPacket 
>> (ActiveMQConnection.java:1403)
>> 	at
>> org.activemq.ActiveMQConnection.sendConnectionInfoToBroker 
>> (ActiveMQConnection.java:1628)
>> 	at org.activemq.ActiveMQConnection.close(ActiveMQConnection.java: 
>> 763)
>> 	at
>> org.activemq.ra.ActiveMQManagedConnection.destroy 
>> (ActiveMQManagedConnection.java:225)
>> 	at
>> org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.retur 
>> nConnection(MCFConnectionInterceptor.java:57)
>> 	at
>> org.apache.geronimo.connector.outbound.XAResourceInsertionInterceptor 
>> .returnConnection(XAResourceInsertionInterceptor.java:47)
>> 	at
>> org.apache.geronimo.connector.outbound.SinglePoolConnectionIntercepto 
>> r.internalReturn(SinglePoolConnectionInterceptor.java:162)
>> 	at
>> org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionIn 
>> terceptor.returnConnection 
>> (AbstractSinglePoolConnectionInterceptor.java:119)
>> 	at
>> org.apache.geronimo.connector.outbound.TransactionEnlistingIntercepto 
>> r.returnConnection(TransactionEnlistingInterceptor.java:94)
>> 	at
>> org.apache.geronimo.connector.outbound.TransactionCachingInterceptor. 
>> returnConnection(TransactionCachingInterceptor.java:93)
>> 	at
>> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.re 
>> turnConnection(ConnectionHandleInterceptor.java:71)
>> 	at
>> org.apache.geronimo.connector.outbound.TCCLInterceptor.returnConnecti 
>> on(TCCLInterceptor.java:50)
>> 	at
>> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor. 
>> returnConnection(ConnectionTrackingInterceptor.java:82)
>> 	at
>> org.apache.geronimo.connector.outbound.GeronimoConnectionEventListene 
>> r.connectionErrorOccurred(GeronimoConnectionEventListener.java:81)
>> 	at
>> org.activemq.ra.ActiveMQManagedConnection.fireErrorOccurredEvent 
>> (ActiveMQManagedConnection.java:192)
>> 	at
>> org.activemq.ra.ActiveMQManagedConnection.onException 
>> (ActiveMQManagedConnection.java:409)
>> 	at
>> org.activemq.transport.TransportChannelSupport.onAsyncException 
>> (TransportChannelSupport.java:445)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.doClose 
>> (TcpTransportChannel.java:509)
>> 	at
>> org.activemq.transport.tcp.TcpTransportChannel.run 
>> (TcpTransportChannel.java:330)
>> 	at java.lang.Thread.run(Thread.java:595)
>>
>>
>> I must be missing something simple - but what is it?
>>
>> Note, I do need to admit I'm using Java 1.5 - if there's a chance  
>> it is
>> the cause.
>>
>> Glenn.
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Problem-during- 
> shutdown-when-using-JMS-in-a-GBean-tp9252234s134p14691986.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Mime
View raw message