Whereas I had no problem with the Service Builder in Liferay 6.2, I meet a blocking issue in Liferay 7 when I am building service to generate my first Finder Util class. When I discover that, I even decided to start from scratch a project, the problem is still here. Even with the official doc, nothing works.
Does someone has any idea to help me ?
Here is the complete description for my last test in Eclipse Mars :
Thank you for you help.
Vincent
When you build the service there are some properties in build.gradle so if you want to generate the Util class has to set osgiModule to false.
buildService {
apiDir = "../foo-api/src/main/java"
osgiModule = false
propsUtil = "com.liferay.docs.foo.service.util.PropsUtil"
}
Otherwise if you want to use osgi you can retrive the finder this way
@Reference
private volatile FooFinder fooFinder;
or
@Reference(unbind = "-")
protected void setFooFinder(
FooFinder fooFinder) {
_fooFinder = fooFinder;
}
private FooFinder _fooFinder;
for more info see liferay-docs https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/finding-and-invoking-liferay-services
exampel on github http://github.com/bruinen/liferay-services-example