Announcement Announcement Module
Collapse
No announcement yet.
Http Invoker Gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Http Invoker Gateway

    I used http invoker gateway in my project. I configured it as follows:
    in web configuration file web.xml:
    Code:
    ......
    <servlet>
        <servlet-name>remoting</servlet-name>
        <servlet-class>
            org.springframework.web.context.support.HttpRequestHandlerServlet
        </servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>remoting</servlet-name>
        <url-pattern>/proxy</url-pattern>
    </servlet-mapping>
    ......
    in spring integration configuration file spring-integration-demo.xml:
    Code:
    ......
    <httpinvoker-handler id="orderTarget"	url="http:/localhost:8080/proxy" />
    <channel id="orderChannel" />
    <channel id="cafeChannel" />
    <httpinvoker-gateway id="remoting" request-channel="orderChannel" reply-channel="cafeChannel" expect-reply="true" />
    ......
    My purpose was to access http invoker gateway through http invoker hander. When I run it, it throwed an exception as follows:
    Code:
    org.springframework.integration.message.MessageHandlingException: unable to handle message remotely
    	at org.springframework.integration.adapter.AbstractRemotingHandler.handle(AbstractRemotingHandler.java:53)
    	at org.springframework.integration.endpoint.DefaultEndpoint.doHandleRequestMessage(DefaultEndpoint.java:179)
    	at org.springframework.integration.endpoint.DefaultEndpoint.handleRequestMessage(DefaultEndpoint.java:119)
    	at org.springframework.integration.endpoint.AbstractRequestReplyEndpoint.sendInternal(AbstractRequestReplyEndpoint.java:64)
    	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:111)
    	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
    	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
    	at org.springframework.integration.dispatcher.AbstractDispatcher.sendMessageToTarget(AbstractDispatcher.java:75)
    	at org.springframework.integration.dispatcher.SimpleDispatcher.send(SimpleDispatcher.java:48)
    	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
    	at org.springframework.integration.message.MessageExchangeTemplate.doReceiveAndForward(MessageExchangeTemplate.java:235)
    	at org.springframework.integration.message.MessageExchangeTemplate.receiveAndForward(MessageExchangeTemplate.java:191)
    	at org.springframework.integration.dispatcher.PollingDispatcher.run(PollingDispatcher.java:127)
    	at org.springframework.integration.scheduling.spi.ProviderTaskScheduler$TaskRunner.run(ProviderTaskScheduler.java:221)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:65)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:168)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:595)
    Caused by: org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http:/localhost:8080/proxy];
    nested exception is java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.integration.channel.QueueChannel
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:211)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:144)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    	at $Proxy0.handle(Unknown Source)
    	at org.springframework.integration.adapter.AbstractRemotingHandler.handle(AbstractRemotingHandler.java:50)
    	... 21 more
    Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.integration.channel.QueueChannel
    	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1309)
    	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
    	at java.util.HashMap.readObject(HashMap.java:1067)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
    	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
                 ......
    	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
    	at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.doReadRemoteInvocationResult(AbstractHttpInvokerRequestExecutor.java:287)
    	at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.readRemoteInvocationResult(AbstractHttpInvokerRequestExecutor.java:240)
    	at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.doExecuteRequest(SimpleHttpInvokerRequestExecutor.java:65)
    	at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:134)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:191)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:173)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:141)
    	... 25 more
    Caused by: java.io.NotSerializableException: org.springframework.integration.channel.QueueChannel
    	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
    	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
    	at java.util.HashMap.writeObject(HashMap.java:1039)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
                 ......
    	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
    	at org.springframework.remoting.rmi.RemoteInvocationSerializingExporter.doWriteRemoteInvocationResult(RemoteInvocationSerializingExporter.java:158)
    	at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.writeRemoteInvocationResult(HttpInvokerServiceExporter.java:174)
    	at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.writeRemoteInvocationResult(HttpInvokerServiceExporter.java:150)
    	at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:75)
    	at org.springframework.integration.adapter.httpinvoker.HttpInvokerGateway.handleRequest(HttpInvokerGateway.java:85)
    	at org.springframework.web.context.support.HttpRequestHandlerServlet.service(HttpRequestHandlerServlet.java:63)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    	... 1 more
    Did I misuse the http invoker gateway and http invoker handler, or any other problems? Could you give a sample to demonstrate how to use them?
    Last edited by zjulyy; Oct 29th, 2008, 11:04 AM.
Working...
X