Hauke Rabe created CAMEL-6459:
---------------------------------
Summary: ReplyManager holds a reference to the first calling
Bundle classloader
Key: CAMEL-6459
URL: https://issues.apache.org/jira/browse/CAMEL-6459
Project: Camel
Issue Type: Bug
Components: camel-jms
Affects Versions: 2.10.4
Environment: Apache karaf 2.3.1
Reporter: Hauke Rabe
h3. Source
The initialization of the ReplyManager is triggerd by the first processInOut
method call at the JmsProducer.
The concrete instance of the ReplyManager creates on startup an
AbstractMessageListenerContainer. The concrete listener container is generally
a DefaultMessageListenerContainer which starts a new
AsyncMessageListenerInvoker Thread.
h3. OSGI Scenario
In an osgi envrironment this AsyncMessageListenerInvoker Thread has a class
loader reference to the bundle who is triggerd by the first processInOut method
call at the JmsProducer.
Let the calling bundle (A) be another bundle as bundle (B) which contains the
JmsProducer the AsyncMessageListenerInvoker Thread holds a class loader
reference to bundle (A).
Scenario:
* Bundle (A) calls a java service of Bundle (B)
* Bundle (B) sends a jms message
* Bundle (B) receives a response of the jms message
* Bundle (B) returns the java service call to Bundle (A)
h3. Problem
At this point everything is alright but when Bundle (A) is undeployed and
another Bundle (C) calls a java service of Bundle (B) the
AsyncMessageListenerInvoker Thread has a class loader problem.
h3. StackTrace
BundleImpl.loadClass(String) line: 926
BundleClassLoader.findClass(String) line: 176
BundleClassLoader.loadClass(String, boolean) line: 194
BundleClassLoader(ClassLoader).loadClass(String) line: 248
Class<T>.forName0(String, boolean, ClassLoader) line: not available [native
method]
Class<T>.forName(String, boolean, ClassLoader) line: 247
ClassLoadingAwareObjectInputStream.load(String, ClassLoader...) line: 77
ClassLoadingAwareObjectInputStream.resolveClass(ObjectStreamClass) line: 46
ClassLoadingAwareObjectInputStream(ObjectInputStream).readNonProxyDesc(boolean)
line: 1574
ClassLoadingAwareObjectInputStream(ObjectInputStream).readClassDesc(boolean)
line: 1495
ClassLoadingAwareObjectInputStream(ObjectInputStream).readOrdinaryObject(boolean)
line: 1731
ClassLoadingAwareObjectInputStream(ObjectInputStream).readObject0(boolean)
line: 1328
ClassLoadingAwareObjectInputStream(ObjectInputStream).readObject() line: 350
ActiveMQObjectMessage.getObject() line: 185
ActiveMQObjectMessage.toString() line: 226
MessageFormatter.safeObjectAppend(StringBuffer, Object) line: 304
MessageFormatter.deeplyAppendParameter(StringBuffer, Object, Map) line: 276
MessageFormatter.arrayFormat(String, Object[]) line: 230
MessageFormatter.format(String, Object, Object) line: 152
Slf4jLogger.debug(String, Object, Object) line: 300
PersistentQueueReplyManager(ReplyManagerSupport).onMessage(Message) line: 110
ExclusivePersistentQueueMessageListenerContainer(AbstractMessageListenerContainer).doInvokeListener(MessageListener,
Message) line: 560
ExclusivePersistentQueueMessageListenerContainer(AbstractMessageListenerContainer).invokeListener(Session,
Message) line: 498
ExclusivePersistentQueueMessageListenerContainer(AbstractMessageListenerContainer).doExecuteListener(Session,
Message) line: 467
ExclusivePersistentQueueMessageListenerContainer(AbstractPollingMessageListenerContainer).doReceiveAndExecute(Object,
Session, MessageConsumer, TransactionStatus) line: 325
ExclusivePersistentQueueMessageListenerContainer(AbstractPollingMessageListenerContainer).receiveAndExecute(Object,
Session, MessageConsumer) line: 263
DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener()
line: 1058
DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop()
line: 1050
DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run() line: 947
Thread.run() line: 662
h3. JMS Error
<suppressedExceptions
class="java.util.Collections$UnmodifiableRandomAccessList"
resolves-to="java.util.Collections$UnmodifiableList"><c class="list"/><list
reference="../c"/></suppressedExceptions><undeclaredThrowable
class="org.apache.camel.InvalidPayloadException"><detailMessage>No body
available of type: TransactionServiceResponse but has value: [B@7b9554f9 of
type: byte[] on: Message: <?xml version='1.0'
encoding='UTF-8'?><org.apache.camel.component.bean.BeanInvocation>&
--
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