[ https://issues.apache.org/jira/browse/CAMEL-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972591#action_12972591 ]
xuhongbo commented on CAMEL-3438: --------------------------------- Hi ,Clause I don't think so. I aggree the camel-jaxb component should not dependency to spring But I don't agree "manageing context classLoader" is a trivial things in osgi; J2EE will managed the context class loader carefully. But osgi doesn't. the osgi specification(expect osgi-enterprise) doesn't give any rules about thread's context class loader; if you check spring-dm 's reference, even spring-dm just give rules of context class loader for osgi-services configured by spring ; and doesn't give any rules for other situation; so the thread context will act as jdk default behavior, "inherit parent thread's context class Loader", so that's to say: 1) thread context class loader is leaved as unmanaged in standard osgi environment; 2) it dependency the thread is how created; So camel should managed context class loader carefully, otherwise, it hardly to use in standard osgi . servicemix 4 is a standard osgi environment too; > JAXBDataFormatter should using Spring ApplicationContext's classLoader > explicitly > --------------------------------------------------------------------------------- > > Key: CAMEL-3438 > URL: https://issues.apache.org/jira/browse/CAMEL-3438 > Project: Camel > Issue Type: Bug > Affects Versions: 2.4.0 > Reporter: xuhongbo > Attachments: JaxbDataFormat.java > > > 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.