Bug 1278218 - JaxbMarshaller fails when executed from multiple threads
JaxbMarshaller fails when executed from multiple threads
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Kie-Server (Show other bugs)
6.2.0
All All
unspecified Severity unspecified
: ---
: ---
Assigned To: Edson Tirelli
Karel Suta
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-04 19:26 EST by Andrew Collins
Modified: 2015-11-04 20:48 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-04 20:48:27 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Andrew Collins 2015-11-04 19:26:46 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):
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-04 20:48:27 EST
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.