我正在使用spring-data-jpa(1.3.2.RELEASE),eclipselink(2.5.1)通过netbeans(8.0)与glassfish服务器(4)和maven进行项目.
项目运行正常,直到正在运行的服务器中进行第二次部署.这是错误.
org.springframework.beans.factory.BeanCreationException:创建名为'appLanguageManagerSpringImp'的bean时出错:注入自动连接的依赖项失败;
嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private com ...... AppLanguageRepository com ...... AppLanguageManagerSpringImp.languageRepo;
嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名为'appLanguageRepository'的bean时出错:FactoryBean在创建对象时抛出异常;
嵌套异常是java.lang.IllegalArgumentException:在Metamodel中没有为密钥类[com.pixieuniverse.nostalgia.model.entity.EAppPrefLanguage]找到[ManagedType] - 请验证persistence.xml中是否引用了[Managed]类使用特定的com.pixieuniverse.nostalgia.model.entity.EAppPrefLanguage属性或全局false元素.
调用以下弹簧数据代码时会生成错误
//org.springframework.context.annotation.AnnotationConfigApplicationContext
new AnnotationConfigApplicationContext(ApplicationConfig.class)
Run Code Online (Sandbox Code Playgroud)
这是stackrace
java.lang.Exception: DEBUG STACK TRACE for PoolBackedDataSource.close().
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close(AbstractPoolBackedDataSource.java:417)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:327)
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:510)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:486)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:455)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1090)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:487)
at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:73)
at com.pixieuniverse.nostalgia.model.crud.spring.impl.ImpFactorySpring.<init>(ImpFactorySpring.java:28)
at com.pixieuniverse.nostalgia.model.crud.ImpFactory.getInstance(ImpFactory.java:21)
at com.pixieuniverse.nostalgia.vc.servlet.util.AppServletContextListener.contextInitialized(AppServletContextListener.java:30)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5362)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:743)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5898)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122) …Run Code Online (Sandbox Code Playgroud)