Stuck in the StockWatch tutorial

98 views
Skip to first unread message

thronedoggie

unread,
Dec 1, 2011, 7:30:58 PM12/1/11
to Google Web Toolkit

Okay, I can keep retyping the same things over and over, or I can ask
for help.

(Actually, I'm doing both : )

I'm in the sample app tutorial -

http://code.google.com/webtoolkit/doc/latest/tutorial/gettingstarted.html

- building the StockWatch web app. I'm using Indigo build id
20110615-0604. I typed it in just like it said and everything was
fine, then finished section three ("Build the User Interface" and
then, when I tried to run the test, Church was Out.

*********************************************
Exception while loading module
com.google.gwt.sample.stockwatcher.client.StockWatcher. See
Development Mode for details.

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:
200)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
525)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
363)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
at
com.google.gwt.sample.stockwatcher.client.StockWatcher.onModuleLoad(StockWatcher.java:
47)
... 9 more
*********************************************

That line is

RootPanel.get("stockList").add(mainPanel);

and it all looks just like the example - EXCEPT that the .get in the
method chain is in *italics*.

Tried some googling - couldn't find out what the italics mean.

If anyone has any ideas, I'd love to hear about it. I was having fun
with this until this happened, and I can't find any way around it.

thanks,
jim p.
....at Godaddy, where they don't do a *lot* of Java, but I'd like to
help it along :L)

-sowdri-

unread,
Dec 2, 2011, 12:40:52 AM12/2/11
to google-we...@googlegroups.com

>> RootPanel.get("stockList").add(mainPanel);

// From the javadoc

public static RootPanel get(java.lang.String id)
Gets the root panel associated with a given browser element. For this to work, the HTML document into which the application is loaded must have specified an element with the given id.

Parameters:
id - the id of the element to be wrapped with a root panel ( null specifies the default instance, which wraps the <body> element)
Returns:
the root panel, or null if no such element was found

Looks like your host html is missing an element with id "stockList", so either add it to your host page or 
Use the following line, without the id param, 

RootPanel.get().add(mainPanel);


Thanks,
-sowdri-

Fat Charlie the Archangel

unread,
Dec 2, 2011, 8:43:59 AM12/2/11
to google-we...@googlegroups.com

sowdri -

> Looks like your host html is missing an element with id "stockList", so
> either add it to your host page or Use the following line, without the id
> param,

Bing! Ned Ryerson!

....all of my commercial Java was serverside code - no UI stuff at all.
So I reckon I am still used to looking for Java errors in Java code.
You've redirected my thinking. Thanks!

jim p.
-------------------------------
jim puckett
New River, Arizona

http://blog.fatcharliesdiary.com

Prayer may not change things for you,
but it for sure changes you for things.

-- Samuel M. Shoemaker


Reply all
Reply to author
Forward
0 new messages