Portlet doesn't show on liferay Portal

Hello, everyone.
I’m new on using vaadin and I’m having some issues to use it to develop a portlet.
I create a vaadin project 7 on eclipse Kepler, configure it as a portlet and run on a Tomcat 7 server. I don’t make any changes. I just create the project, then I just want to go to the liferay portal, put my portlet in the page to show me the default UI. But when I try to put the portlet on the page, It doesn’t show. Not even the category. Nothing.
I followed the intergration tutorial from the vaadin book, so I could use vaadin 7.
But when I access http://localhost:8080/myprojectname, the default UI shows on the browser.

Someone can help me with this?

Hi,

How, exactly, do you deploy the portlet? You need to make it a WAR and put it in the “deploy” folder in Liferay. You can check the Tomcat log to see that it’s deployed properly. Then, you should be able to add the portlet to a page. The address “http://localhost:8080/myprojectname” is not meaningful for running portlets.

Hi, Marko. Thanks for your answer.
I did what you said, but the portlet is not deploying. The log from Tomcat show me this:

18:30:43,620 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[AutoDeployDir:177]
Processing TestandoPortlet.war
18:30:43,626 ERROR [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[AutoDeployDir:210]
com.liferay.portal.kernel.deploy.auto.AutoDeployException: java.util.zip.ZipException: error in opening zip file
com.liferay.portal.kernel.deploy.auto.AutoDeployException: java.util.zip.ZipException: error in opening zip file
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isMatchingFile(BaseAutoDeployListener.java:87)
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isHookPlugin(BaseAutoDeployListener.java:43)
at com.liferay.portal.deploy.auto.HookAutoDeployListener.deploy(HookAutoDeployListener.java:43)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.processFile(AutoDeployDir.java:193)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.scanDirectory(AutoDeployDir.java:235)
at com.liferay.portal.kernel.deploy.auto.AutoDeployScanner.run(AutoDeployScanner.java:54)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
at java.util.zip.ZipFile.(ZipFile.java:131)
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isMatchingFile(BaseAutoDeployListener.java:72)
… 5 more
18:30:44,627 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[AutoDeployDir:182]
Processing TestandoPortlet.war. This is attempt 2.
18:30:44,628 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[PortletAutoDeployListener:77]
Copying portlets for D:\Desenvolvimento\liferay-portal-6.1.1-ce-ga2\deploy\TestandoPortlet.war
18:30:44,629 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[BaseDeployer:763]
Deploying TestandoPortlet.war
Expanding: D:\Desenvolvimento\liferay-portal-6.1.1-ce-ga2\deploy\TestandoPortlet.war into D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183044694
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183044694\WEB-INF\classes
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183044694\WEB-INF\classes
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183044694\WEB-INF\jsp
18:30:45,482 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[BaseDeployer:2083]
Modifying Servlet 2.4 D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183044694\WEB-INF\web.xml
Copying 20 files to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\TestandoPortlet
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\TestandoPortlet
Deleting directory D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183044694
18:30:45,773 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[PortletAutoDeployListener:87]
Portlets for D:\Desenvolvimento\liferay-portal-6.1.1-ce-ga2\deploy\TestandoPortlet.war copied successfully. Deployment will start in a few seconds.
30/07/2013 18:30:53 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context
[/TestandoPortlet]
18:30:53,255 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]
]][PluginPackageUtil:1033]
Reading plugin package for TestandoPortlet
18:30:53,257 WARN [ContainerBackgroundProcessor[StandardEngine[Catalina]
]][PluginPackageUtil:1131]
Plugin package on context TestandoPortlet cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
30/07/2013 18:30:53 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
30/07/2013 18:30:53 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\TestandoPortlet
18:30:54,353 INFO [pool-2-thread-3]
[HotDeployImpl:178]
Deploying TestandoPortlet from queue
18:30:54,353 INFO [pool-2-thread-3]
[PluginPackageUtil:1033]
Reading plugin package for TestandoPortlet
18:30:54,354 WARN [pool-2-thread-3]
[PluginPackageUtil:1131]
Plugin package on context TestandoPortlet cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
30/07/2013 18:30:56 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
18:32:53,057 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[AutoDeployDir:177]
Processing TestePortlet.war
18:32:53,063 ERROR [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[AutoDeployDir:210]
com.liferay.portal.kernel.deploy.auto.AutoDeployException: java.util.zip.ZipException: error in opening zip file
com.liferay.portal.kernel.deploy.auto.AutoDeployException: java.util.zip.ZipException: error in opening zip file
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isMatchingFile(BaseAutoDeployListener.java:87)
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isHookPlugin(BaseAutoDeployListener.java:43)
at com.liferay.portal.deploy.auto.HookAutoDeployListener.deploy(HookAutoDeployListener.java:43)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.processFile(AutoDeployDir.java:193)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.scanDirectory(AutoDeployDir.java:235)
at com.liferay.portal.kernel.deploy.auto.AutoDeployScanner.run(AutoDeployScanner.java:54)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
at java.util.zip.ZipFile.(ZipFile.java:131)
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isMatchingFile(BaseAutoDeployListener.java:72)
… 5 more
18:32:54,064 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[AutoDeployDir:182]
Processing TestePortlet.war. This is attempt 2.
18:32:54,065 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[PortletAutoDeployListener:77]
Copying portlets for D:\Desenvolvimento\liferay-portal-6.1.1-ce-ga2\deploy\TestePortlet.war
18:32:54,066 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[BaseDeployer:763]
Deploying TestePortlet.war
Expanding: D:\Desenvolvimento\liferay-portal-6.1.1-ce-ga2\deploy\TestePortlet.war into D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183254066
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183254066\WEB-INF\classes
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183254066\WEB-INF\classes
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183254066\WEB-INF\jsp
18:32:54,844 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[BaseDeployer:2083]
Modifying Servlet 2.4 D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183254066\WEB-INF\web.xml
Copying 44 files to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\TestePortlet
Copying 1 file to D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\TestePortlet
Deleting directory D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\temp\20130730183254066
18:32:55,318 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner]
[PortletAutoDeployListener:87]
Portlets for D:\Desenvolvimento\liferay-portal-6.1.1-ce-ga2\deploy\TestePortlet.war copied successfully. Deployment will start in a few seconds.
30/07/2013 18:32:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Desenvolvimento\Servidor\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\TestePortlet
18:32:56,842 INFO [pool-2-thread-4]
[HotDeployImpl:178]
Deploying TestePortlet from queue
18:32:56,842 INFO [pool-2-thread-4]
[PluginPackageUtil:1033]
Reading plugin package for TestePortlet
18:32:56,842 WARN [pool-2-thread-4]
[PluginPackageUtil:1131]
Plugin package on context TestePortlet cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
30/07/2013 18:32:57 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext

