afro-Nija afro-Nija - 1 month ago 19
Java Question

PermissionChecker not initialized Liferay Exception when trying to create or access user object via soap web service

I am struggling with this problem for a long time now and each time it resurfaced i keep doing one thing i.e. changing the entire tomcat and database some times which i feel very awkward about.

I have tried to research the problem but all leading to no where.

always giving ERROR [http-bio-8080-exec-11][UserServiceSoap:858] com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized

I have tried this solution https://www.liferay.com/en_GB/community/forums/-/message_boards/message/21257074 which leads to this actually reading this article https://www.liferay.com/en_GB/community/wiki/-/wiki/Main/JAAS/maximized but all to no headway.

I have changed a lot in the portal-ext properties file of the liferay tomcat and nothing seems to be happening.

I used to be able to create users and manipulate users via web service using soap and without any change in the source this problem always starts up by it self.

Kindly assist in putting me in the right direction for a positive solution.

Answer

After a serious session checking all possible problems and comparing other tomcat instance of liferay in house a discovery is found that com.liferay.portal.servlet.filters.secure.SecureFilter was set to false which by default is suppose to be true for soap authentication to be successful.

Which on the instances that is giving problem it was set to false on the portal-ext file this line actually fixed the problem or just comment it out.

com.liferay.portal.servlet.filters.secure.SecureFilter=true

However make sure the axis.servlet.hosts.allowed is set to have the calling url IP otherwise you will get a 403 http status code denying your access to the instance in this case:

axis.servlet.hosts.allowed=127.0.0.1,localhost,192.168.0.xxx,your-ip-address

And that is all you need to get over this problem.

Thanks and I hope this helps anyone with similar problem.