Error compiling code with GWT-1.5 RC1 - NoClassDefFoundError

9 views
Skip to first unread message

NullPointer

unread,
Aug 6, 2008, 2:50:17 AM8/6/08
to Google Web Toolkit
I am attempting to compile my code with GWT-1.5 RC1 compiler. However
i ended up with the below error without any further descriptive
information. I am not sure what class is missing as the application
compiles and runs fine with GWT-1.4 (I just replaced the gwt-user.jar
and gwt-servlet.jar in the new setup). I have tried increasing the -
Xmx to 2048M but still no luck. Any clues on what this error is or any
other help is much appreciated.

Compiling permutations
Analyzing permutation #1
[ERROR] Unexpected internal compiler error
java.lang.NoClassDefFoundError
at
com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:
441)
at
com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:431)
at com.google.gwt.dev.js.ast.JsModVisitor
$NodeContext.traverse(JsModVisitor.java:139)
at
com.google.gwt.dev.js.ast.JsModVisitor.doAccept(JsModVisitor.java:164)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:
94)
at com.google.gwt.dev.js.JsInliner.exec(JsInliner.java:1358)
at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compile(JavaToJavaScriptCompiler.java:
447)
at
com.google.gwt.dev.GWTCompiler.realizePermutation(GWTCompiler.java:
511)
at
com.google.gwt.dev.GWTCompiler.compilePermutations(GWTCompiler.java:
442)
at com.google.gwt.dev.GWTCompiler.distill(GWTCompiler.java:
358)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:564)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:554)
at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:214)
[ERROR] Build failed

Note: I am not using Eclipse to compile but rather invoke GWTCompile
through ANT task and as i mentioned earlier all the classes and
sources are present in the classpath and application compiles fine
with GWT-1.4

walden

unread,
Aug 6, 2008, 8:04:04 AM8/6/08
to Google Web Toolkit
Your old jars are either not gone, or they are cached somewhere. You
are probably bumping up against the notorious java class loading
constraint triggered by more than one eligible class of that fully
qualified name being loadable. Scrub the environment clean and try
again.
> com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compile(JavaToJavaScriptCom­piler.java:

NullPointer

unread,
Aug 19, 2008, 1:51:50 AM8/19/08
to Google Web Toolkit
Thanks Walden, however I have verified the environment thoroughly and
am not caching any jars. On a additional note, currently, this is a
show-stopper that is preventing me from migrating to GWT1.5. I was
closely debugging this issue last week and have found some clues about
how this issue is sprouting up. I have a Panel class that has a method
that creates a panel and adds this panel to the outermost panel and
this method has a anonymous class that goes something like this

public class Demo extends SimplePanel {
public Demo() {
setWidget(setup());
}

public Panel setup() {
FocusPanel panel = new FocusPanel();
panel.add(new SimplePanel() {
{
setup();
}

protected void setup() {
FocusPanel panel = new FocusPanel();
panel.add(new SimplePanel() {
{
setup();
}

protected void setup() {
FocusPanel panel = new FocusPanel();
panel.add(new SimplePanel() {
{
setup();
}

protected void setup() {
FocusPanel panel = new FocusPanel();
panel.add(new SimplePanel() {
{
setup();
}

protected void setup() {
// A panel is created and lot of widgets
// of different kinds are added to this panel
}
});

}
});
}
});
}
});
return panel;
}
}

When the inner-most method that creates and adds widgets crosses a
certain number of lines precisely ~1500, then i get this error
Analyzing permutation #1
[ERROR] Unexpected internal compiler error
java.lang.NoClassDefFoundError
at
com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:
441)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:
431)
at com.google.gwt.dev.js.ast.JsModVisitor
$NodeContext.traverse(JsModVisitor.java:139)
at
com.google.gwt.dev.js.ast.JsModVisitor.doAccept(JsModVisitor.java:164)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:94)
at com.google.gwt.dev.js.JsInliner.exec(JsInliner.java:1358)
at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compile(JavaToJavaScriptCompiler.java:
447)
at
com.google.gwt.dev.GWTCompiler.realizePermutation(GWTCompiler.java:
511)
at
com.google.gwt.dev.GWTCompiler.compilePermutations(GWTCompiler.java:
442)
at com.google.gwt.dev.GWTCompiler.distill(GWTCompiler.java:358)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:564)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:554)
at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:214)

When i comment out the some amount of lines then the error goes off
and everything compiles.

Note: The reason my class above is laid out that way(Inner classes) is
because this class is auto-generated by our system, since we have
built a GWT based product that allows user to drag and drop and
creates screens and once the screens are created this structure
information is stored to DB. Then the corresponding GWT based code is
autogenerated out of this structure information and GWT compiled and
auto-deployed. I have created Wrapper classes for all widgets to add
framework specific behaviors.

Can you think of anything suspicious?I would like to summarize that i
am able to compile when i comment away some part of the inner class
code above. There is no problem with the code that i comment because I
can comment different parts of the code (and the leave the earlier
commented portion uncommented) and still get my code GWT1.5 compiled.
I suspect that the compilation problem is strongly tied to either the
number of lines of code (or) number of classes that are encountered in
any particular method of the compiled code. Any help is greatly
appreciated.

Christopherg

unread,
Aug 25, 2008, 4:54:25 AM8/25/08
to Google Web Toolkit
Have you found anything on this? I am also having the same problem.
But I don't have much nesting in my file.
I've written a script that generates a BeanFactory.java and the
factory is 10000+ LoC

I've managed to reduce under 10000 and then it works.

Have you run the latest SVN of GWT on it?

Reply all
Reply to author
Forward
0 new messages