Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: ..RemoteAccessException: Could not access HTTP invoker remote service at [http://...]

  1. #1
    Join Date
    Oct 2008
    Posts
    286

    Default ..RemoteAccessException: Could not access HTTP invoker remote service at [http://...]

    here's the error messages that I'm receiving when I run my client spring app.
    Code:
    Exception in thread "main" org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://localhost:8032/webproj/app/getRemoteResult]; nested exception is java.io.StreamCorruptedException: invalid stream header: 0D0A0D0A
    	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.setHello(Unknown Source)
    	at xyz.HelloClient.main(HelloClient.java:19)
    Caused by: java.io.StreamCorruptedException: invalid stream header: 0D0A0D0A
    	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
    from here, server's side configs
    Code:
    	<!-- Maps flow requests from DispatcherServlet to flowController -->
    	<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    			<value>
                    <![CDATA[
    				/app/remoting/getRemoteResult=httpHelloService
                    ]]>
    			</value>
    		</property>
    		<property name="alwaysUseFullPath" value="true"></property>
    		<property name="order" value="0"/>
    	</bean>
    
    	<bean id="httpHelloService" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
    		<property name="service" ref="helloService"></property>
    		<property name="serviceInterface" value="xyz.service.simulation.HelloService"></property>
    	</bean>
    	
    	<bean id="helloService" 
    		class="xyz.service.simulation.impl.HelloServiceImpl">
    	</bean>
    from here, client's side configs
    Code:
    	<bean id="helloservice" 
    		class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    		<property name="serviceUrl" value="http://localhost:8032/webproj/app/remoting/getRemoteResult"></property>
    		<property name="serviceInterface" value="xyz.client.service.HelloService"></property>
    	</bean>
    please guide me on how to use spring remoting..
    right now, I am testing my small java application by running from eclipse ide.. but...
    my ultimate goal is create a jar to call via applet in my webapp to output a graph create from jfreechart..
    Last edited by eros; May 23rd, 2010 at 07:00 AM.
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  2. #2
    Join Date
    Oct 2008
    Posts
    286

    Default

    by the way, web app implemented Spring Security 2.0.5...

    then I tried to configured my filters at security context
    Code:
    <security:intercept-url pattern="/app/remoting/**" filters="none"/>
    then still error...

    please tell me if it is related with the error..

    thanks..
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  3. #3
    Join Date
    Oct 2008
    Posts
    286

    Default

    i think the below error message is irrelevant but....let me to post it here also..

    then when I tried to copy and paste the serviceUrl directly to web browser...
    I received the below error message.

    Code:
    javax.servlet.ServletException: No adapter for handler [org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter@dac829]: Does your handler implement a supported interface like Controller?
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  4. #4
    Join Date
    Oct 2008
    Posts
    286

    Default

    any ideas or hints... what does it mean guys? i followed the instructions in spring reference...
    ahmm...don't have any ideas...
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  5. #5
    Join Date
    Mar 2010
    Location
    Boston, MA
    Posts
    316

    Default

    I havent worked much with remoting..but one thing that has been invaluable for me in tracking down http errors is to find out and analyze what is actually being transmitted over the wire..try to get a httpanalyzer tool and see what the request and response looks like..maybe the request is malformed(or maybe the endpoint doesnt like the request)..one good http analyzer which i have used is httpfox which is a plugin for firefox.

  6. #6
    Join Date
    Oct 2008
    Posts
    286

    Default

    thank you so much.. i'll post here my findings..
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  7. #7
    Join Date
    Oct 2008
    Posts
    286

    Default

    don't understand the tool...on how to confirm of what is going on....

    please guide me... thanks
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  8. #8
    Join Date
    Mar 2010
    Location
    Boston, MA
    Posts
    316

    Default

    Once you install it, click on the green start button to start recording all HTTP traffic going through your browser, check the request/response/headers/cookies etc to see whats going on, look for 404s, 500s etc in the response (if you are not comfortable with the HTTP stack i suggest going through this first http://www.w3.org/Protocols/rfc2616/rfc2616). Couple of other things you can do as well..try hitting this http://localhost:8032/webproj/app/getRemoteResult directly from a browser, see what happens. Another thing what you can do is get the source for org.springframework.remoting.httpinvoker.HttpInvok erClientInterceptor.convertHttpInvokerAccessExcept ion and see if you can spot anything.

  9. #9
    Join Date
    Oct 2008
    Posts
    286

    Default

    thanks a lot..

    can't understand the figures and messages appeared on the tool...
    due to lack of basic knowledge in remote services and using the tool....

    i think, need to read more document before to proceed..

    by the way, too strange because I successfully trigger the service using the alternative way... by adding another servlet in web.xml

    here's the settings:
    web.xml
    Code:
      <servlet>
        <servlet-name>helloServiceExporter</servlet-name>
        <servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
      </servlet>
      
      <servlet-mapping>
        <servlet-name>helloServiceExporter</servlet-name>
        <url-pattern>/remoting/HelloService</url-pattern>
      </servlet-mapping>
    applicationContext.xml
    Code:
    	<bean id="helloService" class="xyz.service.simulation.impl.HelloServiceImpl"></bean>
    	
    	<bean name="helloServiceExporter" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
    		<property name="service" ref="helloService"></property>
    		<property name="serviceInterface" value="xyz.service.simulation.HelloService"></property>
    	</bean>
    client spring-config.xml
    Code:
    	<bean id="helloservice2"
    		class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    		 <property name="serviceUrl" value="http://localhost:8032/webproj/remoting/HelloService"></property>
    		<property name="serviceInterface" value="xyz.service.simulation.HelloService"></property>
    	</bean>

    but still yet solved the problem using the first method...(adding in URLMapping)

    anyone knows my mistake with the first one... please post it here also..

    thanks..
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  10. #10
    Join Date
    Mar 2010
    Location
    Boston, MA
    Posts
    316

    Default

    If you are using annotation based controllers..Try defining a annotation handler..

    Code:
    <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
    
        <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •