Hi,
I'm exposing one of Spring beans as a remote service using Burlap and have written a simple test case to invoke a service method. The actually method invocation works correctly but I get theis exception thrown during my bean instantiation (i.e. before I invoke my remote service method).
On the server side, I have the following:Code:2007-02-06 09:13:31,734 DEBUG [org.springframework.web.servlet.DispatcherServlet] - <Cleared thread-bound request context: Http Request: /g3/staticData.service> 2007-02-06 09:13:31,734 DEBUG [org.springframework.web.servlet.DispatcherServlet] - <Could not complete request> org.springframework.web.HttpRequestMethodNotSupportedException: BurlapServiceExporter only supports POST requests at org.springframework.remoting.caucho.BurlapServiceExporter.handleRequest(BurlapServiceExporter.java:104) at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:47) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
My servlet config file contains the following snippet:
Code:<bean id="simpleUrlMapping" class = "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name ="mappings"> <props> <prop key="/home.htm">ControllerX</prop> <prop key="/staticData.service">RemoteControllerX</prop> </props> </property> </bean> <bean name="RemoteControllerX" class="org.springframework.remoting.caucho.BurlapServiceExporter"> <property name="service" ref="remoteStaticDataService" /> <property name="serviceInterface" value="com.rbccm.g3.remoting.IRemoteStaticDataService" /> </bean>
My application context exposes the following bean definitions:
On the client, I have the following:Code:<bean id="staticDataService" class="com.rbccm.g3.services.impl.StaticDataService" lazy-init="true"> </bean> <bean id="remoteStaticDataService" class="com.rbccm.g3.remoting.RemoteStaticDataService"> <property name="staticDataService" ref="staticDataService"/> </bean>
My java client looks like the following:
My client context configuration (applicationContext-remoteClients.xml) contains the following bean definition:Code:public class TestRemoteServices extends TestCase { protected final Log logger = LogFactory.getLog(getClass()); private ApplicationContext _ctx; protected IRemoteStaticDataService _remoteStaticDataService; protected void setUp() throws Exception { String[] paths = {"/com/rbccm/g3/remoting/applicationContext-remoteClients.xml"}; _ctx = new ClassPathXmlApplicationContext(paths); _remoteStaticDataService = (IRemoteStaticDataService) _ctx.getBean("remoteStaticDataService"); } public void testGetBooks() { Collection books = _remoteStaticDataService.getBooks(); for (Iterator iter = books.iterator(); iter.hasNext();) { Book book = (Book) iter.next(); logger.info(book.toString()); } } }
Code:<bean id="remoteStaticDataService" class="org.springframework.remoting.caucho.BurlapProxyFactoryBean"> <property name="serviceUrl" value="http://localhost:7001/g3/staticData.service" /> <property name="serviceInterface" value="com.rbccm.g3.remoting.IRemoteStaticDataService" /> </bean>
Any help on this would be great.
Thanks,
Dan.


Reply With Quote