Liferay Serivce Builder: Not able to run dynamic query -


i have 2 plugin portlets. first has service builder entities. second portlet using service's jar file execute dynamic query.

i using first's service jar in second plugin portlet interact database. in jar file there not impl class. thats why getting error impl class not found. below reference:

dynamicquery dynamicquery = dynamicqueryfactoryutil.forclass(xxx.class, portletclassloaderutil.getclassloader()); try {     xxxlocalserviceutil.dynamicquery(dynamicquery); } catch (systemexception e1) {   // todo auto-generated catch block   e1.printstacktrace(); } 

error: [dynamicqueryfactoryimpl:96] unable find model com.compass.model.impl.xxximpl java.lang.classnotfoundexception: com.compass.model.impl.xxximpl

nomal functions working fine of service builder

just don't use dynamicqueryfactoryutil xxxlocalserviceutil way

dynamicquery dynamicquery = xxxlocalserviceutil.dynamicquery()  try {     xxxlocalserviceutil.dynamicquery(dynamicquery); } catch (systemexception e1) {   // todo auto-generated catch block   e1.printstacktrace(); } 

if want use factory have use interface model not impl of entity if have entity fooimpl sue foo.class , use classloder of service plugin portlet

classloader cl =(classloader) portletbeanlocatorutil.locate("services-portlet", "portletclassloader"); dynamicqueryfactoryutil.forclass(xxx.class, cl); 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -