1

我在运行尝试与 JPA 集成的 Google App Engine 应用程序 (GAE/J) 时遇到问题,但我无法使其工作。我按照谷歌官方教程的简单步骤(http://code.google.com/appengine/docs/java/datastore/jpa/overview.html)。我在正确的位置设置了 persistence.xml 文件,从 SDK 下载了 JAR 并作为外部 JAR(使用 Eclipse SDK)添加到我的项目中。我目前没有使用 Maven,所以我手动进行。

当我运行 GAE 应用程序时,我的控制台上会出现以下警告、错误和异常:

Jan 27, 2011 3:47:11 PM com.google.apphosting.utils.jetty.JettyLogger info
        INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
        Jan 27, 2011 3:47:11 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
        INFO: Successfully processed /home/xxx/project/war/WEB-INF/appengine-web.xml
        Jan 27, 2011 3:47:11 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
        INFO: Successfully processed /home/xxx/project/war/WEB-INF/web.xml
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.natures" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.builders" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.markers" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.markers" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        [etc...]
        WARNING: Extension Point "org.eclipse.core.runtime.contentTypes" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.runtime.preferences" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.runtime.preferences" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
        SEVERE: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.resources" but it cannot be resolved.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
        SEVERE: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.runtime" but it cannot be resolved.
        Jan 27, 2011 3:47:28 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
        SEVERE: Bundle "org.eclipse.jdt.core" requires "org.eclipse.text" but it cannot be resolved.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.natures" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.builders" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.markers" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.markers" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.resources.markers" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
       [etc...]
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
        WARNING: Extension Point "org.eclipse.core.runtime.preferences" not registered, but plugin "org.eclipse.jdt.core" defined in file:/home/xxx/project/war/WEB-INF/lib/core-3.1.1.jar refers to it.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
        SEVERE: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.resources" but it cannot be resolved.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
        SEVERE: Bundle "org.eclipse.jdt.core" requires "org.eclipse.core.runtime" but it cannot be resolved.
        Jan 27, 2011 3:47:30 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
        SEVERE: Bundle "org.eclipse.jdt.core" requires "org.eclipse.text" but it cannot be resolved.
Jan 27, 2011 3:47:32 PM org.datanucleus.metadata.MetaDataManager initialiseFileMetaDataForUse
        SEVERE: Found Meta-Data for class escool.model.Person but this class is not enhanced!! Please enhance the class before running DataNucleus.
        org.datanucleus.exceptions.NucleusUserException: Found Meta-Data for class escool.model.Person but this class is not enhanced!! Please enhance the class before running DataNucleus.
            at org.datanucleus.metadata.MetaDataManager.initialiseClassMetaData(MetaDataManager.java:2225)
            at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaData(MetaDataManager.java:2176)
            at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:881)
            at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:794)
            at org.datanucleus.jpa.EntityManagerFactoryImpl.initialisePMF(EntityManagerFactoryImpl.java:488)
            at org.datanucleus.jpa.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:355)
            at org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.<init>(DatastoreEntityManagerFactory.java:63)
            at org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider.createEntityManagerFactory(DatastorePersistenceProvider.java:35)
            at javax.persistence.Persistence.createFactory(Persistence.java:172)
            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112)
            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:66)
            at escool.controllers.EMF.<clinit>(EMF.java:8)
            at escool.controllers.HomeController.<init>(HomeController.java:21)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
            at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:112)
            at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:120)
            at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$3.run(AbstractAutowireCapableBeanFactory.java:943)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:941)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:901)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
            [etc...]
            at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
            at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
            at javax.servlet.GenericServlet.init(GenericServlet.java:212)
            at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
            at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
            at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
            at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
            at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
            at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
            at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
            at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
            at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
            at org.mortbay.jetty.Server.doStart(Server.java:224)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
            at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:185)
            at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:149)
            at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
            at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
            at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
            at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
            at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)

