wood burning stoves
The moose likes Portals and Portlets and the fly likes Deploying a Portlet - NullPointer Blues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Deploying a Portlet - NullPointer Blues" Watch "Deploying a Portlet - NullPointer Blues" New topic

Deploying a Portlet - NullPointer Blues

Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Hey all,

So I've been working on this portlet, installing it into Liferay 5.2 at each new piece of functionality to test as I go.

On the last installation, I got this error:

Expanding: /Data/liferay-portal-5.2-ee-sp5/deploy/wbservicecatalog-portlet.war into /Data/liferay-portal-5.2-ee-sp5/tomcat-6.0.29/temp/20110513170938581
Copying 1 file to /Data/liferay-portal-5.2-ee-sp5/tomcat-6.0.29/temp/20110513170938581/WEB-INF
Copying 1 file to /Data/liferay-portal-5.2-ee-sp5/tomcat-6.0.29/temp/20110513170938581/WEB-INF/classes
Copying 1 file to /Data/liferay-portal-5.2-ee-sp5/tomcat-6.0.29/temp/20110513170938581/WEB-INF/classes
Copying 1 file to /Data/liferay-portal-5.2-ee-sp5/tomcat-6.0.29/temp/20110513170938581/META-INF
at com.liferay.portal.deploy.auto.WAIAutoDeployer.copyXmls(WAIAutoDeployer.java:64)
at com.liferay.portal.tools.deploy.BaseDeployer.deployDirectory(BaseDeployer.java:483)
at com.liferay.portal.tools.deploy.BaseDeployer.deployFile(BaseDeployer.java:792)
at com.liferay.portal.tools.deploy.BaseDeployer.deployFile(BaseDeployer.java:729)
at com.liferay.portal.tools.deploy.BaseDeployer.deploy(BaseDeployer.java:451)
at com.liferay.portal.deploy.auto.PortletAutoDeployer.autoDeploy(PortletAutoDeployer.java:93)
at com.liferay.portal.deploy.auto.PortletAutoDeployListener.deploy(PortletAutoDeployListener.java:80)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.processFile(AutoDeployDir.java:182)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.scanDirectory(AutoDeployDir.java:223)
at com.liferay.portal.kernel.deploy.auto.AutoDeployScanner.run(AutoDeployScanner.java:51)
17:09:38,864 INFO [PortletAutoDeployListener:83] Portlets for /Data/liferay-portal-5.2-ee-sp5/deploy/wbservicecatalog-portlet.war copied successfully. Deployment will start in a few seconds.

I saw this JIRA on the issue at Liferay:Liferay JIRA

But that wasn't helpful. I haven't changed any of the file structure since my last successful portlet deployment. I haven't edited any of the .XML configuration files either.

Googling this brings back nothing but that JIRA, so I'm curious as to whether any of you guys have seen this or if I'm just finding unique ways to break my portlets...

Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Well my tradition of figuring out the problem within minutes of posting a question seems to be holding.

Turns out my portlet.xml file had, in fact, been deleted somehow. I don't know how, maybe I fat-fingered the delete key at the wrong moment or something.

You know, as part of tracking down this problem I went through the Liferay source code and it occurs to me that it would be simplicity itself for them to have thrown a more useful error message than the ubiquitous Java.lang.NullPointerException. Almost every one of those methods in the stack trace has the file as a parameter and the filenames it looks for are hard coded.

C'mon, guys at Liferay couldn't you have tossed the expected filename out in a custom error?
I agree. Here's the link: http://aspose.com/file-tools
subject: Deploying a Portlet - NullPointer Blues
It's not a secret anymore!