开发者

GWT: RPC Failure (StatusCodeException)

in my project an RPC interface was implemented to communicate between GWT and a server as described here:

http://code.google.com/webtoolkit/doc/1.6/DevGuideServerCommunication.html

All the existing methods can be invoked fine, but lately i introduced a new method which when calling it results in an RPC failure:

com.google.gwt.user.client.rpc.StatusCodeException: The call failed on the server; see server log for details
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:192)
    at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:254)
    at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java:226)
    at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:217)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:592)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.moz.MethodDispatch.invoke(MethodDispatch.java:80)
    at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
    at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1428)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
    at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
    at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
    at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)

(This excecption stacktrace is shown when running in hosted mode).

Here's the changes I made:

  1. I extended my service interface with the new method:

    @RemoteServiceRelativePath("myservice") public interface MyService extends RemoteService { // ... Boolean isSomethingValid(String paramToCheck); }

  2. I implemented my method:

    public class PMyServiceImpl extends GWTSpringController implements MyService { // ...

    public Boolean isSomethingValid(String paramToCheck) {
      // do something ...
    }
    

    }

  3. I added the method definition to the asynchronous interface:

    public interface MyServiceAsync { // ... void isSomethingValid(String paramToCheck, AsyncCallback callback); }

That's it. Am I missing anything? Any hints why the RPC failure occurs? In my server log, I can see the following exception:

[7/26/11 11:48:16:618 CEST] 0000004a WebApp        A   SRVE0181I: [myapplication.war] [/istoolset] [Servlet.LOG]: Exception while dispatching incoming RPC call: com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.Boolean com.ubs.istoolset.front.fet.gwt.businessmodel.client.service.MyService.isSomethingValid(java.lang.String)' threw an unexpected exception: java.lang.NullPointerException
        at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
        at com.ubs.istoolset.gwt.framework.rpc.GWTSpringController.handleRequest(GWTSpringController.java:48)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:593)
        at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:534)
        at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:764)
        at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:450)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:508)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:296)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:270)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:2开发者_StackOverflow05)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: java.lang.NullPointerException
        at com.ubs.istoolset.front.fet.gwt.businessmodel.server.MyServiceImpl.isSomethingValid(MyServiceImpl.java:1906)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:618)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
        ... 27 more

Any help is very appreciated, thanks!


I'm not familiar with the com.ubs namespace (is that your code?), but this NullPointerException in your stack trace (server side) is a problem:

Caused by: java.lang.NullPointerException
        at     com.ubs.istoolset.front.fet.gwt.businessmodel.server.MyServiceImpl.isSomethingValid(MyServiceImpl.java:1906)

what is going on there?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