Reputation: 448
I have a Liferay portal project built using the service builder. In generating the portlet a jar is also created and I want to use that jar in other portlets. From posts here and elsewhere the suggested approach is to just place the myPortletName-portlet-services.jar in the WEB-INF/lib folder of the other portlet. I have also seen where the *-portlet-services.jar is placed in the /lib/ext folder of Tomcat. I have also read where the liferay-plugin-package.properties should be updated with the dependency.
I have tried each approach and each produces a result that is tantalizingly close to working. The service builder built jar references a jndi/jdbc global resource that is different than the LR database and when a method is invoked from that jar, I receive a "user lacks privilege or object not found:" error (I have posted about this elsewhere).
My hunch is that the jar has some dependencies on Spring/Hibernate that are not being met. That, or the jndi/jdbc resource isn't "visible" when the jar is placed outside the service builder deployed portal. In any case, it's obvious that the jar's methods are being found (else the dreaded beanLocator error) so it is now simply a DB connection issue.
The question is: Are there some structural dependencies that are not being met when a jar generated by the service builder is placed outside the originating portal in some other portal?
Upvotes: 4
Views: 1966
Reputation: 1
For use a Liferay service builder jar in other portlets Try:
Next implement bean that will use bean from service locator and will delagate calls
Upvotes: 0