Bug 1278218 - JaxbMarshaller fails when executed from multiple threads
Summary: JaxbMarshaller fails when executed from multiple threads
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Kie-Server
Version: 6.2.0
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Edson Tirelli
QA Contact: Karel Suta
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-05 00:26 UTC by Andrew Collins
Modified: 2015-11-05 01:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-05 01:48:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Maven project with test case that demonstrates failure. (2.58 KB, application/zip)
2015-11-05 00:26 UTC, Andrew Collins
no flags Details

Description Andrew Collins 2015-11-05 00:26:46 UTC
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):
BRMS 6.1.4
* kie-server-api-6.2.0.Final-redhat-13

How reproducible:
Every time.


Steps to Reproduce:
1. Create JaxbMarshaller.
2. Invoke marshall (or unmarshall) from multiple threads.

Actual results:
An exception will be thrown if parsers overlap.


Expected results:
All inputs should unmarshall or marshall, respectively.


Additional info:
This has been fixed in upstream[1] 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.

[1]: https://github.com/droolsjbpm/droolsjbpm-integration/commit/c4ea208dbee4778188609a9aa605e8d9dca412f8

Comment 2 Edson Tirelli 2015-11-05 01:48:27 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.