I've been reading about the new HttpInvoker and thought I'd give it a try. I ran the example in jpetstore and decided to implement my own. To demonstrate the concept to others I've pared things down to the absolute minimum and I just cannot get it to work.
Tomcat shows the request coming in but the client reports :-
My application is very simple :-Exception in thread "main" org.springframework.remoting.RemoteAccessException : Cannot access HTTP invoker remote service at [http://192.168.254.205:8080/camserv/request]; nested exception is java.io.FileNotFoundException: http://192.168.254.205:8080/camserv/request
I'm sure it's something simple but I can't for the life of me spot what it is. Any ideas?Code:package webservice; public interface IRequestServer { public String ping( ); } package webservice; public class RequestServer implements IRequestServer { public String ping( ) { return "pong"; } } public class PingClient { public static void main( String[] args ) throws Exception { ApplicationContext ctx = new FileSystemXmlApplicationContext( "RequestClient.xml" ); IRequestServer req = (IRequestServer) ctx.getBean( "ping" ); System.out.println( "Ping: " + req.ping( ) ); } } <web-app> <servlet> <servlet-name>camserv</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>camserv</servlet-name> <url-pattern>/camserv/*</url-pattern> </servlet-mapping> </web-app> <beans> <bean id="requestService" class="webservice.RequestServer"/> <bean name="/request" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter" > <property name="service"><ref bean="requestService"/></property> <property name="serviceInterface"> <value>webservice.IRequestServer</value> </property> </bean> </beans> <beans> <bean id="ping" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean" > <property name="serviceUrl"> <value>http://192.168.254.205:8080/camserv/request</value> </property> <property name="serviceInterface"> <value>webservice.IRequestServer</value> </property> </bean> </beans>


Reply With Quote