java - EntityManager can't see mapped classes in jar file -
i have set of annotated entity classes live in common.jar file. i'm able build .war file references common.jar, , generate ddl via hbm2ddl. when deploy resulting .war file, though, entitymanager isn't able find mappings of classes resulting in errors 1 below.
i have tried including .jar within .war, placing .jar server/default/lib directory, referencing common location, , many variations along way without success.
any pointers very, welcome. had thought home free when build succeeded i'm still missing piece somewhere.
note: if move source these classes .war project, works perfectly, i'd keep these separate various reasons.
2011-02-22 04:36:26,939 error [org.jboss.seam.exception.exceptions] (http-0.0.0.0-8080-11) handled , logged exception javax.servlet.servletexception: org.jboss.resteasy.spi.unhandledexception: java.lang.illegalargumentexception: unknown entity: com.techma.aoio.model.message @ org.jboss.seam.servlet.contextualhttpservletrequest.run(contextualhttpservletrequest.java:74) @ org.jboss.seam.resteasy.resteasyresourceadapter.getresource(resteasyresourceadapter.java:121) @ org.jboss.seam.servlet.seamresourceservlet.service(seamresourceservlet.java:80) @ javax.servlet.http.httpservlet.service(httpservlet.java:717) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:83) @ org.jboss.seam.web.identityfilter.dofilter(identityfilter.java:40) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:69) @ org.jboss.seam.web.multipartfilter.dofilter(multipartfilter.java:90) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:69) @ org.jboss.seam.web.exceptionfilter.dofilter(exceptionfilter.java:64) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:69) @ org.jboss.seam.web.redirectfilter.dofilter(redirectfilter.java:45) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:69) @ org.ajax4jsf.webapp.basexmlfilter.doxmlfilter(basexmlfilter.java:178) @ org.ajax4jsf.webapp.basefilter.handlerequest(basefilter.java:290) @ org.ajax4jsf.webapp.basefilter.processuploadsandhandlerequest(basefilter.java:368) @ org.ajax4jsf.webapp.basefilter.dofilter(basefilter.java:495) @ org.jboss.seam.web.ajax4jsffilter.dofilter(ajax4jsffilter.java:56) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:69) @ org.jboss.seam.web.loggingfilter.dofilter(loggingfilter.java:60) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:69) @ org.jboss.seam.servlet.seamfilter$filterchainimpl.dofilter(seamfilter.java:73) @ org.jboss.seam.servlet.seamfilter.dofilter(seamfilter.java:158) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:235) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.jboss.web.tomcat.filters.replyheaderfilter.dofilter(replyheaderfilter.java:96) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:235) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:235) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:191) @ org.jboss.web.tomcat.security.securityassociationvalve.invoke(securityassociationvalve.java:190) @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:433) @ org.jboss.web.tomcat.security.jacccontextvalve.invoke(jacccontextvalve.java:92) @ org.jboss.web.tomcat.security.securitycontextestablishmentvalve.process(securitycontextestablishmentvalve.java:126) @ org.jboss.web.tomcat.security.securitycontextestablishmentvalve.invoke(securitycontextestablishmentvalve.java:70) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:127) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) @ org.jboss.web.tomcat.service.jca.cachedconnectionvalve.invoke(cachedconnectionvalve.java:158) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:330) @ org.apache.coyote.http11.http11processor.process(http11processor.java:829) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:598) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:447) @ java.lang.thread.run(thread.java:619) caused by: org.jboss.resteasy.spi.unhandledexception: java.lang.illegalargumentexception: unknown entity: com.techma.aoio.model.message @ org.jboss.resteasy.core.synchronousdispatcher.handleapplicationexception(synchronousdispatcher.java:296) @ org.jboss.resteasy.core.synchronousdispatcher.handleexception(synchronousdispatcher.java:208) @ org.jboss.resteasy.core.synchronousdispatcher.handleinvokerexception(synchronousdispatcher.java:187) @ org.jboss.resteasy.core.synchronousdispatcher.invoke(synchronousdispatcher.java:371) @ org.jboss.resteasy.core.synchronousdispatcher.invoke(synchronousdispatcher.java:160) @ org.jboss.seam.resteasy.resteasyresourceadapter$1.process(resteasyresourceadapter.java:145) @ org.jboss.seam.servlet.contextualhttpservletrequest.run(contextualhttpservletrequest.java:53) ... 45 more caused by: java.lang.illegalargumentexception: unknown entity: com.techma.aoio.model.message @ org.hibernate.ejb.abstractentitymanagerimpl.find(abstractentitymanagerimpl.java:193) @ org.jboss.seam.persistence.entitymanagerproxy.find(entitymanagerproxy.java:87) @ com.techma.tng.resources.messageresource.get(messageresource.java:72) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.jboss.seam.util.reflections.invoke(reflections.java:22) @ org.jboss.seam.intercept.rootinvocationcontext.proceed(rootinvocationcontext.java:32) @ org.jboss.seam.intercept.seaminvocationcontext.proceed(seaminvocationcontext.java:56) @ org.jboss.seam.resteasy.resteasycontextinjectioninterceptor.aroundinvoke(resteasycontextinjectioninterceptor.java:59) @ org.jboss.seam.intercept.seaminvocationcontext.proceed(seaminvocationcontext.java:68) @ org.jboss.seam.transaction.rollbackinterceptor.aroundinvoke(rollbackinterceptor.java:28) @ org.jboss.seam.intercept.seaminvocationcontext.proceed(seaminvocationcontext.java:68) @ org.jboss.seam.core.bijectioninterceptor.aroundinvoke(bijectioninterceptor.java:77) @ org.jboss.seam.intercept.seaminvocationcontext.proceed(seaminvocationcontext.java:68) @ org.jboss.seam.transaction.transactioninterceptor$1.work(transactioninterceptor.java:97) @ org.jboss.seam.util.work.workintransaction(work.java:47) @ org.jboss.seam.transaction.transactioninterceptor.aroundinvoke(transactioninterceptor.java:91) @ org.jboss.seam.intercept.seaminvocationcontext.proceed(seaminvocationcontext.java:68) @ org.jboss.seam.core.methodcontextinterceptor.aroundinvoke(methodcontextinterceptor.java:44) @ org.jboss.seam.intercept.seaminvocationcontext.proceed(seaminvocationcontext.java:68) @ org.jboss.seam.intercept.rootinterceptor.invoke(rootinterceptor.java:107) @ org.jboss.seam.intercept.javabeaninterceptor.interceptinvocation(javabeaninterceptor.java:185) @ org.jboss.seam.intercept.javabeaninterceptor.invoke(javabeaninterceptor.java:103) @ com.techma.tng.resources.messageresource_$$_javassist_seam_4.get(messageresource_$$_javassist_seam_4.java) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.jboss.resteasy.core.methodinjectorimpl.invoke(methodinjectorimpl.java:119) @ org.jboss.resteasy.core.resourcemethod.invokeontarget(resourcemethod.java:211) @ org.jboss.resteasy.core.resourcemethod.invoke(resourcemethod.java:176) @ org.jboss.resteasy.core.resourcemethod.invoke(resourcemethod.java:166) @ org.jboss.resteasy.core.synchronousdispatcher.invoke(synchronousdispatcher.java:356) ... 48 more caused by: org.hibernate.mappingexception: unknown entity: com.techma.aoio.model.message @ org.hibernate.impl.sessionfactoryimpl.getentitypersister(sessionfactoryimpl.java:580) @ org.hibernate.event.def.defaultloadeventlistener.onload(defaultloadeventlistener.java:91) @ org.hibernate.impl.sessionimpl.fireload(sessionimpl.java:905) @ org.hibernate.impl.sessionimpl.get(sessionimpl.java:842) @ org.hibernate.impl.sessionimpl.get(sessionimpl.java:835) @ org.hibernate.ejb.abstractentitymanagerimpl.find(abstractentitymanagerimpl.java:182) ... 82 more
thanks axtavt pointing me duplicate, able determine including <jar-file>file:/opt/lib/common.jar</jar-file>
tag in persistence.xml required let hibernate see mapped classes. thanks!
Comments
Post a Comment