2

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.

VC1
  • 1,660
  • 4
  • 25
  • 42
Ph0en1x
  • 9,943
  • 8
  • 48
  • 97
  • 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 Apr 08 '12 at 21:21
  • as usual I mean pasting to deploy dir. – Ph0en1x Apr 08 '12 at 21:23
  • logs are also ok. I think that the problem is in wrong war, not in liferay, because I deploy other portlets without any troubles – Ph0en1x Apr 08 '12 at 21:40
  • what are you using to build the war? – soulcheck Apr 10 '12 at 11:42
  • 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 Apr 10 '12 at 12:13

3 Answers3

1

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.

Dani
  • 3,744
  • 4
  • 27
  • 35
soulcheck
  • 36,297
  • 6
  • 91
  • 90
  • I remove it from package but it's not help anyway – Ph0en1x Apr 09 '12 at 09:43
  • what does it say in that other log you pasted before? the one which talked about Servlet.class? – soulcheck Apr 09 '12 at 09:45
  • It was not in the log, but in command prompt. Actually today I work on the bit different environment and couldn't reproduce it – Ph0en1x Apr 09 '12 at 10:06
  • @Ph0en1x the one you posted before should be resolved by deleting servlet-api. Maybe there's another dependency provided by the portal inside your war. Check for portlet-api, your database driver if you have one in lib folder of the portal, etc. – soulcheck Apr 09 '12 at 10:10
  • cheeked but without any succeed. I try to remove library until I do not get 09:18:10,267 ERROR [PortletBagFactory:115] java.lang.ClassNotFoundException: com.structuredria.portlet.database.DatabasePortlet – Ph0en1x Apr 09 '12 at 10:14
0

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

Mark
  • 17,887
  • 13
  • 66
  • 93
0

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.

Ph0en1x
  • 9,943
  • 8
  • 48
  • 97