Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6459

ReplyManager holds a reference to the first calling Bundle classloader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.4
    • 2.10.7, 2.11.2, 2.12.0
    • camel-jms
    • None
    • Apache karaf 2.3.1

    • Unknown

    Description

      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.

      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)

      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.

      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

      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>&

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            hbmann Hauke Rabe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: