Red Hat Bugzilla – Bug 1032639
There is no way how to define JAXB marshalling for commands In Spring Camel integration
Last modified: 2016-09-20 01:05:11 EDT
Description of problem:
I have following REST server:
<bean class="org.kie.jax.rs.CommandMessageBodyReader" />
for that I've created this camel route:
<unmarshal ref="jaxb" /> // here is the problem
<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.
Actually it should be enough to have just the supported commands for Spring Camel integration in the jaxb.index somewhere.
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.
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.
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