eclipselink - No [ManagedType] was found for the key class [entitiy class] in the Metamodel -


i working on project using spring-data-jpa(1.3.2.release), eclipselink(2.5.1) on netbeans(8.0) glassfish server(4) , maven.

the project running fine until second deployment in running server. error.

org.springframework.beans.factory.beancreationexception: error creating bean name 'applanguagemanagerspringimp': injection of autowired dependencies failed;

nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private com......applanguagerepository com......applanguagemanagerspringimp.languagerepo;

nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'applanguagerepository': factorybean threw exception on object creation;

nested exception java.lang.illegalargumentexception: no [managedtype] found key class [com.pixieuniverse.nostalgia.model.entity.eapppreflanguage] in metamodel - please verify [managed] class referenced in persistence.xml using specific com.pixieuniverse.nostalgia.model.entity.eapppreflanguage property or global false element.

error generates when calls spring data code of following

//org.springframework.context.annotation.annotationconfigapplicationcontext new annotationconfigapplicationcontext(applicationconfig.class) 

this stackrace

java.lang.exception: debug stack trace poolbackeddatasource.close().     @ com.mchange.v2.c3p0.impl.abstractpoolbackeddatasource.close(abstractpoolbackeddatasource.java:417)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     @ java.lang.reflect.method.invoke(method.java:601)     @ org.springframework.beans.factory.support.disposablebeanadapter.invokecustomdestroymethod(disposablebeanadapter.java:327)     @ org.springframework.beans.factory.support.disposablebeanadapter.destroy(disposablebeanadapter.java:253)     @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.destroybean(defaultsingletonbeanregistry.java:510)     @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.destroysingleton(defaultsingletonbeanregistry.java:486)     @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.destroysingletons(defaultsingletonbeanregistry.java:455)     @ org.springframework.context.support.abstractapplicationcontext.destroybeans(abstractapplicationcontext.java:1090)     @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:487)     @ org.springframework.context.annotation.annotationconfigapplicationcontext.<init>(annotationconfigapplicationcontext.java:73)     @ com.pixieuniverse.nostalgia.model.crud.spring.impl.impfactoryspring.<init>(impfactoryspring.java:28)     @ com.pixieuniverse.nostalgia.model.crud.impfactory.getinstance(impfactory.java:21)     @ com.pixieuniverse.nostalgia.vc.servlet.util.appservletcontextlistener.contextinitialized(appservletcontextlistener.java:30)     @ org.apache.catalina.core.standardcontext.contextlistenerstart(standardcontext.java:5362)     @ com.sun.enterprise.web.webmodule.contextlistenerstart(webmodule.java:743)     @ org.apache.catalina.core.standardcontext.start(standardcontext.java:5898)     @ com.sun.enterprise.web.webmodule.start(webmodule.java:691)     @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:1041)     @ org.apache.catalina.core.containerbase.addchild(containerbase.java:1024)     @ org.apache.catalina.core.standardhost.addchild(standardhost.java:747)     @ com.sun.enterprise.web.webcontainer.loadwebmodule(webcontainer.java:2278)     @ com.sun.enterprise.web.webcontainer.loadwebmodule(webcontainer.java:1924)     @ com.sun.enterprise.web.webapplication.start(webapplication.java:139)     @ org.glassfish.internal.data.engineref.start(engineref.java:122)     @ org.glassfish.internal.data.moduleinfo.start(moduleinfo.java:291)     @ org.glassfish.internal.data.applicationinfo.start(applicationinfo.java:352)     @ com.sun.enterprise.v3.server.applicationlifecycle.deploy(applicationlifecycle.java:497)     @ com.sun.enterprise.v3.server.applicationlifecycle.deploy(applicationlifecycle.java:219)     @ org.glassfish.deployment.admin.deploycommand.execute(deploycommand.java:491)     @ com.sun.enterprise.v3.admin.commandrunnerimpl$2$1.run(commandrunnerimpl.java:527)     @ com.sun.enterprise.v3.admin.commandrunnerimpl$2$1.run(commandrunnerimpl.java:523)     @ java.security.accesscontroller.doprivileged(native method)     @ javax.security.auth.subject.doas(subject.java:356)     @ com.sun.enterprise.v3.admin.commandrunnerimpl$2.execute(commandrunnerimpl.java:522)     @ com.sun.enterprise.v3.admin.commandrunnerimpl.docommand(commandrunnerimpl.java:546)     @ com.sun.enterprise.v3.admin.commandrunnerimpl.docommand(commandrunnerimpl.java:1423)     @ com.sun.enterprise.v3.admin.commandrunnerimpl.access$1500(commandrunnerimpl.java:108)     @ com.sun.enterprise.v3.admin.commandrunnerimpl$executioncontext.execute(commandrunnerimpl.java:1762)     @ com.sun.enterprise.v3.admin.commandrunnerimpl$executioncontext.execute(commandrunnerimpl.java:1674)     @ com.sun.enterprise.v3.admin.adminadapter.docommand(adminadapter.java:534)     @ com.sun.enterprise.v3.admin.adminadapter.onmissingresource(adminadapter.java:224)     @ org.glassfish.grizzly.http.server.statichttphandler.service(statichttphandler.java:297)     @ com.sun.enterprise.v3.services.impl.containermapper.service(containermapper.java:246)     @ org.glassfish.grizzly.http.server.httphandler.runservice(httphandler.java:191)     @ org.glassfish.grizzly.http.server.httphandler.dohandle(httphandler.java:168)     @ org.glassfish.grizzly.http.server.httpserverfilter.handleread(httpserverfilter.java:189)     @ org.glassfish.grizzly.filterchain.executorresolver$9.execute(executorresolver.java:119)     @ org.glassfish.grizzly.filterchain.defaultfilterchain.executefilter(defaultfilterchain.java:288)     @ org.glassfish.grizzly.filterchain.defaultfilterchain.executechainpart(defaultfilterchain.java:206)     @ org.glassfish.grizzly.filterchain.defaultfilterchain.execute(defaultfilterchain.java:136)     @ org.glassfish.grizzly.filterchain.defaultfilterchain.process(defaultfilterchain.java:114)     @ org.glassfish.grizzly.processorexecutor.execute(processorexecutor.java:77)     @ org.glassfish.grizzly.nio.transport.tcpniotransport.fireioevent(tcpniotransport.java:838)     @ org.glassfish.grizzly.strategies.abstractiostrategy.fireioevent(abstractiostrategy.java:113)     @ org.glassfish.grizzly.strategies.workerthreadiostrategy.run0(workerthreadiostrategy.java:115)     @ org.glassfish.grizzly.strategies.workerthreadiostrategy.access$100(workerthreadiostrategy.java:55)     @ org.glassfish.grizzly.strategies.workerthreadiostrategy$workerthreadrunnable.run(workerthreadiostrategy.java:135)     @ org.glassfish.grizzly.threadpool.abstractthreadpool$worker.dowork(abstractthreadpool.java:564)     @ org.glassfish.grizzly.threadpool.abstractthreadpool$worker.run(abstractthreadpool.java:544)     @ java.lang.thread.run(thread.java:722)  ...  caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'applanguagemanagerspringimp': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private com.pixieuniverse.nostalgia.model.crud.spring.repository.applanguagerepository com.pixieuniverse.nostalgia.model.crud.spring.impl.applanguagemanagerspringimp.languagerepo; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'applanguagerepository': factorybean threw exception on object creation; nested exception java.lang.illegalargumentexception: no [managedtype] found key class [com.pixieuniverse.nostalgia.model.entity.eapppreflanguage] in metamodel - please verify [managed] class referenced in persistence.xml using specific <class>com.pixieuniverse.nostalgia.model.entity.eapppreflanguage</class> property or global <exclude-unlisted-classes>false</exclude-unlisted-classes> element.     @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:288)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1120)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:522)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:461)     @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:295)     @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:223)     @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:292)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194)     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:626)     @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:932)     @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:479)     @ org.springframework.context.annotation.annotationconfigapplicationcontext.<init>(annotationconfigapplicationcontext.java:73)     @ com.pixieuniverse.nostalgia.model.crud.spring.impl.impfactoryspring.<init>(impfactoryspring.java:28)     @ com.pixieuniverse.nostalgia.model.crud.impfactory.getinstance(impfactory.java:21)     @ com.pixieuniverse.nostalgia.vc.servlet.util.appservletcontextlistener.contextinitialized(appservletcontextlistener.java:30)     @ org.apache.catalina.core.standardcontext.contextlistenerstart(standardcontext.java:5362)     @ com.sun.enterprise.web.webmodule.contextlistenerstart(webmodule.java:743)     @ org.apache.catalina.core.standardcontext.start(standardcontext.java:5898) 

