« Back to Using Liferay

Plugin Deployment Troubleshooting

The purpose of this article is to document the typical errors that are often found when deploying themes, layout templates and portlets to Liferay.

Unable to process deployment descriptor for context 'null' #

Check that you've deployed the WAR file to Liferay's autodeploy directory and not to the deploy directory of the application server directly.

By default Liferay's autodeploy directory will be in: $USER_HOME/liferay/deploy (assuming 'your-user' is the name of the user that runs Liferay). $USER_HOME is /home/your-user in UNIX based systems such as Linux and MacOS and c:\Document and Settings\your-user in Windows.

You can change the directory in Plugin Installer portlet -> Configuration (version 4.3), Admin porttlet (4.1, 3.6. etc.) or in portal-ext.properties file.

It is absolutely essential that the paths are correct, you have access to them and that you deploy (copy the war) into the Deploy Directory, not into Destination Directory .

The WAR disappears but it's not available to the portal #

This means that there has been an error during the deployment process. The WAR is removed so that Liferay does not get into a loop trying to deploy it again and again.

To find out which was the error take a look at the logs of the application server. On Jboss logs could be found at server/default/log/server.log

ERROR [portal-web.docroot.html.portal.render_portlet.jsp] java.lang.NullPointerException #

You can get an exception like this:

ERROR [portal-web.docroot.html.portal.render_portlet.jsp] java.lang.NullPointerException

      at com.liferay.portlet.CachePortlet._invoke(CachePortlet.java:289)
      at com.liferay.portlet.CachePortlet.render(CachePortlet.java:153)
      at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:674)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

It happens if you try to deploy the portlet, and it is not fully deployed before you update the page that contains that portlet. To avoid that you need to fully deploy portlet before updating the page. You can observe the deployment process in the logs or just give it some time, one minute is usually sufficient. To get rid of the error you need to rebuild your war and deploy it again.

Absolute vs. Relative Path #

By default the Destination Directory is ../server/default/deploy which is a relative path. It starts from your /bin folder in JBoss/Tomcat where the startup script is located. If you want to start it from some other place you need to use absolute path instead of relative.

“Incorrect zip format” exception #

Sometimes liferay starts deployment before the file is fully copied. You would get “Incorrect zip format” exception. You just need to update the timestamp on the war or rebuild it and deploy again to fix this problem. It might only apply to older versions of Liferay 4.1 and older.

Log shows that the portlet was copied, but it doesn't appear in the list #

You get something like:

 14:07:32,029 INFO [STDOUT] 14:07:32,028 INFO [AutoDeployDir:76] Processing sample-test-portlet-4.3.3.1.war
 14:07:32,029 INFO [STDOUT] 14:07:32,029 INFO [PortletAutoDeployListener:77] Copying portlets for /home/jboss/liferay/deploy/sample-test-portlet-4.3.3.1.war
 14:07:32,031 INFO [STDOUT] 14:07:32,030 INFO [BaseDeployer:482] Deploying sample-test-portlet-4.3.3.1.war
 14:07:32,034 INFO [STDOUT] Expanding: /home/jboss/liferay/deploy/sample-test-portlet-4.3.3.1.war into /tmp/20071029140732032
 14:07:32,052 INFO [STDOUT] Copying 1 file to /tmp/20071029140732032/WEB-INF
 14:07:32,105 INFO [STDOUT] Copying 1 file to /tmp/20071029140732032/WEB-INF
 14:07:32,133 INFO [STDOUT] 14:07:32,132 INFO [BaseDeployer:992] Modifying Geronimo /tmp/20071029140732032/WEB-INF/geronimo-web.xml
 14:07:32,151 INFO [STDOUT] 14:07:32,150 INFO [BaseDeployer:1038] Modifying Servlet 2.3 /tmp/20071029140732032/WEB-INF/web.xml
 14:07:32,168 INFO [STDOUT] Copying 22 files to /opt/jboss-4.2.1.GA/bin/../server/default/deploy/sample-test-portlet.war
 14:07:32,181 INFO [STDOUT] Copying 1 file to /opt/jboss-4.2.1.GA/bin/../server/default/deploy/sample-test-portlet.war
 14:07:32,181 INFO [STDOUT] Deleting directory /tmp/20071029140732032
 14:07:32,184 INFO [STDOUT] 14:07:32,183 INFO [PortletAutoDeployListener:87] Portlets for /home/jboss/liferay/deploy/sample-test-portlet-4.3.3.1.war copied successfully

