File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Portals and Portlets and the fly likes Struts portlet on liferay giving Null pointer exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Struts portlet on liferay giving Null pointer exception" Watch "Struts portlet on liferay giving Null pointer exception" New topic

Struts portlet on liferay giving Null pointer exception

Ram Charan

Joined: Jun 07, 2008
Posts: 16
Hi All,
I have developed a struts portlet on liferay.

In Web.xml I am including




In portlet.xml i am including

<display-name>Change Password</display-name>

when tried to run I am getting the below exception

Uncaught exception thrown in one of the service methods of the servlet: ChangePassword. Exception thrown : java.lang.NullPointerException
at com.liferay.portlet.StrutsPortlet.include(
at com.liferay.portlet.StrutsPortlet.doView(
at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(
at javax.portlet.GenericPortlet.render(
at com.liferay.portal.kernel.servlet.PortletServlet.service(
at javax.servlet.http.HttpServlet.service(

My action class is extending com.liferay.portal.struts.PortletAction.

Let me know if I have to make any configuration changes. Thanks in Advance.

Yongming Duan

Joined: May 08, 2006
Posts: 2
hi Ram,

There are two ways to impliment a struts portlet in liferay.

By the way, could you specify which version are you using?

You can see sample-struts-portlet or sample-struts-liferay-portlet.

try get more help and information on liferay forum

and liferay wiki
mp mp

Joined: Nov 27, 2008
Posts: 1
Hi Ram,

Even I was facing the same problem while developing a struts-portlet in Liferay until I could surprisingly find mPire-an Autogeneration tool for Liferay. I found this tool quite cool.

You have to just type in the commands to generate a full fledge struts-portlet in Liferay. No single line of code is required in order to generate a full fledge struts-portlet with all this features :

* CRUD operations on entities
* Filter / Search / Sorting on entities
* Pagination with configurable page size
* Lists: Drop-downs, Radio / Check boxes
* Relationship between various entities
* File Uploading & Data encryption options
* Completely AJAX based

You can save your time by using mPire-an Autogeneration tool for Liferay and get into action. You can download mPire from

I am using this tool and its very helpful in generating portlets in Liferay, it can be used with almost all servers and database
[ November 27, 2008: Message edited by: mp mp ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

"mp mp",
Please check your private messages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Struts portlet on liferay giving Null pointer exception
It's not a secret anymore!