Run Vaadin portlet in Eclipse

Hello everybody,

I would like to create a Vaadin portlet with Eclipse Helios. But when my portlet is created, I can’t run it on a tomcat server.

I created a new Vaadin Project
→ Target runtime : Apache Tomcat v6.0
→ Configuration : Default Configuration for Apache Tomcat v6.0
→ Deployment configuration : Generci portlet (Portlet 2.0)
→ Vaadin version : 6.5.0
→ Finish
Then I clicked right on the project → Run as → Run on server
An error page appeared in the internal webbrowser : HTTP 404 The resource (/portlet_name/) is not available.


No idea of how to run a vaadin portlet 2.0 in eclipse ?


I have the same problem. The URL that it navigates you to is not the correct URL for a portlet. I usually ignore the Eclipse internal web browser and use the external browser of my choice. Navigate to your main portal page. From there, you can add your portal to a page and go. Once it is added, you won’t have to re-add it; you can just run with the changes. In Eclipse, if you start your server in debug mode, it will still hit your breakpoints even if you use an external browser like this.

When you save changes to your portlet, they are hot deployed if they can be. Eclipse should warn you when hot-deploy fails, in which case you can restart the portal server.

But is there a way to execute a Vaadin portlet in Eclipse ? Or is my 404 normal ?

I have found the solution :
The execution of the portlet has to be done in a servlet. Eclipse generates everything when we create a new vaadin project. We have just to modify the URL :

A JSR-286 (Portlet 2.0) portlet cannot be executed outside a portlet container. You have to run a portlet container such as Liferay or GateIn in your Tomcat (or other server) and access the portlet by adding it on a portal page and then viewing that page.

However, if your portlet does not have any dependencies on portlet specific APIs (or if you have encapsulated them behind conditional execution), you usually can run the same application as a servlet, which is usually also much faster for testing (no overhead from portlet container etc.). Just create a web.xml for that. If I remember correctly, the Eclipse plugin generates one for ease of testing even for portlet projects.

Hello, I would understand if you can view a portlet that is on one of my servers within liferay that resides on another server. I ask this because I want to avoid to deliver my projects to other people on other servers that are not mine.