Red Hat Bugzilla – Bug 1278218
JaxbMarshaller fails when executed from multiple threads
Last modified: 2015-11-04 20:48:27 EST
Created attachment 1089926 [details]
Maven project with test case that demonstrates failure.
Description of problem:
JaxbMarshaller is only storing a single Marshaller and Unmarshaller, which, per Java spec, are not thread-safe classes. This causes a multi-threaded client sending requests to kie-server to throw exceptions due to SaxParser being shared between threads.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create JaxbMarshaller.
2. Invoke marshall (or unmarshall) from multiple threads.
An exception will be thrown if parsers overlap.
All inputs should unmarshall or marshall, respectively.
This has been fixed in upstream under DROOLS-733, just needed to be merged in. If all changes from that commit are not wanted, then atleast the JAXB Marshaller/Unmarshaller instances must be created on demand to thread safety concerns.
The linked commit is already included in the upcoming product 6.2 release.
Closing the ticket as CURRENT_RELEASE. If this was meant for a different version, please clarify and reopen the ticket.