Hi all,
I try to run a http invoker gateway as a front-end for my spring integration bus. My client application see a Java interface, let's call it ContractService, with a method in this interface called getContract(String id).
When I configure a HttpInvoker Inbound Gateway like this :
I end up with a NoSuchMethodException exception :HTML Code:<httpinvoker:inbound-gateway id="inboundGateway" request-channel="getContractRequestChannel" reply-channel="contractChannel" request-timeout="30000" reply-timeout="10000" />
Normal, you would say, as I define nowhere the ContractService interface...Code:org.springframework.remoting.RemoteInvocationFailureException: Invocation of method [public abstract java.lang.Object org.springframework.integration.gateway.MessagingGateway.sendAndReceive(java.lang.Object)] failed in HTTP invoker remote service at [localhost:8080/MyCompanyBus/inboundGateway]; nested exception is java.lang.NoSuchMethodException: $Proxy2.sendAndReceive(java.lang.Object) at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:154)
I tried to replace, from the client point of view, the ContractService interface with the org.springframework.integration.gateway.MessagingG ateway and invoke the sendAndReceive(Object) method, as the gateway implement that interface, and I end up with the same exception.
The only way I succeed is when defining an HttpInvokerServiceExporter with the business interface :
And to redirect internally into a SimpleMessagingGateway.HTML Code:<beans:bean name="inboundGateway" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter"> <beans:property name="service" ref="contractServiceGateway"/> <beans:property name="serviceInterface" value="com.mycompany.bus.service.ContractService"/> </beans:bean>
So what is the correct way to use the HttpInvokerGateway ? why do I receive the NoSuchMethodException ?
Thanks for your help,
Jérémie Grodziski.
P.S : the client configuration is right, as the exception is thrown from the server side.


Reply With Quote
