I extended AbstractStandardDispatchServlet in order to use it with spring
and it seems that getDispatch() from here returns me null Dispatch Object.

package cayetano.common.web.handler;

import javax.inject.Inject;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import net.customware.gwt.dispatch.server.Dispatch;
import
net.customware.gwt.dispatch.server.standard.AbstractStandardDispatchServlet;

import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public final class StandardDispatchServiceServlet extends
AbstractStandardDispatchServlet {

private static final long serialVersionUID = 1L;

private Dispatch dispatch;

@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
WebApplicationContext ctx =
WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext());
AutowireCapableBeanFactory beanFactory =
ctx.getAutowireCapableBeanFactory();
beanFactory.autowireBean(this);
}

@Inject
public void setDispatch(Dispatch dispatch) {
this.dispatch = dispatch;
}

@Override
protected Dispatch getDispatch() {
return dispatch;
}

}

On Tue, May 10, 2011 at 3:35 PM, Mail Delivery Subsystem <
[email protected]> wrote:

> Hello [email protected],
>
> We're writing to let you know that the group you tried to contact
> (gwt-dispatch) may not exist, or you may not have permission to post
> messages to the group. A few more details on why you weren't able to post:
>
>  * You might have spelled or formatted the group name incorrectly.
>  * The owner of the group may have removed this group.
>  * You may need to join the group before receiving permission to post.
>  * This group may not be open to posting.
>
> If you have questions related to this or any other Google Group, visit the
> Help Center at http://groups.google.com/support/?hl=en_US.
>
> Thanks,
>
> Google Groups
>
>
>
> ----- Original message -----
>
> Received: by 10.227.6.201 with SMTP id a9mr499687wba.9.1305030944722;
>        Tue, 10 May 2011 05:35:44 -0700 (PDT)
> Received: by 10.227.6.201 with SMTP id a9mr499686wba.9.1305030944699;
>        Tue, 10 May 2011 05:35:44 -0700 (PDT)
> Return-Path: <[email protected]>
> Received: from mail-ww0-f52.google.com (mail-ww0-f52.google.com[74.125.82.52])
>        by gmr-mx.google.com with ESMTPS id
> 15si2056852wbl.0.2011.05.10.05.35.44
>        (version=TLSv1/SSLv3 cipher=OTHER);
>        Tue, 10 May 2011 05:35:44 -0700 (PDT)
> Received-SPF: pass (google.com: domain of [email protected] 
> 74.125.82.52 as permitted sender) client-ip=74.125.82.52;
> Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of
> [email protected] designates 74.125.82.52 as permitted sender)
> [email protected]; dkim=pass (test mode) header.i=@
> gmail.com
> Received: by mail-ww0-f52.google.com with SMTP id 31so2227465wwb.33
>        for <multiple recipients>; Tue, 10 May 2011 05:35:44 -0700 (PDT)
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
>        d=gmail.com; s=gamma;
>        h=domainkey-signature:mime-version:date:message-id:subject:from:to
>         :content-type;
>        bh=m20dryqixWN7v5wibo2n0TSMDH8u7b5FNvrDtRbfXys=;
>        b=gVPVm0JVv7h8npgCDmsk1JB1hVcIoGNf3IJC4GQrUwjsm0OtA5FWOF+OoL5ZJ0HciB
>
> mVAqE24y8qNbqdQEGF0HvgmkFh1bvEBSTjhAygD7qCvEgQt/wrxKQsXnDMaOcoaCa95u
>         Z+CCHQlKI+YNPmcox3z36FkwGEizDqOJjKQBo=
> DomainKey-Signature: a=rsa-sha1; c=nofws;
>        d=gmail.com; s=gamma;
>        h=mime-version:date:message-id:subject:from:to:content-type;
>        b=u11xJ05YpJuyd0NNYBt1jxo8aP//WMIdWjGYcJ8SnilZPfFcOEvpXpB/5f84vqjwaq
>
> yQx0GVvEMxug0TPJ99bYj/8UepqOvNtp3muYrGlEChZFiUwZgKi2mbNRz8575oCVGTGU
>         b/g7oEJXW6LQarNKUgj1WesOH4T8yi0isxCV8=
> MIME-Version: 1.0
> Received: by 10.227.172.143 with SMTP id l15mr928739wbz.80.1305030944539;
> Tue,
>  10 May 2011 05:35:44 -0700 (PDT)
> Received: by 10.227.148.17 with HTTP; Tue, 10 May 2011 05:35:44 -0700 (PDT)
> Date: Tue, 10 May 2011 15:35:44 +0300
> Message-ID: <[email protected]>
> Subject: Strange NullPointerException during getDispatch().execute(action);
> From: mariyan nenchev <[email protected]>
> To: [email protected],
>        Google Web Toolkit <[email protected]>
> Content-Type: multipart/alternative; boundary=485b3973f087dec5ad04a2eb31b3
>
> Hi
>
> I am getting very strange exception during execution of dispatch action. It
> seems that getDispatch() returns null?! Here is the exception:
>
> rpcDispatcher: Exception while executing
> cayetano.games.updownbet.web.shared.handler.action.UpDownBetGameAction:
> null
> java.lang.NullPointerException
> at
>
> net.customware.gwt.dispatch.server.standard.AbstractStandardDispatchServlet.execute(AbstractStandardDispatchServlet.java:17)
> 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:597)
> at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
> at
>
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
> at
>
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
> at
>
> com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> Regards.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to