Route not working under Container - Cxf Paylod Type Conversion issue

One Star

Route not working under Container - Cxf Paylod Type Conversion issue

Hi all,
In the last years I have used the ETL version of the Talend platform and I have been greatly satisfied with its potential and its ease of use.
I am now in the process of evaluating and testing the Talend ESB platform to see if it could be a good solution to our needs.
So long I have been really pleased with the tool but I am now stuck with a problem I cannot find a solution for.
I have a quite complex route which exposes a Cxf SOAP WS as entry point. During its lifecycle it consumes a series of external WS, invokes several Talend jobs and handles errors which can occur during the entire process.
When the route is running inside the Talend Open Studio everything works fine, but once it is deployed under the ESB Container an exception is thrown few moments after the receiving of an XML request message.
" org.apache.camel.RuntimeCamelException: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.cxf.CxfPayload to the required type: org.w3c.dom.Document "
Same route, same ESB Container version bundled with the Studio version I am using, same XML request message, same client invoking the route, same machine running both the Container and the Studio.
I have investigated the problem and it seems that the CxfConverter and CxfPayloadConverter classes are not loaded in the Container.
TRACE log from the route deployed within the container:
* Searching for META-INF/services/org/apache/camel/TypeConverter services
* Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve list of packages, from url: bundleresource://178.fwk25078403/META-INF/services/org/apache/camel/TypeConverter
* No additional package names found in classpath for annotated type converters.
* Loaded 172 type converters
TRACE log from the route deployed within the Studio:
* Searching for META-INF/services/org/apache/camel/TypeConverter services
* Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve list of packages, from url: jar:file:/C:/talend5/Studio/workspace/.Java/lib/camel-core-2.10.4.jar!/META-INF/services/org/apache/camel/TypeConverter
* Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve list of packages, from url: jar:file:/C:/talend5/Studio/workspace/.Java/lib/camel-cxf-alldep-2.10.4.jar!/META-INF/services/org/apache/camel/TypeConverter
* Loaded org.apache.camel.component.cxf.converter.CxfConverter as class class org.apache.camel.component.cxf.converter.CxfConverter
* Loaded org.apache.camel.component.cxf.converter.CxfPayloadConverter as class class org.apache.camel.component.cxf.converter.CxfPayloadConverter
* Loaded 2 @Converter classes
* Loading converter class: org.apache.camel.component.cxf.converter.CxfConverter
..
* Loading converter class: org.apache.camel.component.cxf.converter.CxfPayloadConverter
..
* Loaded 186 type converters
I have investigated the problem and according to http://camel.apache.org/type-converter.html everything seems fine.
The camel-cxf package is correctly located under container/system.
It correctly has the TypeConversion file under META-INF/services/org/apache/camel/ containing the CxfConverter and the CxfPayloadConverter packages to be loaded as converters.
I can see it also under container/data/cache/.. in the bundle number 184 but only the number 178 seems to be loaded at runtime (according to the log).
Moreover the route I am deploying has a dependency for the said package (org.apache.camel.camel-cxf).
I am using Talend Open Studio for ESB v5.3 (r101800-20130424-0432) in a machine running under Win 7 and Java SDK v1.7.
Even with a simple test route I am having the same problem once it is deployed under the Container.
Any kind of help is really appreciated. I do not know what else I can do to fix the issue.
Thanks in advance.
Employee

Re: Route not working under Container - Cxf Paylod Type Conversion issue

Hi Gejnlasv
A few questions. First, just to make sure, what type of binding are you using? POJO, Message, Payload, Raw? I am assuming Payload.
Second, can you perhaps duplicate with a simple stub and post it to this forum? That would be preferable, but a screenshot of the route at a minimum would be good.
Third, is this problem occuring for the WS that you are exposing, or when you are invoking one of the other WS that you are composing? I suspect it is for the latter. You may try setting the request message for these WS invocations to be empty before invoking them. A frequent mistake is to just continue using the same message object, forgetting that some of the camel headers in the message will be sent to the other WS as SOAP headers (whether desired or not). this may or may not be the case for you, since after all your route is working in the studio. But always good to check.
One Star

Re: Route not working under Container - Cxf Paylod Type Conversion issue

Hi eost,
thanks for your help.
First, just to make sure, what type of binding are you using? POJO, Message, Payload, Raw? I am assuming Payload.

I am using payload mode trought the whole route.
Second, can you perhaps duplicate with a simple stub and post it to this forum? That would be preferable, but a screenshot of the route at a minimum would be good.

Sure. I am sending you the whole route.
Actually a very simple stub of it works when deployed in the container, although the same issue is shown (the Cxf type converters are not loaded). Simply the NoTypeConversionAvailableException is not thrown. I am not using any kind of specific conversion during the whole route, it happens in a point of the code which is hidden and unreacheable to me.
When the route starts to get a bit complex the exception is thrown just few moments after the invocation of the first component.
Third, is this problem occuring for the WS that you are exposing, or when you are invoking one of the other WS that you are composing? I suspect it is for the latter. You may try setting the request message for these WS invocations to be empty before invoking them. A frequent mistake is to just continue using the same message object, forgetting that some of the camel headers in the message will be sent to the other WS as SOAP headers (whether desired or not). this may or may not be the case for you, since after all your route is working in the studio. But always good to check.

I am quite sure the problem occurs for the WS I am exposing. It happens just few moments after the receiving of the request message and the operations which have to be executed immediately after are not performed.
Anyway the message I am using to consume the external Web Services is the same I am receiving (up to now I have not implemented any transformation and the services I am consuming are just stub responding accordingly).
The problem happens also if I delete the external WS from the route.

Thanks in advance.
One Star

Re: Route not working under Container - Cxf Paylod Type Conversion issue

Hi,
We are having similar issue. Could you please let me know, If the problem was resolved? If so, how was it resolved?
Best Regards
Srihari