gwt-eclipse-plugin icon indicating copy to clipboard operation
gwt-eclipse-plugin copied to clipboard

GWT 2.8 - Super Dev Mode throws NoClassDefFoundError

Open JanecekPetr opened this issue 7 years ago • 4 comments

I have a GWT 2.8.2 project and downloaded the current plugin's snapshot from https://storage.googleapis.com/gwt-eclipse-plugin/v3/snapshot.

My versions:

  • GWT 2.8.2 SDK - 2.8.0.201803211650
  • GWT Eclipse Plugin - 3.0.0.201803211650

My project refers to these dependencies in its POM:

<dependency>
    <groupId>com.google.gwt</groupId>
    <artifactId>gwt-user</artifactId>
    <version>2.8.2</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.google.web.bindery</groupId>
    <artifactId>requestfactory-server</artifactId>
    <version>2.8.2</version>
</dependency>

Now, when I try to run Super Dev mode for this project, I get an error:

Exception in thread "main" java.lang.NoClassDefFoundError: cern/colt/map/OpenIntObjectHashMap
	at com.google.gwt.dev.util.collect.IntMultimap.<init>(IntMultimap.java:28)
	at com.google.gwt.dev.StringAnalyzableTypeEnvironment.<init>(StringAnalyzableTypeEnvironment.java:68)
	at com.google.gwt.dev.MinimalRebuildCache.<init>(MinimalRebuildCache.java:192)
	at com.google.gwt.dev.CompilerContext$Builder.<init>(CompilerContext.java:37)
	at com.google.gwt.dev.DevModeBase.<init>(DevModeBase.java:636)
	at com.google.gwt.dev.DevMode.<init>(DevMode.java:463)
	at com.google.gwt.dev.DevMode.main(DevMode.java:430)
Caused by: java.lang.ClassNotFoundException: cern.colt.map.OpenIntObjectHashMap
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 7 more

It looks like the eclipse plugin correctly adds gwt-dev.jar to the classpath, but not any of its required dependencies...

classpath screenshot

JanecekPetr avatar Jul 31 '18 11:07 JanecekPetr

Be sure gwt-dev is on the classpath for debugging, it contains the super dev mode classes.

branflake2267 avatar Jul 31 '18 15:07 branflake2267

Or the gwt-codeserver, it contains the classes too.

branflake2267 avatar Jul 31 '18 15:07 branflake2267

Oh wait, I forgot, Eclipse ads gwt-dev in launchers classpath without having it on the maven pom.xml config.

So it looks like the gwt compiler doesn't know about 'cern.colt.map.OpenIntObjectHashMap' possibly, so then it's a matter of adding it to the classpath of the GWT compiler in the module descriptor or via build path.

branflake2267 avatar Jul 31 '18 15:07 branflake2267

Eclipse ads gwt-dev in launchers classpath without having it on the maven pom.xml

Exactly. The plugin should add the gwt-dev.jar's dependencies to the classpath, too.

Thank you for your work!

JanecekPetr avatar Jul 31 '18 16:07 JanecekPetr