Jan 27, 2011 3:47:32 PM org.springframework.web.servlet.FrameworkServlet initServletBean
        SEVERE: Context initialization failed
        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController' defined in file [/home/jamoros/laburo/escool/war/WEB-INF/classes/escool/controllers/HomeController.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [escool.controllers.HomeController]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:955)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:901)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
            at [etc...] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
                at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:185)
                at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:149)
                at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
                at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
                at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
                at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
                at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
            Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [escool.controllers.HomeController]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
                at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$3.run(AbstractAutowireCapableBeanFactory.java:943)
                at java.security.AccessController.doPrivileged(Native Method)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:941)
                ... 37 more
            Caused by: java.lang.ExceptionInInitializerError
                at escool.controllers.HomeController.<init>(HomeController.java:21)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
                at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:112)
                at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:120)
                at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
                ... 41 more
            Caused by: javax.persistence.PersistenceException: Provider error. Provider: org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider
                at javax.persistence.Persistence.createFactory(Persistence.java:176)
                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112)
                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:66)
                at escool.controllers.EMF.<clinit>(EMF.java:8)
                ... 49 more
            Caused by: org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
                at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:892)
                at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:794)
                at org.datanucleus.jpa.EntityManagerFactoryImpl.initialisePMF(EntityManagerFactoryImpl.java:488)
                at org.datanucleus.jpa.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:355)
                at org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.<init>(DatastoreEntityManagerFactory.java:63)
                at org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider.createEntityManagerFactory(DatastorePersistenceProvider.java:35)
                at javax.persistence.Persistence.createFactory(Persistence.java:172)
                ... 52 more
            Caused by: org.datanucleus.exceptions.NucleusUserException: Found Meta-Data for class escool.model.Person but this class is not enhanced!! Please enhance the class before running DataNucleus.
                at org.datanucleus.metadata.MetaDataManager.initialiseClassMetaData(MetaDataManager.java:2225)
                at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaData(MetaDataManager.java:2176)
                at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:881)
                ... 58 more
Jan 27, 2011 3:47:32 PM com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: javax.servlet.ServletContext log: unavailable
            org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController' defined in file [/home/jamoros/laburo/escool/war/WEB-INF/classes/escool/controllers/HomeController.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [escool.controllers.HomeController]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:955)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:901)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
                at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
                at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
                at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
                at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
                at javax.servlet.GenericServlet.init(GenericServlet.java:212)
                at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
                at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
                at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
                at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
                at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
                at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
                at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
                at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
                at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
                at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
                at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
                at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
                at org.mortbay.jetty.Server.doStart(Server.java:224)
                at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
                at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:185)
                at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:149)
                at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
                at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
                at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
                at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
                at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
            Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [escool.controllers.HomeController]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
                at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$3.run(AbstractAutowireCapableBeanFactory.java:943)
                at java.security.AccessController.doPrivileged(Native Method)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:941)
                ... 37 more
            Caused by: java.lang.ExceptionInInitializerError
                at escool.controllers.HomeController.<init>(HomeController.java:21)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
                at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:112)
                at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:120)
                at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
                ... 41 more
            Caused by: javax.persistence.PersistenceException: Provider error. Provider: org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider
                at javax.persistence.Persistence.createFactory(Persistence.java:176)
                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112)
                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:66)
                at escool.controllers.EMF.<clinit>(EMF.java:8)
                ... 49 more
            Caused by: org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
                at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:892)
                at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:794)
                at org.datanucleus.jpa.EntityManagerFactoryImpl.initialisePMF(EntityManagerFactoryImpl.java:488)
                at org.datanucleus.jpa.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:355)
                at org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.<init>(DatastoreEntityManagerFactory.java:63)
                at org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider.createEntityManagerFactory(DatastorePersistenceProvider.java:35)
                at javax.persistence.Persistence.createFactory(Persistence.java:172)
                ... 52 more
            Caused by: org.datanucleus.exceptions.NucleusUserException: Found Meta-Data for class escool.model.Person but this class is not enhanced!! Please enhance the class before running DataNucleus.
                at org.datanucleus.metadata.MetaDataManager.initialiseClassMetaData(MetaDataManager.java:2225)
                at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaData(MetaDataManager.java:2176)
                at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:881)
                ... 58 more

Jan 27, 2011 3:47:32 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8888/

在此之后应用程序启动,但我的 JPA 示例不起作用......

我做错了什么?这是什么错误?我还需要配置什么吗?下载插件?任何想法...任何快乐的教程?

谢谢!

4

1 回答 1

1

关于 “找到类 escool.model.Person 的元数据但该类未增强!请在运行 DataNucleus 之前增强该类”消息的哪一点。 令人困惑?也许只是根据要求增强您的课程。

于 2011-01-27T16:55:36.567 回答