掲示板

Need server restart to view role permission in new portal instance.

7年前 に parikshit sharma によって更新されました。

Need server restart to view role permission in new portal instance.

Junior Member 投稿: 53 参加年月日: 12/10/18 最新の投稿
Hi Everyone,
I am working on liferay6.2 version, I have created the new portal instance by calling company services . When I login in new portal instance and try to check the defined permission for roles in control panel it results to null pointer exception. Because of below code in edit_role_permission_navigation.jspf file.

 
PortletCategory portletCategory = (PortletCategory)WebAppPool.get(company.getCompanyId(), WebKeys.PORTLET_CATEGORY);
PortletCategory hiddentPortletCategory = portletCategory.getCategory(PortletCategoryConstants.NAME_HIDDEN);
 


I am getting portletCategory as null because if you call addCompany using companyLocalService it will not initialize WebAppPool.
1. Is there anyway to initialize WebAppPool ( other then Reflection and ext-plugin approach) while creating portal instance?
I can fix the issue by making a small change in jspf file like below, but is the correct way to address this problem?

PortletCategory portletCategory = (PortletCategory)WebAppPool.get(company.getCompanyId(), WebKeys.PORTLET_CATEGORY);
					PortletCategory hiddentPortletCategory = portletCategory!=null ? portletCategory.getCategory(PortletCategoryConstants.NAME_HIDDEN):null;
thumbnail
7年前 に Juan Gonzalez によって更新されました。

RE: Need server restart to view role permission in new portal instance.

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Seems a known bug: https://issues.liferay.com/browse/LPS-65393.

Take a look at the pull request to see which changes are needed in order to sync them through cluster.
7年前 に parikshit sharma によって更新されました。

RE: Need server restart to view role permission in new portal instance.

Junior Member 投稿: 53 参加年月日: 12/10/18 最新の投稿
Hi Juan,

It's not about the cluster environment , it's a multi portal instance , say on local server you have created one more portal instance by using company services from any custom portlet.

And if you do same through UI in control panel/portal instance section add portal it works fine, as in code it will initialize the WebAppPool in initCompany method of PortalInstances class.