Using Service Trackers on a JSF portlet

txapeldot ., modified 3 Years ago. Junior Member Posts: 91 Join Date: 1/15/15 Recent Posts

From a non-bean class lying on a JSF portlet, I'm trying to invoke a service defined in a Service Builder-created module. What I've read on the official documentation (Liferay 7.2) is that this task can be accomplished by using Service Trackers.

The thing is that on a Liferay 7.4 Service Builder generated module, the '_serviceTracker' property has not been created within the [Foo]LocalServiceUtil service class, once the 'build service' gradle task has finished. As a consecuence, when from a non-bean class, which defines a [Foo]LocalServiceTracker class, lying on a JSF portlet, I call the method '.getService()', it is always returning a 'null' value.

All I've read about invoking Service Builder based services is intended for the Liferay 7.2 release, but I'm developing with Liferay 7.4. My doubt is whether the info described on Liferay 7.2 docs is valid for Liferay 7.4 or, I'm just doing the things the wrong way.

I'd really appreciate some clarification.

Thanks.