0

So very peculiar spring httpinvoker issue going on. I have a soap web service which is receiving test soap calls from soapUI which then calls another java service which is being exported via spring's httpinvoker proxy. This exporting end of the httpinvoker is unreachable because of the following exception:

enter image description here

I do not want to overwhelm people with huge walls of xml from my application context files, but if needed I can edit and post them. I have ensured that the server interface versions match up so I am not sure how this could be happening. Has anybody ever seen something like this, or have some suggestions as to where I can start looking for a solution?

EDIT: Stack trace in text form:

org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://localhost:8080/licensegen]; nested exception is java.io.StreamCorruptedException: invalid stream header: 3C68746D
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:212)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:145)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy192.getLicense(Unknown Source)
    at mypackage.service.soap.LicenseSOAPService.requestLicenses(LicenseSOAPService.java:99)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springframework.ws.server.endpoint.MethodEndpoint.invoke(MethodEndpoint.java:132)
    at org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter.invokeInternal(MarshallingMethodEndpointAdapter.java:140)
    at org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter.invoke(AbstractMethodEndpointAdapter.java:53)
    at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:231)
    at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:172)
    at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
    at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
    at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:221)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.StreamCorruptedException: invalid stream header: 3C68746D
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)
    at org.springframework.core.ConfigurableObjectInputStream.<init>(ConfigurableObjectInputStream.java:64)
    at org.springframework.core.ConfigurableObjectInputStream.<init>(ConfigurableObjectInputStream.java:50)
    at org.springframework.remoting.rmi.CodebaseAwareObjectInputStream.<init>(CodebaseAwareObjectInputStream.java:81)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.createObjectInputStream(AbstractHttpInvokerRequestExecutor.java:271)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.readRemoteInvocationResult(AbstractHttpInvokerRequestExecutor.java:239)
    at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.doExecuteRequest(SimpleHttpInvokerRequestExecutor.java:95)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:136)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:192)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:174)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:142)
    ... 45 more

Here is a screenshot of the actual http request/response from my soap service to my service being exposed through Spring's httpinvokerserviceexporter.

enter image description here

thatidiotguy
  • 8,701
  • 13
  • 60
  • 105
  • At least paste the stack trace properly, and not as a screen shot. – skaffman Feb 07 '12 at 09:17
  • I thought it was a bit more readable since there was no need for a scroll pane, but there ya go! :/ – thatidiotguy Feb 07 '12 at 14:28
  • It's all about making the question searchable by google et al. Not much use to the community if it's hidden away in a screenshot. – skaffman Feb 07 '12 at 14:32
  • Do you use Object serialization somewhere (ObjectOutputStream or similar) ? – ndeverge Feb 07 '12 at 14:40
  • No, I am using plain old java serialization through Spring's remoting service (HttpInvokerProxy). I do not doubt that java's serialization uses ObjectOutputStream, but no where am I directly using it at all. – thatidiotguy Feb 07 '12 at 14:50
  • 1
    This happened to me once when I was accidentally using different version of the Spring library on each end. You've said "the server interface versions match up" - do you mean your interface, or Spring's? – artbristol Feb 07 '12 at 15:13
  • I meant my service interface, but let me look into your suggestion. – thatidiotguy Feb 07 '12 at 15:17
  • 1
    hmm, looked at my war files, same version of spring library classes found in both. I definitely seems to me that it is a problem with different classes not being the same version, but I cannot figure out how this can be. Thanks for all the suggestions so far! – thatidiotguy Feb 07 '12 at 15:42
  • Added, http request information. Not sure how this 301 response is happening.... – thatidiotguy Feb 07 '12 at 16:38

2 Answers2

1

Ended up being a classpath issue as suggested by those above in the comments.

thatidiotguy
  • 8,701
  • 13
  • 60
  • 105
0

For me the problem was authentication issue. I was providing a wrong user and password when calling the httpinvoker

Morad
  • 2,761
  • 21
  • 29