How do I use another custom portlet's service layer in Liferay 6.0.6
-
26-10-2019 - |
Question
I have tried two things:
- Specified the first portlet as a Required Deployment Context in the second portlet's liferay-plugin-package.properties.
- Added the first portlet's portlet service jar to teh second portlet's web app libraries folder.
Neither worked. I still get the ff. exception when I try a dynamic query on the first portlet's service.
java.lang.ClassNotFoundException: com.foo.bar.model.impl.MyPojoImpl
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.getImplClass(DynamicQueryFactoryImpl.java:78)
at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.getImplClass(DynamicQueryFactoryImpl.java:59)
at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.forClass(DynamicQueryFactoryImpl.java:33)
at com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil.forClass(DynamicQueryFactoryUtil.java:23)
Solution 2
See http://issues.liferay.com/browse/LPS-13073. Either upgrade plugin SDK to later than 6.0.5 or follow patching instructions in second comment.
OTHER TIPS
Try removing the required deployment context from liferay-plugin-package.properties. After you are done creating service, move the your-service.jar in tomcat/lib/ext folder. Make sure none of your portlet has your-service.jar in its lib folder and then try calling the service.
Regards, Sandeep
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow