I have a Liferay Custom service built using service builder. I have the WebArticleLocalHelperServiceImpl
which is the implementation of my service.
How can I call my service from other plugin projects.
I am able to call the service from velocity template projects using:
// get the service using servicelocator.
#set ($myService = $serviceLocator.findService('my-services-portlet', 'com.mycompany.service.MyService'))
// then call the service method
#set ($result = $myService.mymethod())
I am able to call the service from velocity templates, but I am not able to call the service from other plugin projects (Portlets)
when I call ServiceLocator
from MVCPortlet
, it says ClassNotFound
.
What is the proper way to call the *serviceImpl
from MVCPortlet
?
I searched liferay forums too regarding this, but none of the solutions worked for me.
Thanks a lot in advance.
When you run servicebuilder, you get a *-service.jar (where * is the name for your project/service). You need to make this jar available to the plugin you want to call it from. You can do this either by declaring a dependency (liferay-plugin-package.properties), manually copying it to that plugin or by placing it on the global classpath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With