Here’s the situation:
I got a 6.0.6 liferay portal bundled with Tomcat installation.
I replaced the liferay internal vaadin.jar with the 6.7.1 version of vaadin (renaming the vaadin-6.7.1.jar to ‘vaadin.jar’)
I have multiple working regularly created “vaadin project - portlet2” applications that run simultaneously on this liferay server. So I’m rather sure that part of my setup is working just fine.
Next up I create a maven-web-project.
In this project I add the portlet description xml’s so that I can create my own vaading portlet that is mavenized.
I add a dependency on the vaadin-6.7.1 jar through Maven.
I develop my stuff, it all seems to work fine. I can get the build working, the tests run, the jetty test work, basically all seems fine.
I then copy the war created into my deploy folder in Tomcat and…
08:11:39,536 ERROR [HotDeployUtil:112]
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for Dante-web
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for Dante-web
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:104)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:99)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(PortletContextListener.java:55)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: com.vaadin.terminal.gwt.server.ApplicationPortlet2 cannot be cast to javax.portlet.Portlet
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:123)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:456)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:253)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:101)
... 19 more
as I understand from several google tries, the problem resides in two different versions of vaadin being loaded by my JVM.
Stuff I have tried:
remove maven dependency on vaadin & add the jar as an external jar → compile error
tried changing scope of the vaadin dependency to ‘provided’
1/ the maven-web-project is part of a multi-module maven project.
2/ I have tried & succeeded in creating a maven-vaadin-application project and rework it to a portlet application that is working fine on my liferay installation.
3/ I am willing and able to provide the source code/project directory of the entire maven project (the parent & 3 child projects that is).
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.3.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_4_3_0.dtd">
<liferay-portlet-app>
<portlet>
<!-- Matches definition in portlet.xml. -->
<!-- Note: Must not be the same as servlet name. -->
<portlet-name>Dante portlet</portlet-name>
<instanceable>true</instanceable>
<ajaxable>false</ajaxable>
</portlet>
</liferay-portlet-app>
portlet.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
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">
<portlet>
<portlet-name>Dante portlet</portlet-name>
<display-name>Dante</display-name>
<portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>
<init-param>
<name>application</name>
<value>nl.ou.dante.ui.Dante</value>
</init-param>
<init-param>
<name>style</name>
<value>width:846px; height:600px; padding: 0px 0px 0px 0px</value>
</init-param>
<!-- To enable displaying multiple Vaadin portlets on a page, they should
all use the same widgetset. In that case, the widgetset can be configured
on the portal level (parameter vaadin.widgetset) or here for each portlet. -->
<!-- <init-param> <name>widgetset</name> <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
</init-param> -->
<!-- Supported portlet modes and content types. -->
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<!-- <portlet-mode>edit</portlet-mode> -->
<!-- <portlet-mode>help</portlet-mode> -->
</supports>
<!-- Not always required but Liferay uses these. -->
<portlet-info>
<title>DAnTE - Aanmelden voor Tentamen</title>
<short-title>Dante</short-title>
</portlet-info>
</portlet>
</portlet-app>
The problem is probably caused by a portlet.jar in the WEB-INF/lib in the WAR. it should not be there as it conflicts with the built-in library in the portal. If you need it while compiling your project, you should have it in a separate lib directory that is not included in the WAR.
Note: if you remove the portlet.jar from the project, you should also remove it from webapps/yourproject/WEB-INF/lib/portlet.jar as Tomcat doesn’t remove the file when redeploying. Better yet, delete the entire webapps/yourproject before redeploying.