camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "xuhongbo (JIRA)" <>
Subject [jira] Commented: (CAMEL-3438) JAXBDataFormatter should using Spring ApplicationContext's classLoader explicitly
Date Sat, 18 Dec 2010 04:13:01 GMT


xuhongbo commented on CAMEL-3438:


Could the DataFormatter interface add a initialize method? it need's no arguments. just plain
init () method;
if so, we could prepare the jaxb context at initializing time, but not at executing time(because
at executing time to create jaxb context , will be unexpected)

If camel doesn't accept , it's unfortunally.
 this means I cannot using jaxb databinding in osgi safely. etc: if I using a global OSGI
ThreadPoolExecutor service to serve as the threadpool for camel components, then jaxb convert
will failed; (because  threads of ThreadPoolExecutor is not always created in the correct

if you check the mail-list in the community, you will find such bug is reported by the other
user, not only mine; you can find it by the topic (" Help with Camel JAXB (SMX4 + Camel 2.1.0)").
the mail is sent very earlier; The original mail illustrate two route, one route start by
file component, jaxb will work right; while another route started by "direct" endpoint, it
will failed.
 I think the reason is file component's thread is created in the spring context loading time,
so it inherit the spring extender thread's context class loader.  while the direct endpoint's
belong to another user created thread, it's context class loader is not correct, so jaxb will

> JAXBDataFormatter should using Spring ApplicationContext's classLoader explicitly
> ---------------------------------------------------------------------------------
>                 Key: CAMEL-3438
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: xuhongbo
>         Attachments:
> JAXBDataFormatter now using JAXBContext.newInstance(path) to create JAXBContext,
> but this will using Thread's context classLoader.
> this may causing un-expected class or resource not found exceptions;

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message