you don't see the portlet appearing in the list of available portlets after that. It doesn't mean that the portlets were deployed, it means something went wrong. Most likely it is this path: /opt/jboss-4.2.1.GA/bin/../server/default/deploy/ that is wrong. It is relative and could be referencing incorrect path, change the Destination Path to absolute and it should deploy without problems. You would see something like this when deploying:

 17:22:33,765 INFO  [AutoDeployDir] Processing sample-portal-client-portlet-4.3.3.1.war
 17:22:33,765 INFO  [PortletAutoDeployListener] Copying portlets for C:\jboss\autodeploy\sample-portal-client-portlet-4.3.3.1.war
 17:22:33,765 INFO  [BaseDeployer] Deploying sample-portal-client-portlet-4.3.3.1.war
 17:22:33,859 INFO  [STDOUT]   Expanding: C:\jboss\autodeploy\sample-portal-client-portlet-4.3.3.1.war into C:\DOCUME~1\rhoyenko\LOCALS~1\Temp\20071030172233765
 17:22:34,156 INFO  [STDOUT]   Copying 1 file to C:\DOCUME~1\rhoyenko\LOCALS~1\Temp\20071030172233765\WEB-INF
 17:22:34,468 INFO  [STDOUT]   Copying 1 file to C:\DOCUME~1\rhoyenko\LOCALS~1\Temp\20071030172233765\WEB-INF
 17:22:35,125 INFO  [BaseDeployer] Modifying Geronimo C:\DOCUME~1\rhoyenko\LOCALS~1\Temp\20071030172233765\WEB-INF\geronimo-web.xml
 17:22:35,219 INFO  [BaseDeployer] Modifying Servlet 2.3 C:\DOCUME~1\rhoyenko\LOCALS~1\Temp\20071030172233765\WEB-INF\web.xml
 17:22:35,297 INFO  [STDOUT]   Copying 21 files to C:\jboss\server\default\deploy\sample-portal-client-portlet.war
 17:22:35,500 INFO  [STDOUT]   Copying 1 file to C:\jboss\server\default\deploy\sample-portal-client-portlet.war
 17:22:35,515 INFO  [STDOUT]   Deleting directory C:\DOCUME~1\rhoyenko\LOCALS~1\Temp\20071030172233765
 17:22:35,578 INFO  [PortletAutoDeployListener] Portlets for C:\jboss\autodeploy\sample-portal-client-portlet-4.3.3.1.war copied successfully
 17:22:36,750 INFO  [TomcatDeployer] deploy, ctxPath=/sample-portal-client-portlet, warUrl=.../deploy/sample-portal-client-portlet.war/
 17:22:37,141 INFO  [PluginPackageHotDeployListener] Reading plugin package for sample-portal-client-portlet
 17:22:37,547 INFO  [PluginPackageHotDeployListener] Plugin package liferay/sample-portal-client-portlet/4.3.3.1/war registered successfully
 17:22:37,562 INFO  [PortletHotDeployListener] Registering portlets for sample-portal-client-portlet
 17:22:37,625 INFO  [PortletHotDeployListener] Portlets for sample-portal-client-portlet registered successfully

NullPointerException from Log4j #

This is caused by what seems to be a bug in Tomcat. It's been notified by the Log4j developers to the Tomcat developers but for some reason it's not being fixed.

Fortunately there is a workaround. Run Tomcat with the following option:

 -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false

This will be the default option in bundles from version 5.1

BeanLocator is not set #

This error appears when the plugin uses ServiceBuilder and Spring has not been initialized correctly. Make sure the web.xml file of the plugin has a similar code to:

	<context-param>
		<param-name>contextClass</param-name>
		<param-value>com.liferay.portal.spring.context.PortletApplicationContext</param-value>
	</context-param>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>WEB-INF/classes/META-INF/data-source-spring.xml,WEB-INF/classes/META-INF/portlet-spring.xml,WEB-INF/classes/META-INF/ext-spring.xml</param-value>
	</context-param>
	<listener>
		<listener-class>com.liferay.portal.kernel.spring.context.PortletContextLoaderListener</listener-class>
	</listener>

See Also #

0 Attachments
38111 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments
Threaded Replies Author Date
I am using SDK 6.05 but my portal code is... ilke Muhtaroglu January 10, 2011 4:16 AM
Hi, I encountered the same issue. It seems that... Kyrre Myrbostad February 10, 2011 6:44 AM
Setty, please ask you questions either in the... Ray Augé April 6, 2013 8:58 AM

I am using SDK 6.05 but my portal code is Liferay 6.10

due to that I face the following problems...

I want to switch to the lates SDK but I cant find its trunk and dont know how to compile it.

Can you please point me how to get the latest SDK from trunk and compile it.

ilke


--------------------



1:57:15,664 INFO [PluginPackageUtil:1080] Reading plugin package for LoginLimitation
11:57:15,664 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for LoginLimitation
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for LoginLimitation
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployExcepti­on(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(Plugin­PackageHotDeployListener.java:46)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployU­til.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUti­l.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil­.java:38)
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletCon­textListener.java:99)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycl­e.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.­java:61)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.­java:51)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BaseP­ortalLifecycle.java:50)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(Port­letContextListener.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.core.ContainerBase.addChildInternal(ContainerBase.java:791)
­at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at­ org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.ja­va:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at­ sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav­a:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NullPointerException
at com.liferay.portal.plugin.PluginPackageUtil._readPluginPackageServletContext(Plu­ginPackageUtil.java:1123)
at com.liferay.portal.plugin.PluginPackageUtil.readPluginPackageServletContext(Plug­inPackageUtil.java:202)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.doInvokeDeploy(Plug­inPackageHotDeployListener.java:83)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(Plugin­PackageHotDeployListener.java:43)
... 33 more
11:57:15,667 INFO [PortletHotDeployListener:223] Registering portlets for LoginLimitation

-----------
Posted on 1/10/11 4:16 AM.
Hi, I encountered the same issue. It seems that in 6EE you need to have set the name-tag in your liferay-plugin-package.xml with a value that ends in either "-portlet", "-hook", "-layouttpl", "-theme" or "-web". Else it will throw this error. Not sure if the error has any negative effect though.

We actually debugged the portal remotely in Eclipse to discover this emoticon
Posted on 2/10/11 6:44 AM in reply to ilke Muhtaroglu.
Setty, please ask you questions either in the Forums or as a comment on the wiki page.

Thx.
Posted on 4/6/13 8:58 AM.