"Failed to load module 'com.mycompany.MyApplication'
Please see the log in the development shell for details.
What I'm doing wrong? I have IE 6.0 and using JDK 1.4.2_06
Thanks,
Michel fornaris
BTW - Are you actually using J2EE, not just J2SE SDK?
Regards,
Colin
[ERROR] Unable to load module entry point class
com.mycompany.client.MyApplication
java.lang.NullPointerException: null
at
com.mycompany.client.MyApplication.onModuleLoad(MyApplication.java:36)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:64)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:324)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$100(BrowserWidgetIE6.java:19)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:45)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:98)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:199)
package com.mycompany.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class MyApplication implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
final Button button = new Button("Click me");
final Label label = new Label();
button.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (label.getText().equals(""))
label.setText("Hello World!");
else
label.setText("");
}
});
// Assume that the host HTML has elements defined whose
// IDs are "slot1", "slot2". In a real app, you probably would not
want
// to hard-code IDs. Instead, you could, for example, search for
all
// elements with a particular CSS class and replace them with
widgets.
//
RootPanel.get("slot1").add(button);
RootPanel.get("slot2").add(label);
}
}
RootPanel.get("slot1").add(button);
Can you debug it and make sure RootPanel.get("slot1") is not null? (You
need an element in the html page with that id, otherwise it will be
null)
* Be sure you are using a J2EE and not a J2SE version
* The HTML code generated by the "applicationCreator" put the slots
in a table column,
<table align=center>
<tr>
<td id="slot1"></td><td id="slot2"></td>
</tr>
</table>
which doesn't work correctly in debugg mode since
RootPanel.get("slot1") will return NULL. So, I changed it to
<font id="slot1"></font><font
id="slot2"></font>
and everything is working GREAT!!
But... Why RootPanel.get("slot1") returns NULL in debug mode?
Best,
Michel Fornaris
I'd like to know why the J2EE installation is required. It should be
possible to develop with J2SE JDK.
Regards,
Colin
I'd like to know why the J2EE installation is required. It should be
possible to develop with J2SE JDK.
Thanks in advanced,
Michel Fornaris
> ------=_Part_80107_30844321.1148094821422
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 419
>
> <span class="gmail_quote"></span><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I'd like to know why the J2EE installation is required. It should be
> <br>possible to develop with J2SE JDK.<br><br></blockquote></div><br>Hi,<br><br>I´m developing only with J2SE 1.5<br><br clear="all"><br>-- <br>Tiago Serafim
>
> ------=_Part_80107_30844321.1148094821422--
X-Google-Language: ENGLISH,ASCII
Received: by 10.11.53.63 with SMTP id b63mr89950cwa;
Sat, 20 May 2006 13:26:39 -0700 (PDT)
X-Google-Token: wWgUtgwAAABOj8UZfuRoI_zlDK21JPi0
Received: from 70.146.74.215 by j33g2000cwa.googlegroups.com with HTTP;
Sat, 20 May 2006 20:26:39 +0000 (UTC)
From: "Fornaris" <mfor...@gmail.com>
To: "Google Web Toolkit" < Google-We...@googlegroups.com>
Subject: Re: What I'm doing wrong?
Date: Sat, 20 May 2006 20:26:39 -0000
Message-ID: < 1148156799....@j33g2000cwa.googlegroups.com>
In-Reply-To: <345ca5260605192013u3da...@mail.gmail.com >
References: <1147999413.2...@g10g2000cwb.googlegroups.com>
< 1148003047.8...@j55g2000cwa.googlegroups.com>
<1148043095.9...@j55g2000cwa.googlegroups.com>
< 1148044601.1...@i40g2000cwc.googlegroups.com>
<1148047388.5...@u72g2000cwu.googlegroups.com>
< 1148049544.2...@38g2000cwa.googlegroups.com>
<1148051722.4...@j55g2000cwa.googlegroups.com>
< 1148081122....@j73g2000cwa.googlegroups.com>
<345ca5260605192013u3da...@mail.gmail.com>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Mime-Version: 1.0
Content-Type: text/plain; charsetISO-8859-1
Content-Transfer-Encoding: quoted-printable
I believe GWT actually includes a copy of Tomcat, so yes, running off
the J2SE sdk should work just fine (I wouldn't be surprised if it
required 5.0/1.5/Tiger/Whatever you call it).
I'm working under Linux and developing with GWT using the regular 1.5
sdk with no problems. Did nothing special to get it to work.
If this is the case, then I suggest that GWT should prompt you for the
path to an existing Tomcat (or other servlet container) installation,
and the problem will go away.
By the way Tiago, my environment is exactly as you describe (JDK 5.0,
build 6), and I followed the GWT getting started instructions just as
you describe - so at the moment it looks like the Tomcat installation
issue is the problem.
Regards,
Colin
You do not need J2EE to use GWT. In fact, none of the team has J2EE
installed. GWT should work with the 1.4.2 JRE and JDK, as well as the
1.5 JRE and JDK.
RootPanel.get("foo") sometimes returns null in hosted mode. It seems
to be a race condition and we are working on tracking this down. I
don't believe it ever happens in web mode, so this is a development
issue only and not a production issue. I suggest hitting refresh a
couple of times and see if it clears up. If not, check your HTML and
make sure the slot exists.
Hope this helps,
Scott Blum
GWT Engineer
The problem is that some of us have, as outlined in this and other
threads, followed the GWT instructions to the letter, and could not get
the sample programs to run in "hosted" mode - there is no getting away
from the fact that there is some quirk in the installation.
So once again, here is the configuration I use:
Windows XP Professional SP2 - up to date with Microsoft updates
Sun Java SDK 1.5_06
Tomcat 5.5 already installed
Eclipse 3.1
Ant 1.6.5
GWT donloaded and installed exactly as instructed, except inbuild
Tomcat not installed, as already have Tomcat 5.5 installed.
The above configuration did not work pas described. Installing Java EE
1.5 and point Eclipse the JRE got things to work.
The only caveat in my scenario is that I originally had IE7 installed.
However I removed it, and rebooted.This did not solve the problem, but
installing Java EE 1.5 did.
So I'm not saying J2EE is required, what I am saying is that installing
it made things work, when I could not get it to work with J2SE. So
there is clearly something quirky that is messing us up, and it seems
to relate to needing a servlet container, and either installing the
internal GWT one, or using the Java EE one sorts things out.
As I said earlier, if the above is the case, then the GWT installer
should either look for an already installed servlet container, or
prompt to be pointed to one.
Hope this helps,
Regards,
Colin
Can you confirm for me that the exact problem you were getting before
installing J2EE was that RootPanel.get() was returning null in hosted
mode? If you do something like "Window.alert()" in onModuleLoad, does
that work?
If this is what you were seeing, my best guess is that using J2EE
affects the timing in such a way that the race condition doesn't show
up. The reason I think so is that GWT bundles Tomcat (and all other
dependencies) inside gwt-dev-<plat>.jar; GWT doesn't "install" Tomcat,
it simply embeds Tomcat. Installing GWT shouldn't change your system
configuration at all.
Scott
and got the follow error message when trying to run the MyApplication
example. Could anyone tell me what cause that?
Java.lang.RuntimeException: JavaScript method
'@com.google.gwt.user.client.impl.DOMImplStandard::init()' threw an
exception
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:365)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeVoid(ModuleSpaceIE6.java:254)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:127)
at
com.google.gwt.user.client.impl.DOMImplStandard.init(DOMImplStandard.java:176)
at com.google.gwt.user.client.DOM.<clinit>(DOM.java:39)
at com.google.gwt.user.client.ui.Button.<init>(Button.java:46)
at com.google.gwt.user.client.ui.Button.<init>(Button.java:56)
at
com.mycompany.client.MyApplication.onModuleLoad(MyApplication.java:19)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: com.google.gwt.core.client.JavaScriptException: JavaScript
TypeError exception: Object doesn't support this property or method
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
com.google.gwt.dev.shell.ModuleSpace.createJavaScriptException(ModuleSpace.java:267)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.exceptionCaught(ModuleSpaceIE6.java:76)
at
com.google.gwt.dev.shell.JavaScriptHost.exceptionCaught(JavaScriptHost.java:31)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.google.gwt.dev.shell.StaticJavaDispatch.callMethod(StaticJavaDispatch.java:45)
Scott
Hongfeng
Scott
My configuration:
Windows 2000, IE 6.0.2800.1106, Firefox
1.5.03, latest version of GWT ( actually tried both releases of GWT,
same problem on both ). Tomcat 5.5.9 was installed many months
previous to installation (unzip) of GWT There is no entry on my path
for Tomcat.
Here's the stacktrace:
"[ERROR] Unable to load module entry point class
com.google.gwt.sample.kitchensink.client.KitchenSink
java.lang.NullPointerException: null
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:368)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeInt(ModuleSpaceIE6.java:205)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:87)
at
com.google.gwt.user.client.Timer.createTimeout(Timer.java:59)
at com.google.gwt.user.client.Timer.schedule(Timer.java:112)
at
com.google.gwt.user.client.DeferredCommand.maybeSetDeferredCommandTimer(DeferredCommand.java:99)
at
com.google.gwt.user.client.DeferredCommand.add(DeferredCommand.java:50)
at
com.google.gwt.user.client.ui.DockPanel.deferRealize(DockPanel.java:190)
at
com.google.gwt.user.client.ui.DockPanel.add(DockPanel.java:126)
at
com.google.gwt.sample.kitchensink.client.KitchenSink.show(KitchenSink.java:114)"
>From another thread here I downloaded and installed J2EE SDK 5 but that
did not fix the problem, the Sun Appserver is on my path ( the
installer puts it there )...but no clue how just installing the J2EE
SDK would affect the internal Tomcat servlet container that runs the
GWT app.
Same problem here:
My configuration:
Windows 2000, IE 6.0.2800.1106, Firefox
1.5.03, latest version of GWT ( actually tried both releases of GWT,
same problem on both ). Tomcat 5.5.9 was installed many months
previous to installation (unzip) of GWT There is no entry on my path
for Tomcat.
Here's the stacktrace:
"[ERROR] Unable to load module entry point class
com.google.gwt.sample.kitchensink.client.KitchenSink
java.lang.NullPointerException: null
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:368)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeInt (ModuleSpaceIE6.java:205)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:87)
at
com.google.gwt.user.client.Timer.createTimeout(Timer.java:59)
at com.google.gwt.user.client.Timer.schedule (Timer.java:112)
at
com.google.gwt.user.client.DeferredCommand.maybeSetDeferredCommandTimer(DeferredCommand.java:99)
at
com.google.gwt.user.client.DeferredCommand.add(DeferredCommand.java:50)
at
com.google.gwt.user.client.ui.DockPanel.deferRealize(DockPanel.java:190)
at
com.google.gwt.user.client.ui.DockPanel.add(DockPanel.java:126)
at
com.google.gwt.sample.kitchensink.client.KitchenSink.show (KitchenSink.java:114)"
> > DeferredCommand.java:99)
> > at
> > com.google.gwt.user.client.DeferredCommand.add(DeferredCommand.java:50)
> > at
> > com.google.gwt.user.client.ui.DockPanel.deferRealize(DockPanel.java:190)
> > at
> > com.google.gwt.user.client.ui.DockPanel.add(DockPanel.java:126)
> > at
> > com.google.gwt.sample.kitchensink.client.KitchenSink.show(KitchenSink.java
> > :114)"
> >
> >
> > >From another thread here I downloaded and installed J2EE SDK 5 but that
> > did not fix the problem, the Sun Appserver is on my path ( the
> > installer puts it there )...but no clue how just installing the J2EE
> > SDK would affect the internal Tomcat servlet container that runs the
> > GWT app.
> >
> >
> > >
> >
>
>
> --
> Colin Manning
> Technical Director Setanta-Media Limited
>
> ------=_Part_12827_9965874.1149062523387
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 2644
>
> <div>If eunning r#things from inside Eclipse, you will need to point Eclipse to the J2EE SDK instead of the standard JDK which will be the default. That should get you going.</div>
> <div><br>Regards,</div>
> <div> </div>
> <div>Colin<br><br> </div>
> <div><span class="gmail_quote">On 30/05/06, <b class="gmail_sendername"><a href="mailto:stri...@gmail.com">stri...@gmail.com</a></b> <<a href="mailto:stri...@gmail.com">stri...@gmail.com</a>> wrote:</span>
> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Same problem here:<br><br>My configuration:<br><br>Windows 2000, IE 6.0.2800.1106, Firefox<br>1.5.03, latest version of GWT ( actually tried both releases of GWT,
> <br>same problem on both ). Tomcat 5.5.9 was installed many months<br>previous to installation (unzip) of GWT There is no entry on my path<br>for Tomcat.<br><br>Here's the stacktrace:<br><br>"[ERROR] Unable to load module entry point class
> <br>com.google.gwt.sample.kitchensink.client.KitchenSink<br>java.lang.NullPointerException: null<br> at<br>com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:368)<br> at<br>com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeInt
> (ModuleSpaceIE6.java:205)<br> at<br>com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:87)<br> at<br>com.google.gwt.user.client.Timer.createTimeout(Timer.java:59)<br> at com.google.gwt.user.client.Timer.schedule
> (Timer.java:112)<br> at<br>com.google.gwt.user.client.DeferredCommand.maybeSetDeferredCommandTimer(DeferredCommand.java:99)<br> at<br>com.google.gwt.user.client.DeferredCommand.add(DeferredCommand.java:50)<br>
> at<br>com.google.gwt.user.client.ui.DockPanel.deferRealize(DockPanel.java:190)<br> at<br>com.google.gwt.user.client.ui.DockPanel.add(DockPanel.java:126)<br> at<br>com.google.gwt.sample.kitchensink.client.KitchenSink.show
> (KitchenSink.java:114)"<br><br><br>>From another thread here I downloaded and installed J2EE SDK 5 but that<br>did not fix the problem, the Sun Appserver is on my path ( the<br>installer puts it there )...but no clue how just installing the J2EE
> <br>SDK would affect the internal Tomcat servlet container that runs the<br>GWT app.<br><br><br>
> ------=_Part_12827_9965874.1149062523387--
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/5b93ef79b0a32cad
Scott Blum said the problem should be fixed in the next release.
To point Eclipse to an alternate JDK try: "Project -> Properties ->
Java Build Path" remove the entry for the other JDK and then do an "Add
Library -> JRE System Library -> Next -> Alternate JRE" then select
from the list.
If that doesn't work you may have to go to "Widows -> Preferences ->
Java -> Installed JREs" and either select the alternate one you want or
click "Add" and browse to the location of the one you want.