Announcement Announcement Module
Collapse
No announcement yet.
..RemoteAccessException: Could not access HTTP invoker remote service at [http://...] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ..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, 07:00 AM.

  • #2
    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..

    Comment


    • #3
      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?

      Comment


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

        Comment


        • #5
          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.

          Comment


          • #6
            thank you so much.. i'll post here my findings..

            Comment


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

              please guide me... thanks

              Comment


              • #8
                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.

                Comment


                • #9
                  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..

                  Comment


                  • #10
                    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"/>

                    Comment


                    • #11
                      hi,

                      I face the same problem than Eros.

                      it's also unclear in wich context must be delcared the beans
                      the xml file of contextloaderlistener
                      of the one bound to the DispatcherServlet

                      Comment

                      Working...
                      X