BeanLocator is not set in liferay 7.1

thumbnail
Abhishek Jain, modified 7 Years ago. Regular Member Posts: 226 Join Date: 8/20/16 Recent Posts

I am getting "BeanLocatorException" when calling GroupLocalServiceUtil.getFriendlyURLGroup(companyId, friendlyUrl) with valid arguments in liferay 7.1..The useful info about stacktrace is as follows:-

com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator is not set
    at com.liferay.portal.kernel.bean.PortalBeanLocatorUtil.locate(PortalBeanLocatorUtil.java:74)
    at com.liferay.portal.kernel.service.GroupLocalServiceUtil.getService(GroupLocalServiceUtil.java:2508)

I went through several threads and tried with methods for groupLocalService using @Reference annotation but to no avail..Please help me in this approach..Your suggestions would be highly appreciated ...Thanks in advance..

thumbnail
Olaf Kock, modified 7 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Abhishek Jain:

I am getting "BeanLocatorException" when calling GroupLocalServiceUtil.getFriendlyURLGroup(companyId, friendlyUrl) with valid arguments in liferay 7.1..The useful info about stacktrace is as follows:-

com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator is not set
    at com.liferay.portal.kernel.bean.PortalBeanLocatorUtil.locate(PortalBeanLocatorUtil.java:74)
    at com.liferay.portal.kernel.service.GroupLocalServiceUtil.getService(GroupLocalServiceUtil.java:2508)

I went through several threads and tried with methods for groupLocalService using @Reference annotation but to no avail..

Please show the relevant part of your code, and the stacktrace down to your own call.

Note that you shouldn't call GroupLocalServiceUtil any more if you write an OSGi bundle plugin. Rather call the direct @Reference to groupLocalService.