Announcement Announcement Module
Collapse
No announcement yet.
BurlapServiceExporter only supports POST requests Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BurlapServiceExporter only supports POST requests

    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).

    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)
    On the server side, I have the following:


    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:

    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>
    On the client, I have the following:

    My java client looks like the following:

    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());
    		}
    	}
    }
    My client context configuration (applicationContext-remoteClients.xml) contains the following bean definition:

    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.

  • #2
    Any solution already?

    I'm having exactly the same behaviour...
    Did you find already a solution / workaround for this ?

    Thx !

    Comment


    • #3
      Peter,

      Never did solve it that problem. I decided it was easier to switch over to Spring's HttpInvoker protocol and its been working fine for me.

      Dan.

      Comment


      • #4
        This issue is now being tracked as SPR-4542.

        The error message that appears is part of an initial GET request, which Burlap itself issues when a proxy is being created to clear old keep-alive connections. It is harmless and subsequent actual Burlap calls are sent as POST requests and do succeed.

        Comment

        Working...
        X