Saturday, September 23, 2017

Liferay Error : Unable to find model in Dynamic Query


We already know how to write dynamic query in Liferay. If we create Dynamic Query object in same portlet in which our service are then we can use :-




But if we use this code in another portlet ie Services in one portlet and our portlet is different then we get error on our console:-


[DynamicQueryFactoryImpl:96] Unable find model com.liferay.sample.model.impl.EmployeeImpl
java.lang.ClassNotFoundException: com.liferay.sample.model.impl.EmployeeImpl

Solution:-
In this case you can create Dynamic Query Object as:-


Explanation:-
The only difference is the way how we use the Class Loader.

No comments:

Post a Comment

Total Pageviews

Number Of Unique Visitor

Free counters!