-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jaxb integration test #515
Conversation
}).log("Will marshal: ${body}") | ||
.marshal("jaxbBean") | ||
.log("Marshal: ${body}") | ||
.toF("mock:%s", getResultMockName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that you could keep only the mock.expectedBodiesReceived(JSON_SAMPLE);
<bundle dependency="true">mvn:com.sun.istack/istack-commons-runtime/${auto-detect-version}</bundle> | ||
<bundle dependency="true">mvn:org.glassfish.jaxb/jaxb-core/${glassfish-jaxb-runtime-version}</bundle> | ||
<bundle dependency='true'>mvn:org.glassfish.jaxb/jaxb-runtime/${glassfish-jaxb-runtime-version}</bundle> | ||
<bundle>mvn:org.glassfish.hk2/osgi-resource-locator/${osgi-resource-locator-version}</bundle> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camel-jaxb
+ @XmlRootElement
refuse to work without org.glassfish.jaxb/jaxb-runtime
.
According to the last item, "Preferred JAX-B implementation", in https://camel.apache.org/manual/camel-4x-upgrade-guide-4_8.html we should use glassfish
.
Ref to the libraries added: https://central.sonatype.com/artifact/org.glassfish.jaxb/jaxb-core/4.0.5. org.glassfish.hk2/osgi-resource-locator
appears to be the equivalent of com.sun.xml.bind/jaxb-osgi
.
I'm not sure if I'm still missing something, because in the jaxb test I seeing this log:
2024-09-30T20:12:43,861 | INFO | RMI TCP Connection(4)-127.0.0.1 | StaxConverter | 70 - camel-xml-jaxp - 4.8.0.SNAPSHOT | Created XMLInputFactory: com.sun.xml.internal.stream.XMLInputFactoryImpl@3af22731. DOMSource/DOMResult may have issues with com.sun.xml.internal.stream.XMLInputFactoryImpl@3af22731. We suggest using **Woodstox.**
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In regards to the log warning, it is coming from https://github.com/apache/camel/blob/8337effdb43b4447265d28303c82f1d929b72e82/core/camel-xml-jaxp/src/main/java/org/apache/camel/converter/jaxp/StaxConverter.java#L330
UPDATE: François committed a fix 🥇
@@ -1617,6 +1618,7 @@ | |||
<bundle>mvn:org.apache.camel.karaf/camel-javascript/${project.version}</bundle> | |||
</feature> | |||
<feature name='camel-jaxb' version='${project.version}' start-level='50'> | |||
<feature prerequisite="true">spifly</feature> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added to fix the warning from https://github.com/apache/camel-karaf/pull/515/files#r1782774809.
A consequence of adding this is that the test works fine without the changes mentioned here https://github.com/apache/camel-karaf/pull/515/files#r1781629096
9a360e8
to
b2afeef
Compare
tests/features/camel-jaxb/src/test/java/org/apache/karaf/camel/itest/CamelJaxbITest.java
Outdated
Show resolved
Hide resolved
…/itest/CamelJaxbITest.java
tests/features/camel-jaxb/src/test/java/org/apache/karaf/camel/itest/CamelJaxbITest.java
Outdated
Show resolved
Hide resolved
…/itest/CamelJaxbITest.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #514: Add an integration test for camel-jaxb and fix the feature if needed