Combination View Flat View Tree View
Threads [ Previous | Next ]
Lyle Wilson
liferay 4.4.2 null pointer when sending new password
September 11, 2008 5:26 PM
Answer

Lyle Wilson

Rank: New Member

Posts: 4

Join Date: July 30, 2008

Recent Posts

I'm running liferay-portal-tomcat-6.0-4.4.2 with java jdk1.5.0_16

I have not been able to get the send password function to work since upgrading from 4.2.1

When user clicks the "send new password" button, the web page reports there has been an error.

The tomcat log has the following:

java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
at com.liferay.portal.kernel.util.StringUtil.read(StringUtil.java:484)
at com.liferay.portal.kernel.util.StringUtil.read(StringUtil.java:473)
at com.liferay.portal.util.ContentUtil._get(ContentUtil.java:60)
at com.liferay.portal.util.ContentUtil.get(ContentUtil.java:44)
at com.liferay.portal.util.PrefsPropsUtil.getContent(PrefsPropsUtil.java:133)
at com.liferay.portal.util.PrefsPropsUtil.getContent(PrefsPropsUtil.java:121)
at com.liferay.portal.service.impl.UserLocalServiceImpl.sendPassword(UserLocalServiceImpl.ja
va:1139)

I have the 4.4.2 source so I imported the 4.4.2 source project into eclipse and found and edited the UserLocalServiceImpl.java source file.

Line 1139 in my UserLocalServiceImpl..java source file is:

String subject = PrefsPropsUtil.getContent(
companyId, PropsUtil.ADMIN_EMAIL_PASSWORD_SENT_SUBJECT);

I can find the corresponding property entry in the ext property file as well as the default property file.

UPDATE: I think the null pointer is due to missing tmpl files defined in the ext property file. The previous developers didn't get all the source files checked into subversion. Go figure...

UPDATE 2: Yep, that was it. Commented out the following entries in the ext property file and the null pointer went away.

admin.email.user.added.subject=dependencies/email_user_added_subject.tmpl
admin.email.user.added.body=dependencies/email_user_added_body.tmpl
admin.email.password.sent.subject=dependencies/email_password_sent_subject.tmpl
admin.email.password.sent.body=dependencies/email_password_sent_body.tmpl