GWT 2.6.0 / Java 6: UnsupportedClassVersionError in DevMode

1,361 views
Skip to first unread message

Timo Hoepfner

unread,
Feb 10, 2014, 8:29:29 AM2/10/14
to google-we...@googlegroups.com
Hi,

I recently updated to GWT 2.6.0. Since then I'm getting a UnsupportedClassVersionError in (regular) DevMode at runtime. A regular compile works fine. Explicitly setting the sourceLevel in der DevMode launcher arguments (-sourceLevel 6 or -sourceLevel 1.6) doesn't help. Changing the DevMode JRE to 7 works around the problem. 

I'm using Firefox ESR 24.3.0.

Here's the full error:

14:17:50.548 [ERROR] [ajaxadmin] Unable to load module entry point class com.google.gwt.useragent.client.UserAgentAsserter (see associated exception for details)

java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.useragent.client.UserAgent' (did you forget to inherit a required module?)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
    at com.google.gwt.core.shared.GWT.create(GWT.java:72)
    at com.google.gwt.core.client.GWT.create(GWT.java:86)
    at com.google.gwt.useragent.client.UserAgentAsserter.onModuleLoad(UserAgentAsserter.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.UnsupportedClassVersionError: com/google/gwt/useragent/client/UserAgentImplGecko1_8 : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
    at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1121)
    at com.google.gwt.dev.shell.CompilingClassLoader.loadClass(CompilingClassLoader.java:1194)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java:670)
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:473)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
    at com.google.gwt.core.shared.GWT.create(GWT.java:72)
    at com.google.gwt.core.client.GWT.create(GWT.java:86)
    at com.google.gwt.useragent.client.UserAgentAsserter.onModuleLoad(UserAgentAsserter.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:695)

Is there anything I can do about that?

Thanks for your help,

Timo

Boris Lenzinger

unread,
Feb 10, 2014, 3:43:16 PM2/10/14
to google-we...@googlegroups.com
Hi,

This is because you are executing the code with a JRE that is not compatible with this class version. Probably you are using a 1.6 jre and the class is compatible from 1.7. You have to recompile the code with a 1.6 JDK or you have to change the JRE that is executing the code to a 1.7.

If you are under Eclipse, check the JRE that is used when executing the dev mode. To do so in eclipse, open Run Menu, then Run Configuration and select your launcher. Then check what is the default JRE that is used for running this. The problem may be is there.

Boris


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Timo Hoepfner

unread,
Feb 11, 2014, 12:01:53 PM2/11/14
to google-we...@googlegroups.com
Hi Boris,

the project is configured to use Java 6 and problem occurs when the DevMode JRE is also set to Java 6. There was no JDK 7 configured in Eclipse when the problem first ocured.
The class UserAgentImplGecko1_8 which is causing the problem appears to be generated at runtime. For me it looks like com.google.gwt.dev.shell.CompilingClassLoader is generating Java 7 byte code even when running on a Java 6 JRE (and when -sourceLevel 6 is specified to DevMode).

For now I'm launching DevMode with JRE 7, but it looks like a bug to me…

Timo

Boris Lenzinger

unread,
Feb 11, 2014, 12:21:56 PM2/11/14
to google-we...@googlegroups.com
And which is the default version of java in your shell ? may be eclipse is running with JRE 7 and then compiling with JDK 7.


Thomas Broyer

unread,
Feb 12, 2014, 4:06:20 AM2/12/14
to google-we...@googlegroups.com
I just tried from the command-line (using Maven, and double-checking with both ps and jvisualvm) and can confirm that using a JDK 6, DevMode "just works".
That means it's a problem with how DevMode is launched from (your) Eclipse, possibly a bug in the Google Plugin for Eclipse if that's what you're using, but not a bug in GWT proper.

Timo Hoepfner

unread,
Feb 12, 2014, 5:01:11 AM2/12/14
to google-we...@googlegroups.com
Hi,

I switched the DevMode JRE back to Java 6 and tried to reproduce the problem but I couldn't. It must have been caused by some stale file that escaped my cleaning yesterday but has since been replaced.

Thanks to all of you for the help and sorry for the trouble.

Timo
Reply all
Reply to author
Forward
0 new messages