this persistance.xml

<?xml version="1.0" encoding="utf-8"?> <persistence version="2.1" ...>   <persistence-unit name="pu">     <provider>org.eclipse.persistence.jpa.persistenceprovider</provider>     <!-- error generates or without <exclude-unlisted-classes>false</exclude-unlisted-classes> -->     <class>com.pixieuniverse.nostalgia.model.entity.eapppreflanguage</class>     <class>com.pixieuniverse.nostalgia.model.entity.eapppreflogintype</class>   </persistence-unit> </persistence> 

please shed light

edit

now have deleted persistance.xml , updated code work without persistance.xml still same error.

@bean @autowired public entitymanagerfactory entitymanagerfactory(datasource bcdatasource) {     eclipselinkjpavendoradapter vendoradapter = new eclipselinkjpavendoradapter();     vendoradapter.setdatabaseplatform("org.eclipse.persistence.platform.database.mysqlplatform");     vendoradapter.setgenerateddl(true);     vendoradapter.setshowsql(false);      localcontainerentitymanagerfactorybean factory = new localcontainerentitymanagerfactorybean();      factory.setpackagestoscan("com.pixieuniverse.nostalgia.model.entity");     factory.setjpavendoradapter(vendoradapter);     factory.setdatasource(bcdatasource);      properties properties = new properties();      properties.setproperty("eclipselink.weaving", "false");      factory.setjpaproperties(properties);     factory.afterpropertiesset();      return factory.getobject(); } 

any hints please?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -