ClassNotFoundException: com.google.gwt.dev.util.Preconditions when compiling with 2.6.0 RC1

2,713 views
Skip to first unread message

Boris Brudnoy

unread,
Nov 13, 2013, 11:47:18 AM11/13/13
to google-we...@googlegroups.com
I'm getting this compiler error when building a GWT project using the recently downloaded gwt-2.6.0-rc1:

[ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:110)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:276)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
...
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:104)

Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.util.Preconditions
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 60 more

When I unpacked the gwt-dev.jar there really wasn't a Preconditions class in c.g.g.dev.util, nor is it in the source tree of either the 2.6.0-rc1 tag or the master branch. Why does the compiler want it?

Note: the compilation was launched via Google Plugin for Eclipse. Perhaps the plugin is not getting some launch params right?

Thomas Broyer

unread,
Nov 13, 2013, 12:18:57 PM11/13/13
to google-we...@googlegroups.com
Are you using a third-party library that would make use of this class? (Google GIN used to use it for example, and has not yet made a released with the fix: https://code.google.com/p/google-gin/source/detail?r=278)

Boris Brudnoy

unread,
Nov 13, 2013, 12:45:49 PM11/13/13
to google-we...@googlegroups.com
Are you using a third-party library that would make use of this class? (Google GIN used to use it for example, and has not yet made a released with the fix: https://code.google.com/p/google-gin/source/detail?r=278

Yes, the project uses GIN. Further down the stack trace there's this (which I missed): 

Caused by: java.lang.NoClassDefFoundError: com/google/gwt/dev/util/Preconditions
at com.google.gwt.inject.rebind.reflect.MethodLiteral.get(MethodLiteral.java:59)
at com.google.gwt.inject.rebind.util.MemberCollector.getTypeMethods(MemberCollector.java:311)
at com.google.gwt.inject.rebind.util.MemberCollector.accumulateMembers(MemberCollector.java:269)

Just checked the diffs for the fix you linked to and confirmed that the old MethodLiteral indeed uses the Preconditions.java now absent from the c.g.g.dev.util package. This implies that projects using GIN won't be able to migrate to GWT 2.6.0 until a new GIN release comes out. Guessing this is going to be a problem for a lot of folks.

Thomas Broyer

unread,
Nov 13, 2013, 1:00:11 PM11/13/13
to google-we...@googlegroups.com


On Wednesday, November 13, 2013 6:45:49 PM UTC+1, Boris Brudnoy wrote:
Are you using a third-party library that would make use of this class? (Google GIN used to use it for example, and has not yet made a released with the fix: https://code.google.com/p/google-gin/source/detail?r=278

Yes, the project uses GIN. Further down the stack trace there's this (which I missed): 

Caused by: java.lang.NoClassDefFoundError: com/google/gwt/dev/util/Preconditions
at com.google.gwt.inject.rebind.reflect.MethodLiteral.get(MethodLiteral.java:59)
at com.google.gwt.inject.rebind.util.MemberCollector.getTypeMethods(MemberCollector.java:311)
at com.google.gwt.inject.rebind.util.MemberCollector.accumulateMembers(MemberCollector.java:269)

Just checked the diffs for the fix you linked to and confirmed that the old MethodLiteral indeed uses the Preconditions.java now absent from the c.g.g.dev.util package. This implies that projects using GIN won't be able to migrate to GWT 2.6.0 until a new GIN release comes out. Guessing this is going to be a problem for a lot of folks.

Yes, but GIN is made by some of the same team as GWT at Google (e.g. Goktug Gokdogan) so I think there's a good chance that we'll see a GIN 2.1.2 that's compatible with GWT 2.6.

Leonid Khachaturov

unread,
Nov 13, 2013, 6:44:50 PM11/13/13
to google-we...@googlegroups.com

Thomas Broyer

unread,
Nov 14, 2013, 4:24:50 AM11/14/13
to google-we...@googlegroups.com
Yes, it is.

Michael Prentice

unread,
Jan 16, 2014, 5:05:26 PM1/16/14
to google-we...@googlegroups.com
I was able to get my project to build with GWT 2.6rc4 after upgrading EventBinder to 1.0.1 and Gin to 2.1.2. I wanted to commit my EventBinder and Gin upgrades but not yet commit the change to GWT 2.6. This didn't work though.

Using Gin 2.1.2 with GWT 2.5.1 generated the following exceptions on loading my app:
Deferred binding failed for 'com.google.gwt.user.client.ui.impl.ClippedImageImpl$Template'

Putting Gin 2.1.1 back in place for now resolved the issue.
Reply all
Reply to author
Forward
0 new messages