UnsatisfiedLinkError after update

Hello,

I have been using vaadin in the past with great success and lot of ease since v6.4.3
Lately I have been busy with other projects and let vaadin aside until this morning.
I wanted to set up a quick mock website to prepare for a demo, in eclipse I chose to create a new vaadin proect, it downloaded v6.6.2 and I quickly made a simple version.
After finishing my code I wanted to replace a click on a refresh button with the refresher plugin and compiling the widgetset crashed :

[ERROR]
Unexpected
java.lang.UnsatisfiedLinkError: sun.awt.image.BufImgSurfaceData.initIDs()V
at sun.awt.image.BufImgSurfaceData.initIDs(Native Method)
at sun.awt.image.BufImgSurfaceData.(BufImgSurfaceData.java:49)
at sun.awt.image.CachingSurfaceManager.(CachingSurfaceManager.java:156)
at sun.java2d.d3d.D3DCachingSurfaceManager.(D3DCachingSurfaceManager.java:33)
at sun.java2d.SurfaceManagerFactory.createCachingManager(SurfaceManagerFactory.java:49)
at sun.awt.image.SurfaceManager.getManager(SurfaceManager.java:54)
at sun.java2d.SurfaceData.getDestSurfaceData(SurfaceData.java:123)
[…]
(full stack trace at the end)

After lot of googling I found that it seemed to be a problem with GWT 2.3 and everybody seems to fix it by reverting to 2.2. So I tried using an older vaadin, went all the way back to v6.4.3 but I still couldn’t compile the widget set.
I switched to my previous project and tried to compile it to find out that it was also failling in the same way.
I tried to change to the previous jdk I was using before (1.6u20) and update to the latest.

But nothing seems to fix the problem.

Any idea ?

Full stack trace :
[ERROR]
Unexpected
java.lang.UnsatisfiedLinkError: sun.awt.image.BufImgSurfaceData.initIDs()V
at sun.awt.image.BufImgSurfaceData.initIDs(Native Method)
at sun.awt.image.BufImgSurfaceData.(BufImgSurfaceData.java:49)
at sun.awt.image.CachingSurfaceManager.(CachingSurfaceManager.java:156)
at sun.java2d.d3d.D3DCachingSurfaceManager.(D3DCachingSurfaceManager.java:33)
at sun.java2d.SurfaceManagerFactory.createCachingManager(SurfaceManagerFactory.java:49)
at sun.awt.image.SurfaceManager.getManager(SurfaceManager.java:54)
at sun.java2d.SurfaceData.getDestSurfaceData(SurfaceData.java:123)
at sun.java2d.SunGraphicsEnvironment.createGraphics(SunGraphicsEnvironment.java:377)
at sun.java2d.HeadlessGraphicsEnvironment.createGraphics(HeadlessGraphicsEnvironment.java:76)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1137)
at com.google.gwt.resources.rg.ImageBundleBuilder.toPng(ImageBundleBuilder.java:538)
at com.google.gwt.resources.rg.ImageResourceGenerator.reencodeToTempFile(ImageResourceGenerator.java:643)
at com.google.gwt.resources.rg.ImageResourceGenerator.prepare(ImageResourceGenerator.java:567)
at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1024)
at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1050)
at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.generateIncrementally(AbstractClientBundleGenerator.java:399)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:681)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:285)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:274)
at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:251)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:170)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:285)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:139)
at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:587)
at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:525)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:538)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:492)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:405)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:194)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:164)
at com.google.gwt.dev.GWTCompiler$1.run(GWTCompiler.java:131)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:138)
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.vaadin.tools.WidgetsetCompiler$1.run(WidgetsetCompiler.java:85)
at java.lang.Thread.run(Thread.java:619)
Widgetset compilation failed

I found a fix for that problem.
It looks like the widget compiler does not use the project settings or the current default settings (from window->preferences) to decide which JDK/JRE to compile against.
I don’t know how it makes the selection but I found that removing all JDK entries but the one I wanted to compile against (in window → preferences) was the only way to tell which JDK the compiler should use.

The Eclipse plugin
should
use the project JVM (based on the project classpath, using the default Eclipse API to obtain it) when available. If none is returned, widgetset compilation should then default to the default one selected in window->preferences, and finally the “java” command on the system path if no suitable JVM is configured in Eclipse.

Note, though, that only true JVM installations (that also have bin/java or bin/java.bat) are considered.

If the detection is not working correctly, you can
file a ticket
with information on the Eclipse version used, the installed JREs and what JREs or execution environments are selected for the project and for the workspace.

Thank you, I opened ticket #7254.