java.lang.NoClassDefFoundError: com/google/gwt/core/client/JavaScriptObject in hosted mode (only)

405 views
Skip to first unread message

Mark

unread,
Feb 12, 2012, 9:58:16 PM2/12/12
to Google Web Toolkit
I have been developing an app of several thousand lines that has
worked great for weeks.All of a sudden yesterday it stopped loading in
hosted mode (eclipse Indigo, chrome 16.0.912.77, GWT 2.4.0, Google
plugin 3.7) . As described below, the problem is <inherits
name="com.google.gwt.visualization.Visualization"/> in
myProject.gwt.xml that is included for charts (and this used to
work...)

On loading (hosted mode on jetty), it raises this error:

[ERROR] [reagentcalculator] - Failed to load module
'reagentcalculator' from user agent 'Mozilla/5.0 (Windows NT 6.1;
WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77
Safari/535.7' at quickstart.local:8243


21:48:57.007 [ERROR] [reagentcalculator] Unable to initialize static
dispatcher

java.lang.NoClassDefFoundError: com/google/gwt/core/client/
JavaScriptObject
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClassOrNull(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at
com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:
1085)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.google.gwt.dev.shell.JsValueGlue.set(JsValueGlue.java:220)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
129)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
561)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:
289)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
332)
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(Unknown Source)


Next step was to try a new project from the GWT template... it
worked! Okay, so I assumed I introduced a bug. Over several hours, I
reduced my application down to the following (which you may recognize
as the preamble to the template).


public void onModuleLoad() {
final Button sendButton = new Button("Send");
final TextBox nameField = new TextBox();
nameField.setText("GWT User");
final Label errorLabel = new Label();

// We can add style names to widgets
sendButton.addStyleName("sendButton");

// Add the nameField and sendButton to the RootPanel
// Use RootPanel.get() to get the entire body element
RootPanel.get("nameFieldContainer").add(nameField);
RootPanel.get("sendButtonContainer").add(sendButton);
RootPanel.get("errorLabelContainer").add(errorLabel);
}

Alas, it STILL throws the error! Tracked down the problem to the line
in myProject.gwt.xml
<inherits name="com.google.gwt.visualization.Visualization"/>
because I am using google charts in the full app (but not in the small
version above). gwt-visualization.jar (latest 1.1.2) is copied into
WEB-INF/lib and in project build path. If I comment out the inherits
line, The code above works fine.

Any ideas?

Thanks,
Mark

Craig Mitchell

unread,
Nov 21, 2012, 12:28:49 AM11/21/12
to google-we...@googlegroups.com
I had a similar problem.  I then realised I had made a mistake in the gwt.xml file with the <source path='xxx'/>, where the "xxx" was not valid.

On Sunday, 23 September 2012 00:19:10 UTC+10, Arturs Elksnis wrote:
Hi Mark,
          Did you get to the bottom of this at all? I just got stuck with a pretty much identical problem and there's nothing on the web except this thread where noone has answered your question.

This would be really good to crack or else I have to use something else for charting.

Thomas Broyer

unread,
Nov 21, 2012, 6:17:40 AM11/21/12
to google-we...@googlegroups.com


On Wednesday, November 21, 2012 6:28:49 AM UTC+1, Craig Mitchell wrote:
I had a similar problem.  I then realised I had made a mistake in the gwt.xml file with the <source path='xxx'/>, where the "xxx" was not valid.

Just to make sure I understand correctly: using an invalid path="" (which I assume means "does not exist", rather than "contains some weird characters") in <source> in one module can completely break the DevMode?

Craig Mitchell

unread,
Nov 22, 2012, 5:49:19 PM11/22/12
to google-we...@googlegroups.com
Correct, path "does not exist".

However, for me, it didn't completely break the dev mode.  It would throw up the "Unable to initialize static dispatcher" message usually on the first load, then when I refreshed the page, it would work.  Once I removed the invalid path, I've not seen the message again.

GWT 2.4.0, Eclipse Juno, Win 7.
Reply all
Reply to author
Forward
0 new messages