Announcement Announcement Module
Collapse
No announcement yet.
Exception with HttpRemote Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception with HttpRemote

    Hi,

    I've been through everything I can find, but still can't seem to get this Http remoting to work - I always get a FileNotFoundException.

    I have in my web.xml:

    Code:
    <servlet> 
          <servlet-name>remoting</servlet-name> 
          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
          <load-on-startup>3</load-on-startup> 
       </servlet>    
       <servlet-mapping> 
          <servlet-name>remoting</servlet-name> 
          <url-pattern>/remoting/*</url-pattern> 
       </servlet-mapping>
    and in my remoting-servlet.xml:
    Code:
    <beans>
    	<!-- declare it using httpinvoker -->
    	<bean name="/DiscoveryService-httpInvoker" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
            <property name="service"><ref bean="discoveryServiceTarget"/></property>
            <property name="serviceInterface">
                <value>com.component.discovery.DiscoveryService</value>
            </property>
    	</bean>
    </beans>
    In my application_context.xml I have:
    Code:
    	<!-- service we're going to remote -->
    	<bean id="discoveryServiceTarget" class="com.component.discovery.DiscoveryServiceImpl">
    		<property name="quartzService">
    			<ref local="quartzService"/>
    		</property>
    	</bean>
    	
    	<!-- make available on "client" -->
    	<bean id="remoteDiscoveryService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    		<property name="serviceUrl">
    			<value>http&#58;//localhost&#58;8080/remoting/DiscoveryService-httpInvoker</value>
    		</property>
    		<property name="serviceInterface">
                <value>com.component.discovery.DiscoveryService</value>
    		</property>
    	</bean>
    but all to no avail!

    Can anyone please spot what I have done wrong - been banging my head on this for ages now!

    One thing, maybe, to note, is that this is all on one machine...

    cheers,

    David

  • #2
    In my application_context.xml I have:
    Are you expecting that file to be loaded automatically? If so then rename it to be
    Code:
    applicationContext.xml
    the capitalization is important (and the lack of an underscore )

    Comment


    • #3
      sorry - that was a typo in my post - of course, it's named applicationContext.xml!

      Can anyone see why the remote service can't be found?

      cheers,

      David

      Comment


      • #4
        I take it you have a quartzService defined somewhere? (although that wouldn't give you a file not found error).

        Its also unclear when you get that error. Is it when tomcat starts up? When the service interacts with the sevice on port 8080? Is that throwing the file not found error?

        Can you try and get this working in a junit test, taking tomcat out of the picture?

        Comment


        • #5
          Hi,

          Everything works fine (starts up etc)...except when I try and call remoteDiscoveryService from within my code - then it throws the following exception:

          org.springframework.remoting.RemoteAccessException : Cannot access HTTP invoker r
          emote service at [http://localhost:8080/remoting/Disco...-httpInvoker];
          nested exception is java.io.FileNotFoundException: http://localhost:8080/remotin
          g/DiscoveryService-httpInvoker

          Comment


          • #6
            Have you looked into if the call is going through to the server and the method you're calling is throwing the exception?

            Comment


            • #7
              Aggghhh - my bad. Turns out I'd left out the app name when I set up the remote address. I hate errors like that!

              cheers,

              David

              Comment

              Working...
              X