Vaain & Liferay - Multiple portlets in one portlet.xml

Hi,

i got some questions about using vaadin with liferay and how to setup multiple portlets in one war, because at the moment i’m facing a strange problem. I’ve defined two portlets in my portlet.xml which looks like this:

<?xml version="1.0"?>

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">
	<portlet id="intro">
		<portlet-name>intro</portlet-name>
		<display-name>intro</display-name>
		<portlet-class>de.xyz.application.SpringApplicationPortlet</portlet-class>
		<init-param>
			<name>view-template</name>
			<value>dde.xyz.ui.VaadinApplication</value>
		</init-param>
		<init-param>
			<name>application</name>
			<value>de.xyzui.VaadinApplication</value>
		</init-param>
		<expiration-cache>0</expiration-cache>
		<supports>
			<mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
            <portlet-mode>config</portlet-mode>
            <portlet-mode>edit</portlet-mode>
		</supports>
        <supported-locale>de</supported-locale>
        <supported-locale>en</supported-locale>
		<portlet-info>
			<title>Intro</title>
            <short-title>Intro</short-title>
			<keywords>Intro</keywords>
		</portlet-info>
		<security-role-ref>
			<role-name>administrator</role-name>
		</security-role-ref>
		<security-role-ref>
			<role-name>guest</role-name>
		</security-role-ref>
		<security-role-ref>
			<role-name>power-user</role-name>
		</security-role-ref>
		<security-role-ref>
			<role-name>user</role-name>
		</security-role-ref>
	</portlet>
	<portlet id="pilot">
		<portlet-name>pilot</portlet-name>
		<display-name>Pilot</display-name>
		<portlet-class>de.xyz.application.SpringApplicationPortlet</portlet-class>
		<init-param>
			<name>view-template</name>
			<value>de.xyz.ui.VaadinApplication</value>
		</init-param>
		<init-param>
			<name>application</name>
			<value>de.xyz.ui.VaadinApplication</value>
		</init-param>
		<expiration-cache>0</expiration-cache>
		<supports>
			<mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
            <portlet-mode>config</portlet-mode>
            <portlet-mode>edit</portlet-mode>
		</supports>
        <supported-locale>de</supported-locale>
        <supported-locale>en</supported-locale>
		<portlet-info>
			<title>pilot</title>
            <short-title>pilot</short-title>
			<keywords>Pilot</keywords>
		</portlet-info>
		<security-role-ref>
			<role-name>administrator</role-name>
		</security-role-ref>
		<security-role-ref>
			<role-name>guest</role-name>
		</security-role-ref>
		<security-role-ref>
			<role-name>power-user</role-name>
		</security-role-ref>
		<security-role-ref>
			<role-name>user</role-name>
		</security-role-ref>
	</portlet>
</portlet-app>

“Intro” should create me an intro view on a specific site, “pilot” should create me a more navigator like view on another site. But currently i’m facing the problem that only one view is created on both sites. The view itself depends on which site was called first for e.g. after deployment to liferay.
For example if i call the site with the portlet on it which creates the “navigator”-view as the first call to the website after the deployment, the “navigator”-view will be shown also on the intro site.

Currently i’m not sure, what causes these problems, but i pretend its the call to the

...
de.xyz.application.SpringApplicationPortlet
...

which uses a spring context to bring up the application and creates every bean as a singleton, even the application-bean, or

...
		<init-param>
			<name>view-template</name>
			<value>dde.xyz.ui.VaadinApplication</value>
		</init-param>
.. 

which is used as application class for every portlet.

Can anyone point me to the right direction and tell me what i have to change to make the portlets work correctly?

I currently don’t want to split both portlets in separate war-files because they should use the same ui-components and also some ressources together.

I’m using:

liferay 6.1
vaadin-api 1.0.0-GA
and Spring 3.0.6

Thanks for any help.

Greetings

Udo

I want to know. please answer this question.