I don’t quite know what is happening there. The Zip error may indicate that the WAR is somehow corrupted, but then it apparently does extract files from it…

And the Add → More menu in Liferay doesn’t show the portlet?

The “plugin package” warning is probably not a problem.

The ZIP errors usually come when you are slowly building a ZIP directly in the deploy directory (usually from your IDE, or sometimes e.g. copying a WAR there over a slow network connection) and Liferay decides to try to deploy the incomplete ZIP. Sometimes Liferay also gives up trying to deploy a WAR if this happens multiple times in a row.

The solution, if this happens frequently, is to first generate/copy the WAR to some other directory on the same computer and then move it to the deploy directory (a fast, practically atomic operation).

There is a warning about missing liferay-plugin-package.xml, which isn’t absolutely necessary for portlets but suggests that maybe also some other portlet configuration files are missing and that is why the portlet does not show up on the list.

You could probably also remove the web.xml file from your project if you don’t need it for testing the application in a non-portal environment.

No, it’s not showing in the Add → More menu, Marko.

I exported the project from eclipse to the desktop and , after that, I copied the WAR file to the deploy directory.It resolved the zip error.

I’m still getting the missing liferay-plugin-package.xml error. It’s strange because I created the project using Vaadin Plugin, using the Vaadin 7 project option. Creating the project that way, wouldn’t the project have all the necessary files?

I attached a img that is showing the files in my project and the content in the liferay-plugin-package.properties.

Thanks for your answers, Marko and Henri.
13108.png

As far as I know, if the liferay-plugin-package.xml does not exist, Liferay generates it from the liferay-plugin-package.properties if it needs it. So the error regarding that should not be a problem. I’m getting it too with my test project, with completely fresh Liferay installation (6.1.1-ce-ga2) and an unmodified portlet project created with the wizard with default settings, and it works just fine.

The portlet shows in the menu even without upgrading the VAADIN directory in the portal ROOT/html (Liferay straight out of the box), but it doesn’t work properly before upgrading it.

So it’s odd if it doesn’t work. I hope the Vaadin plugin for Eclipse is up-to-date.