Bug 1032639 - There is no way how to define JAXB marshalling for commands In Spring Camel integration
There is no way how to define JAXB marshalling for commands In Spring Camel i...
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
Unspecified Unspecified
high Severity medium
: ER6
: 6.0.0
Assigned To: Marco Rietveld
Ivo Bek
Depends On:
  Show dependency treegraph
Reported: 2013-11-20 09:10 EST by Ivo Bek
Modified: 2016-09-20 01:05 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:19:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ivo Bek 2013-11-20 09:10:17 EST
Description of problem:

I have following REST server:

      <bean class="org.kie.jax.rs.CommandMessageBodyReader" />

for that I've created this camel route:

<route id="restJaxbGW">
  <from uri="cxfrs://bean://rsJaxbServer"/>
  <policy ref="kiePolicy">
    <unmarshal ref="jaxb" /> // here is the problem
    <to uri="kie:ksession1"/>
    <marshal ref="jaxb" />

The source code of KiePolicy counts on the jaxb. https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/kie-camel/src/main/java/org/kie/camel/component/KiePolicy.java#L154

When I run any request, I receive:

javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "null" doesnt contain ObjectFactory.class or jaxb.index

this is obvious because I should define something like:

  <jaxb id="jaxbCommands" prettyPrint="true" contextPath="org.drools.core.command"/>

but in the package "org.drools.core.command" there must be the jaxb.index or ObjectFactory as I understand. There should be the same classes as defined here https://github.com/droolsjbpm/droolsjbpm-integration/blob/6.0.x/kie-remote/kie-services-client/src/main/java/org/kie/services/client/serialization/jaxb/impl/JaxbCommandsRequest.java

It might be possible to have the classes just in the jaxb.index.
Comment 3 Ivo Bek 2013-11-20 09:19:06 EST
Actually it should be enough to have just the supported commands for Spring Camel integration in the jaxb.index somewhere.
Comment 7 Marco Rietveld 2013-12-06 09:20:02 EST
This problem has been fixed. However, I'm not completely sure that all JAXB problems with spring/camel integration have been fixed. 

Ivo, please keep up the good work and feel free to file more bugs dealing with these tests if the test still doesn't (completely) succeed after this fix. Running the tests locally, they all succeed except for zLastTestGlobalVariable(), but that seems to be caused by something else. 


Comment 8 Ivo Bek 2013-12-06 09:49:18 EST
Perfect, I'll look at it when we have a new build. The zLastTestGlobalVariable() test works with xstream, so it's interesting that it fails. I'd say it's because I send there more then one commands in one request but this is not the only test where I send more then one commands in one request, so it must be something different.
Comment 9 Ivo Bek 2014-01-08 10:38:36 EST
Verified in BPMS 6.0.0.ER7

The tests which did not work in JAXB were caused by own types. For this problem I filed BZ 1049979

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