Wednesday, June 30, 2010

Re: why do I sometimes get a javascript error of "uncaught exception: java.lang.NullPointerException"?

You could try using an UncaughtExceptionHandler. Assign your
implementation in onModuleLoad() by

GWT.setUncaughtExceptionHandler(...);

Then use a DeferredCommand for calling your actual entry point method:

DeferredCommand.addCommand(new Command() {
public void execute() {
yourEntryPointMethod();
}
});

You can use the UncaughtExceptionHandler to print stack trace for
example.

See http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html
and http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/core/client/GWT.html

On 30 Jun., 22:03, Shedokan <shedok...@gmail.com> wrote:
> Why there are some times while doing the same actions in my app I get
> this javascript error:
> uncaught exception: java.lang.NullPointerException
>
> I have no idea where it is coming from since there is no line number
> and have no idea what is causing it.
>
> how can I trace it and fix it?
> and why does it show up in some times and in other times it doesn't?
>
> thanks.

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

No comments:

Post a Comment