JPS wrote:I just started evaluating the designer. I attempted to open in design view the Mail sample that Google provides. A portion of the app (the mail list on the right) gave the message:
Exception during the creation of MailList
See "Error log" for details.
The
Mail example has a bug and is poorly designed from an OO point of view to begin with. It throws an NPE at design time (it's not very carefully written), so you need to fix the following NPE (which you should see in your log)...
- Code: Select all
java.lang.NullPointerException
at com.google.gwt.sample.mail.client.MailList.selectRow(MailList.java:145)
at com.google.gwt.sample.mail.client.MailList.update(MailList.java:196)
at com.google.gwt.sample.mail.client.MailList.<init>(MailList.java:69)
The
MailList class sends a
get() call to the
Mail class to access its singleton without testing that it is non null or ensuring that the singleton is actually created. The
get() method itself returns the singleton field without ensuring that it is populated. The example relies on runtime-specific behavior to populate the singleton instance (the call to the
Mail.onLoadModule() method). When editing the
Mail class at design time, there is no instance of the
Mail class created. The
Mail class is parsed; it is not instantiated. Any code that tries to actually access the instance of the class being edited will not work because there is no such instance.
If you comment out the line
Mail.get().displayItem(item); in the
MailList class (or add an null check for
Mail.get() prior to that line), the
Mail class should open in Designer.
From a purely OO point of view, the
Mail example is poorly designed. The classes are tightly coupled (when they don't need to be) and the
MailList class unnecessarily breaks encapsulation by talking directly back to the
Mail class via its singleton.
If you want to evaluate GWT Designer, I would recomment just starting with the
Quick Start guide.
JPS wrote:Could someone tell me where this error log is located?
The Eclipse "
.log" file is always in your workspace
.metadata directory.