2

我使用 Eclipse 4.3(也尝试过旧版本)和所有最新插件(AppEngine 1.8.5)创建了一个 App Engine 连接的 Android 项目。

当我运行我的 AppEngine 项目并打开 时http://localhost:8888/,页面正确显示并开始在数据存储中搜索已注册的设备。然后我在控制台中收到以下警告。我认为我的一些课程没有被注释似乎有问题,我已经搜索过如何解决它。谁能帮助我?

        okt 06, 2013 11:51:49 AM org.datanucleus.metadata.MetaDataManager loadPersistenceUnit
        WARNING: Class com.test.MessageEndpoint was specified in persistence-unit transactions-optional but not annotated, so ignoring
        okt 06, 2013 11:51:49 AM org.datanucleus.metadata.MetaDataManager loadPersistenceUnit
        WARNING: Class com.test.EMF was specified in persistence-unit transactions-optional but not annotated, so ignoring
        okt 06, 2013 11:51:49 AM org.datanucleus.metadata.MetaDataManager loadPersistenceUnit
        WARNING: Class com.test.DeviceInfoEndpoint was specified in persistence-unit transactions-optional but not annotated, so ignoring

库截图:

4

1 回答 1

2

在您的 persistence.xml 文件中添加实体类,如下所示:

<persistence-unit name="transactions-optional">
        <provider>org.datanucleus.api.jpa.PersistenceProviderImpl</provider>
        <class>com.watch.project.a</class>
        <class>com.watch.project.b</class>
        <class>com.watch.project.c</class>
        <exclude-unlisted-classes>true</exclude-unlisted-classes>  //important
        <properties>
            <property name="datanucleus.NontransactionalRead" value="true" />
            <property name="datanucleus.NontransactionalWrite" value="true" />
            <property name="datanucleus.ConnectionURL" value="appengine" />
        </properties>
    </persistence-unit>

我希望这可以解决您的问题!为我工作:)

于 2014-02-18T16:50:29.110 回答