Problem background: Switchyard composite, WSDL interface as a service, inside bean component with java interface, between composite service and component service are autogenerated JAXB transformers. Camel file binding is used. When I put file in directory specified in file binding, it starts to process it and throws following exception: Caught exception of type java.lang.IllegalArgumentException with message: null: java.lang.IllegalArgumentException at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:109) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2] at org.switchyard.transform.jaxb.internal.JAXBUnmarshalTransformer.transform(JAXBUnmarshalTransformer.java:79) [switchyard-transform-0.8.1.Final.jar:0.8.1.Final] at org.switchyard.transform.jaxb.internal.JAXBUnmarshalTransformer.transform(JAXBUnmarshalTransformer.java:43) [switchyard-transform-0.8.1.Final.jar:0.8.1.Final] at org.switchyard.transform.TransformSequence.apply(TransformSequence.java:125) [switchyard-api-0.8.1.Final.jar:0.8.1.Final] at org.switchyard.transform.TransformSequence.applySequence(TransformSequence.java:213) [switchyard-api-0.8.1.Final.jar:0.8.1.Final] at org.switchyard.handlers.TransformHandler.handleMessage(TransformHandler.java:95) [switchyard-runtime-0.8.1.Final.jar:0.8.1.Final] at org.switchyard.bus.camel.processors.HandlerProcessor.process(HandlerProcessor.java:69) [switchyard-bus-camel-0.8.1.Final.jar:0.8.1.Final] at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) [camel-core-2.10.0.jar:2.10.0] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.10.0.jar:2.10.0] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) [camel-core-2.10.0.jar:2.10.0] . . . After diging in the code, I realized, that javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:109) expects SAXSource, DOMSource or StreamSource, but there is passed StAXSource. It seems that problem is in camel DefaultTypeConverter, which transforms the the message content into StAXSource. After several restarts of server I realized, that method BaseTypeConverterRegistry.getOrFindTypeConverter(Class<?> toType, Object value) sometimes returns DOMSource, sometimes StreamSource and sometimes problematic StAXSource. It probably depends on startup initialization of converter registry.
Jiri, can you please retest this with the ER6 release? Does the issue still exist?
I ran several times and no StaXSource passed anymore, just DOMSource, StreamSource and SAXSource, so I hope it's fixed. Marking as verified in ER6.
This issue still occurs. I have found it for ftp inbound binding. StAXSource is returned by java:java.io.ByteArrayInputStream -> java:javax.xml.transform.Source transformation and IllegalArgumentException is thrown in javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:109).
Could you please attach a reproducer application?
Created attachment 963848 [details] Reproducer I could finally create a reproducer. You have to set dir, host, username, password to ftp bindings (service, reference). Restart EAP many times, deploy and run the reproducer. You should see the issue.
I guess one option would be to add protective logic inside of JAXBUnmarshalTransformer to check for StAXSource and convert it directly to another acceptable Source type.
It seems we need to avoid letting camel convert to Source as it has some issues. Instead, just converting it to StreamSource directly solves the problem. I tested many times with it and no failure so far.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.