Vaadin, eclipse and jetty

Hi,

I’m new to both Vaadin and webapp development (so please bear with me)…

I recently got Vaadin installed via Eclipse (i.e. the Vaadin Eclipse plugin). I’m managed to get a “hello world” app up and running on Tomcat.

However, I would like to use Jetty as my app server. I’ve tried installing Jetty and then setting up the eclipse->preferences->servers->runtime environement options.

However, the eclipse runtime servers option only seems to support Jetty 6. I’ve tried installing Jetty 6, 7 and 8 (and using the eclipse jetty server configuration to point to my jetty install directory), but I keep getting an error when I try to run my app using Jetty.

The error I get in the eclipse run window is “the server does not support version 3 of the J2EE web module specification”.

I believe Jetty 8 does support version 3. However, I suspect the problem is that the eclipse jetty server runtime option (which only seems to support 6) might be the problem.

Does anyone have any suggestions how I can get Vaadin, Eclipse and Jetty to play nice together?

Thanks!

(ps, I recently upgraded my browser to IE 9 beta, and I noticed that my webapp no longer works in IE (when using Tomcat)).

If the version you want to use is not supported directly by Eclipse, it might be easier to write a little launcher application that starts up an embedded Jetty instance. See e.g.
this forum post
for the launcher class contents. Also hot code replace etc. works with this, you just need to manage starting and stopping the server as an application rather than as a server in Eclipse.

With other servers, this would be more complicated - resources may need to be copied at server start and resource update etc. - but with Jetty this works quite nicely.

GWT does not support IE9 (yet), so you would need to force IE9 to IE8 compatibility mode - this will be done automatically in Vaadin 6.4.5 (
ticket 5607
).

See the
GWT issue 5125
for the status on GWT side - and note that some more work will be required in Vaadin after GWT gets this working (tracked at least in part in
ticket 5546
).

Thanks for the response Henri.

I have no preference for a particular version of Jetty, so if there’s a specific version that will work with the default Eclipse and Vaadin setup, then I’m happy to use that.

If there isn’t a specific version that works with the default setup, then I can try what you outlined above.

Thanks again!

The issue with the “default setup” is that in some sense, there is no such thing from the point of view of the Vaadin Eclipse plugin - a Vaadin project is a dynamic web project with the Vaadin facet added to it and some other customizations in the project creation wizard, and it requires at least a certain version of the dynamic web facet. Given this constraint, however, it is the plugin providing Dynamic Web Project that decides which version of the Dynamic Web Facet is used by default. Whether e.g. 3.0 is correct or not depends on what features of the servlet API you want to use and what server you are going to run the application on.

As a side note, even the same version and same installation package type of Eclipse seem to sometimes provide different defaults on different computers with respect to the version of that facet, or at least have done so in the past - I never investigated this deeper.

The facet version can be selected on the Vaadin project creation page (Configuration → Modify…), but I admit most users will probably miss it. Maybe it would be possible for the Vaadin Eclipse plugin to “hard-code” some configurations, but this might limit the support for future versions of the dynamic web facet.