The relevant versions for this post are: Eclipse Helios, Vaadin 6.6.0
As a run-up to my upcoming dissertation, I’ve started to play about with Vaadin, the Java based UI framework. I started with Netbeans and the Vaadin plug-in, and whilst it’s competent, compiling widgets (Vaadin’s equivalent to plug-ins/addons) was a headache.
Reading through the Vaadin documentation, it’s very much (read: almost completely) geared towards development within Eclipse. I’m a big Netbeans fan/convert, so having to move back to using Eclipse for anything is something I never look forward to.
The one benefit of using Eclipse was supposedly the automatic compilation of ‘Widgetsets’. Unfortunately I had some problems when trying to compile my custom widgets (the excellent treetable widget to be specific), and would receive the following error:
SEVERE: Widgetset compilation failed
java.lang.ClassNotFoundException: com.google.gwt.dev.GWTCompiler
at java.net.URLClassLoader$1.run(Unknown Source)
Both the gwt-dev and gwt-user libraries were added (as part of the plug-in) and show as such within the libraries tree branch.
If I remove them, and try and add gwt-dev and gwt-user manually (after downloading them direct from Google), the compiler starts, but then would complain in the following way:
Compiling widgetset com.example.learningvaadin.widgetset.LearningvaadinWidgetset
Updating GWT module description file…
29-May-2011 00:17:40 com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Widgetsets found from classpath:
com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:C:/Users/Luke/workspace/LearningVaadin/WebContent/WEB-INF/lib/vaadin-6.6.0.jar!/
com.example.learningvaadin.widgetset.LearningvaadinWidgetset in file://C/Users/Luke/workspace/LearningVaadin/src
com.vaadin.addon.treetable.TreetableWidgetset in jar:file:C:/Users/Luke/workspace/LearningVaadin/WebContent/WEB-INF/lib/vaadin-treetable-1.2.0.jar!/
29-May-2011 00:17:40 com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Search took 5ms
Done.
Starting GWT compiler
Compiling module com.example.learningvaadin.widgetset.LearningvaadinWidgetset
Validating newly compiled units
[ERROR] Errors in ‘jar:file:/C:/Users/Luke/workspace/LearningVaadin/WebContent/WEB-INF/lib/vaadin-6.6.0.jar!/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java’
[ERROR] Line 170: The method scheduleDeferred(Scheduler.ScheduledCommand) in the type Scheduler is not applicable for the arguments (new Command(){})
[ERROR] Line 177: The method scheduleDeferred(Scheduler.ScheduledCommand) in the type Scheduler is not applicable for the arguments (new Command(){})
[ERROR] Line 208: The method scheduleDeferred(Scheduler.ScheduledCommand) in the type Scheduler is not applicable for the arguments (new Command(){})
……..
I resolved the problem by carrying out the following steps:
- Downloaded the latest GWT SDK from Google
- Removed the existing gwt-dev and gwt-users libraries that were added by the Vaadin Eclipse plugin, and added the new ones
- Project > Properties > Java Class Path
- Highlight the two libs (VAADIN_DOWNLOAD/…/gwt-dev.jar and VAADIN_DOWNLOAD/../gwt-user.jar), and click remove
- Click ‘Add External JAR’, navigate to where you’ve extracted the GWT SDK and select both gwt-dev.jar and gwt-user.jar
- Order and Export tab, check both tickboxes for the two libraries and move them to the top of the list
- Added the vaadin-treetable-1.2.0.jar to the WEB-INF/lib folder
- Refreshed the project, clicked OK when prompted to recompile widgetsets
And that was that – the widget sets should now compile
This information was also posted over at the Vaadin forums, where another poster (perhaps a Vaadin developer?) suggested another solution