Tuesday, 15 September 2015

java - Polling HTTP endpoint followed by jersey REST WS does not work in Mule 3.5 -



java - Polling HTTP endpoint followed by jersey REST WS does not work in Mule 3.5 -

i have requirement need poll rest service , proxy response web service on rest web service.

i using mule 3.5 , flow looks below.

i below exception rest service beingness invoked

******************************************************************************** message : failed invoke jerseyresourcescomponent{testflow.component.1106552446}. component caused exception is: jerseyresourcescomponent{testflow.component.1106552446}. message payload of type: string code : mule_error--2 -------------------------------------------------------------------------------- exception stack is: 1. null (java.lang.nullpointerexception) org.mule.module.jersey.jerseyresourcescomponent:192 (null) 2. failed invoke jerseyresourcescomponent{testflow.component.1106552446}. component caused exception is: jerseyresourcescomponent{testflow.component.1106552446}. message payload of type: string (org.mule.component.componentexception) org.mule.component.abstractcomponent:144 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/component/componentexception.html) -------------------------------------------------------------------------------- root exception stack trace: java.lang.nullpointerexception @ org.mule.module.jersey.jerseyresourcescomponent.getbaseuri(jerseyresourcescomponent.java:192) @ org.mule.module.jersey.jerseyresourcescomponent.doinvoke(jerseyresourcescomponent.java:146) @ org.mule.component.abstractcomponent.invokeinternal(abstractcomponent.java:122) + 3 more (set debug level logging or '-dmule.verbose.exceptions=true' everything) ********************************************************************************

after debugging figured out because mule expects mulemessage inbound property contextpath populated in case null.

in jerseyresourcescomponent line 117 returned null , hence line 195 throws npe.

i wanted know if kind of requirement/pattern invalid or kind of limitation in way mule handling messaging infrastructure ?

the flow xml in case want inspect it.

<flow name="testflow" doc:name="testflow"> <poll doc:name="poll"> <fixed-frequency-scheduler frequency="10" timeunit="seconds" startdelay="10"/> <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" doc:name="order generator" method="get" contenttype="application/json" path="order"/> </poll> <object-to-string-transformer doc:name="object string"/> <jersey:resources doc:name="tax calculator"> <component class="org.nthdimenzion.taxcalculator"/> </jersey:resources> <logger level="info" doc:name="logger"/> </flow>

ps : work around got utilize java/spring component instead of rest ws , phone call rest ws java component.

java web-services mule

No comments:

Post a Comment