2
votes

I have a sources of existing portlet. I changed it a bit to fix some errors and now I need to deploy fixed sources to liferay. I build war file using artifact option and deploy this war file as usual. But I still can't add my portlet on the page because I do not see it in the list. What am I doing wrong?

I use Idea 11.1 and liferay 6.0.6 if it's important.

Seems like problem with wrong war file, because others war files (which I did not compile myself) was deployed successfully.

And also, if it's important I created war files when building artifact, and do not use Ant.


logs:

09:37:09,430 INFO  [PortletAutoDeployListener:71] Copying portlets for D:\odesk_work\liferay\liferay-portal-6.0.6\deploy\Comply-Activities-portlet-6.0.5.2.war
  Expanding: D:\odesk_work\liferay\liferay-portal-6.0.6\deploy\Comply-Activities-portlet-6.0.5.2.war into D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\temp\20120409093709483
  Copying 1 file to D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\temp\20120409093709483\WEB-INF
  Copying 1 file to D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\temp\20120409093709483\WEB-INF\classes
  Copying 1 file to D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\temp\20120409093709483\WEB-INF\classes
  Copying 1 file to D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\temp\20120409093709483\META-INF
  Copying 119 files to D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\webapps\Comply-Activities-portlet
  Copying 1 file to D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\webapps\Comply-Activities-portlet
  Deleting directory D:\odesk_work\liferay\liferay-portal-6.0.6\tomcat-6.0.29\temp\20120409093709483
09:37:12,456 INFO  [PortletAutoDeployListener:81] Portlets for D:\odesk_work\liferay\liferay-portal-6.0.6\deploy\Comply-Activities-portlet-6.0.5.2.war copied successfully. Deployment will start in a few seconds.

looks like it crash when deploying it. becouse when I try to deploy valid portlet there are some additional info in logs like

09:13:37,874 INFO  [PortletHotDeployListener:220] Registering portlets for Comply-Activities-portlet
09:13:37,976 INFO  [PortletHotDeployListener:369] 1 portlet for Comply-Activities-portlet is available for use

UPD: Maybe someone will provide me with instruction how to build *.war properly? I think it will be enough.

3
Is "as usual" you deploy it "as usual to your app server" or "as usual through Liferay's deploy directory"? What do you see in the log file? Any problems? "1 portlet for ...your plugin... ready for use"?Olaf Kock
as usual I mean pasting to deploy dir.Ph0en1x
logs are also ok. I think that the problem is in wrong war, not in liferay, because I deploy other portlets without any troublesPh0en1x
what are you using to build the war?soulcheck
Initially I build this file creating war artifact with IDEA artifacts. But now I build it with Ant and it works. But i think it possible to make it work using IDEA sources only, but I'm such a busy now that have no time to check my idea.Ph0en1x

3 Answers

1
votes

Make sure liferay-display.xml is in the WEB-INF directory in your war and that it's content is ok.

It should contain something like this:

<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 5.2.0//EN"     "http://www.liferay.com/dtd/liferay-display_5_2_0.dtd">

<display>
<category name="${liferay.category}">
    <portlet id="yourPortletID" />
    <portlet id="yourPortletID2" />
            <!-- more portlet ids -->
</category>
</display>

Maybe the build system is missing it when it creates war.

If not, put it in there manually and see if that works.

edit

Ok. Now having more information it looks like you're including servlet-api in your war. That jar (and classes inside it) are provided by portal (or, more specifically by the servlet container). The same goes for portlet-api. You shouldn't include them in the deployed application.

Check if those dependencies are specified as <scope>provided</scope> in your pom.xml.

0
votes

Try first undeploy the portlet from bundles/tomcat/webapps - delete the portlet dir. And then deploy the portlet again.

0
votes

Build project with ant, create war and now it works. But maybe it possible to do that without using ant, only with IDEA. I need to check it.