mule - How do you configure a method-entry-point-resolver for a method with InboundHeader annotations in a java component? -


i have following component defined in flow:

  <component doc:name="graduationservice">       <method-entry-point-resolver>           <include-entry-point method="getgraduationdateswithpidmorstudentid"/>       </method-entry-point-resolver>       <spring-object bean="graduationservice" />   </component> 

i trying call 'getgraduationdateswithpidmorstudentid' method defined in 'graduationservice' bean. here method signature looks like:

public object getgraduationdateswithpidmorstudentid(@payload payload payload,     @inboundheaders("studentid") string studentid,      @inboundheaders("pidm") string pidm ) {  ....... } 

i getting following error:

message               : failed find entry point component, following resolvers tried failed: [ explicitmethodentrypointresolver: not find entry point on: "edu.ucdavis.iet.apis.students.graduation.service.graduationservice" arguments: "{class java.lang.string}" ] code                  : mule_error-321 -------------------------------------------------------------------------------- exception stack is: 1. failed find entry point component, following resolvers tried failed: [ explicitmethodentrypointresolver: not find entry point on: "edu.ucdavis.iet.apis.students.graduation.service.graduationservice" arguments: "{class java.lang.string}" ] (org.mule.model.resolvers.entrypointnotfoundexception)   org.mule.model.resolvers.defaultentrypointresolverset:49 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/model/resolvers/entrypointnotfoundexception.html) -------------------------------------------------------------------------------- root exception stack trace: org.mule.model.resolvers.entrypointnotfoundexception: failed find entry point component, following resolvers tried failed: [ explicitmethodentrypointresolver: not find entry point on: "edu.ucdavis.iet.apis.students.graduation.service.graduationservice" arguments: "{class java.lang.string}" ]     @ org.mule.model.resolvers.defaultentrypointresolverset.invoke(defaultentrypointresolverset.java:49)     @ org.mule.component.defaultcomponentlifecycleadapter.invoke(defaultcomponentlifecycleadapter.java:339)     @ org.mule.component.abstractjavacomponent.invokecomponentinstance(abstractjavacomponent.java:82)     + 3 more (set debug level logging or '-dmule.verbose.exceptions=true' everything) ******************************************************************************** 

if remove annotations inboundheaders , change '@payload payload payload' '@payload string payload', can't @ least resolve method. don't seem understand how @inboundheader annotations supposed work, then.

when working annotations don't need set entry point resolver use annotatedentrypointresolver under hood.

so following work:

public object getgraduationdateswithpidmorstudentid(@payload string payload,     @inboundheaders("studentid") string studentid,      @inboundheaders("pidm") string pidm ) {  ....... } 

and:

<component doc:name="graduationservice">      <spring-object bean="graduationservice" /> </component> 

also can set using:

<component>    <custom-entry-point-resolver class="org.mule.impl.model.resolvers.annotatedentrypointresolver" />    <spring-object bean="graduationservice" /> </component> 

also note don't need set payload instance of payload. mule try , transform payload match parameter type.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -