Packing many portlets in the same war

I am trying put two portlet to one war file, but I can get work in liferay. Is it on vaadin side any limitation to do this. I only want share few class instances for both portlet.

There is no limitation in Vaadin for this. The
Vaadin demo.war
included in the distribution contains several portlets. Take a look at that for an example.

Have tried to deploy the demo war:
That contains several portlets.

Actually earlier there was problems with the Liferay and potlets in separate wars. To avoid this.make sure you are using the latest Vaadin version (currently 6.1.1). This problem did not affect several portlets within the same war, that should work.


It would also be easier to help if you provided a little more information - at what point does it fail, how?

Best Regards,

I downloaded vaadin-demo.6.1.1.war and added to liferay 5.2.3. After that I added PortletDemo and Calc portlets.
Everything went fine expect both portlets was empty (there is no any content inside portlet).

Same problem was my own portlet war. It support one portlet after change servlet mapping point to /* in web.xml.
For example I have two portlet configured in web.xml and both portlets is empty



when change mapping like below…


Servlet Test1 work fine but Test2 is actually Test1 portlet

Anyone ideas for vaadin-demo.war problem?

No error about a missing widgetset?
(There is a 30sec or so delay before warning is show)

For me, this seems like nothing is loaded (by nothing I here mean the widgetset or themes).

This in turn means that there is something wrong with the static resources URL. Do you have a FireBug or similar to catch the source of the empty portlets in picture. Just to make sure what is going on there…

I’m guessing here but:

It tries to look for an URL like “/test1/VAADIN/…” That is not found and nothing static resources area loaded.

In the case you change the servlet mapping to /* it works because then everything under /test1/* goes to the same servlet and also resources are served as they should. The unwanted side effect is that you cannot have two portlets in the same war.

You can test this: Try adding mapping for /VAADIN also into web.xml and make it point to the first servlet.

I’ll check what is wrong with the demo war.

Another thing would be if you have tested the servlets by directly opening the url, you might have a separate JSESSIONID-cookie for the servlets. This will break the portlets and might cause them to be empty. The session must be the same for the portal and the servlets. So, do not visit the servlet directly and if you still do, verify that you do not have more than one session cookie in your browser (simplest way is to clear the cache, including cookies and try again).

i have the same problem.
i installed the eclipse plugin, created a new project with test (Hello vaadin user) application.
as long as the servlet is mapped to /* everything works fine (even without defining portlet.xml etc),
but as soon as i change the mapping, it shows me just an empty portlet…
the servlet itself is working tho.
i tried with and without vaadin installed to liferay (i got the mail-portlet running, so i think i installed it right)
and with and without the vaadin.jar in the webapp.
i tried the trick with clearing the cache, still empty portlet…


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="2.5">
  	<description>Vaadin production mode</description>
  		Vaadin application class to start</description>


<?xml version="1.0" encoding="UTF-8"?>
        version="1.0" xmlns:xsi=""


<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.3.0//EN" "">



<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 4.0.0//EN" "">

        <category name="Vaadin">
                <portlet id="1" />

sorry for all those spam, but as i dont have any clue, where the mistake is, i wanted to post the complete stuff (only cutted out the welcome file list and role sections, as i really can’t imagine that the error is in there)
i hope i didn’t missed something important…
again, as soon as i change [quote]
[/quote] to [quote]

[/quote] everything works…


i forgott to mention, that when i installed vaadin to liferay and don’t place the vaadin.jar in the web-inf/lib folder of the webapp, i can’t deploy it. it can’t find the com.vaadin.terminal.gwt.server.ApplicationPortlet class then.
but the mail-portlet deploys without errors and it uses the ApplicationPortlet class too, so i don’t know why this error occurs.

You have a case mismatch there. The application parameter for the portlet must be the URL the servlet is listening to, not the servlet name. So change it to vaadintest and see if it starts working.

If you are using 6.1.0/6.1.1 there is a bug which forces you to install the vaadin.jar into Liferay. Try the latest nightly to avoid this. Otherwise you will get a “widgetset not found” if you wait a while as it always tries to load it from the Liferay installation and not from the servlet. Vaadin 6.1.2 with a fix for this will also be released tomorrow if you can wait that long :slight_smile:

I don’t understand? In Book of Vaadin chapter 11.8.2 learn to use servelet name in application parameter.

      <!-- Must match the servlet name in web.xml. -->

I tested vaadin 6.1.2 but same problem. No portlet and widgetset not found error message. 6.1.2 is inside war file and I deployed to liferay/deploy folder

This was my own mistake. I missed add one dependency library.

This is an unfortunate error in the Book of Vaadin and will be corrected asap. If you use our Eclipse plugin you will get all the files set up automatically for you.

Thank you very much for your help! I got it working now. The onlything that confuses me, is that if i map the servlet to /*, i dont leave the application param empty or use / there, i put the servlet-name into it…
But anyway, i got it working now and thats the important thing :slight_smile: Thank you again