[ https://issues.apache.org/activemq/browse/CAMEL-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-1401. -------------------------------- Resolution: Fixed Trunk: Committed revision 748436. 1.x: Committed revision 748450. > JaxbDataFormat is not thread-safe > --------------------------------- > > Key: CAMEL-1401 > URL: https://issues.apache.org/activemq/browse/CAMEL-1401 > Project: Apache Camel > Issue Type: Bug > Components: camel-jaxb > Affects Versions: 1.5.0, 1.6.0 > Reporter: Ivan S. Dubrov > Assignee: Claus Ibsen > Priority: Critical > Fix For: 2.0.0, 1.6.1 > > > JaxbDataFormat reuses the Marshaller/Unmarshaller instances. > However, according to the > https://jaxb.dev.java.net/faq/index.html#threadSafety, > Marshaller/Unmarshaller instances are NOT thread safe, so you can't use them > from separate threads at the same time. > Due to this we are getting exceptions from the JAXB implementation (like > ClassCastException or "org.xml.sax.SAXException: FWK005 parse may not be > called while parsing."). Everything works nice with our custom JaxbDataFormat > that creates new Unmarshaller/Marshaller instance on every request. > Also, lazy-creating instances (like JAXBContext) in getter methods is not > thread-safe as well (because explicit synchronization is required). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.