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

Set thread context class loader when starting camel-blueprint routes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 2.8.1, 2.9.0
    • camel-blueprint
    • None
    • Unknown

    Description

      When routes are getting started by the camel-blueprint component, the thread context classloader at that moment is the container's boot classloader. This is causing problems for e.g. ActiveMQ object messages that need to get deserialized, because the boot classloader is not aware of classes that might be available inside the container. The class used for reading the ActiveMQ object messages is http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStream.java.

      We can fix this by setting a more appropriate classloader as the thread context classloader while starting the CamelContext from a Blueprint definition. I see we also have a similar class in camel-jdbc and there are no doubt other libraries that depend on this classloader being set as well, so this change should help with all of those cases.

      Attachments

        Activity

          People

            gertvanthienen Gert Vanthienen
            gertvanthienen Gert Vanthienen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: