Wednesday, January 2, 2013

Solving Can't find resource for bundle com.liferay.portlet.PortletResourceBundle, key javax.portlet.title

I have seeing many of you dealing with this error.
 I spent hours reading and trying to figure out what was the problem. These are my findings ...

 Example code. (ERROR)

<portlet>
<portlet-name>COMMON_BACKUP_RESTORE</portlet-name>
<display-name>Backup-Restore</display-name>
<portlet-class>com.ng.framework.portlet.NGStrutsPortlet
</portlet-class>
<init-param>
<name>view-action</name>
<value>/ext/ng/backup_restore/view</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle
</resource-bundle>
<portlet-preferences>
<preference>
</preference>
</portlet-preferences>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
Using Eclipse (I didn't test with another IDE) the Ctrl+Shift+F command will indent your code, but for some reason this breaks the xml
We are interested in this specific line
<resource-bundle>com.liferay.portlet.StrutsResourceBundle
</resource-bundle>
And should be
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>

  That's it! Hope it helps you.

No comments:

Post a Comment