Integrating Vaadin UI components into existing GWT project

Hi All,
I’m a bit new to Vaadin. Been reading the book of Vaadin and trying to figure out how (or if) I can integrate just the Vaadin UI components into an existing GWT project. I thought it would have been as simple as having the correct inherit tag and copying the VAADIN subdirectory to my deployment. But this doesn’t seem to work as I get the following runtime error:

ERROR] Unable to load module entry point class com.vaadin.terminal.gwt.client.DefaultWidgetSet (see associated exception for details)
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at com.vaadin.terminal.gwt.client.ApplicationConfiguration.initConfigurations(ApplicationConfiguration.java:119)
at com.vaadin.terminal.gwt.client.DefaultWidgetSet.onModuleLoad(DefaultWidgetSet.java:69)
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:585)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:326)
at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:343)
at com.google.gwt.dev.shell.mac.BrowserWidgetSaf.access$400(BrowserWidgetSaf.java:35)
at com.google.gwt.dev.shell.mac.BrowserWidgetSaf$ExternalObject.gwtOnLoad(BrowserWidgetSaf.java:82)
at com.google.gwt.dev.shell.mac.BrowserWidgetSaf$GwtOnLoad.invoke(BrowserWidgetSaf.java:171)
at org.eclipse.swt.internal.carbon.OS.ReceiveNextEvent(Native Method)
at org.eclipse.swt.widgets.Display.sleep(Display.java:3801)
at com.google.gwt.dev.SwtHostedModeBase.sleep(SwtHostedModeBase.java:241)
at com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:236)
at com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:558)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)

Has anyone seen this before? I’m using GWT 1.7. The inherit tag is as follows:

Thanks.

I may be mistaken, so please correct me if Im wrong, but Im afraid you cannot easily use Vaadin components in an existing pure GWT application - Vaadin controls heavily depends on the server side, so they are not just a set of buttons, tables, etc, they all want perform server communications with the Vaadin application servlet and application instance, running at the server side.

I think you are correct. Vaadin client-side components integrate server communication and GWT-functionality very tightly. It is possible to separate these two, but it wont be easy. The other way around should be quite doable though - integrating existing GWT-components in to Vaadin.

Yeah, the current set of Vaadin GWT components are generally not made to be used without the serverside.
What happens above is that the widgetset entry point is trying to set up the communication with the server, but the information needed is missing.

In principle the components are plain GWT components with just an added updateFromUIDL() -method, but in practice most components currently have a lot of logic in that method, making it difficult to use w/o.

We’ve been planning to make the components more independent, but it’s not been on the top of the list - some components might be made so that they are usable as plain GWT components (mostly recent incubator components), but this is not generally true.

Also, if you want to use a specific component, and it seems feasible to use w/o updateFromUIDL(), you’re better off copying just that component instead of the whole widgetset.
My guess, though, is that it’s not worth it at the moment - you’re much better off just adopting the whole Vaadin stack :slight_smile:

Best Regards,
Marc

Vaadin 6.0.1 is uses on GWT 1.6.4. The next release, 6.1.0, will be using GWT 1.7.0. Thus, if you would like to stick with GWT 1.7, you might want to use 6.1 series nightly builds that can be found in http://vaadin.com/download/nightly/6.1/