Hello,
Recently I faced some
issue with dynamic query. Even though my service layer and Portlet are in the
same war I got class not found exception
for the model class. Liferay could not able to load Model class while using the
dynamic query So I used the Portlet Class loader like below.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClassLoader classLoader = (ClassLoader)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(),"portletClassLoader"); | |
DynamicQuery dquery = DynamicQueryFactoryUtil.forClass(Continent.class,classLoader); |
Then my issue got
resolved.
Comments