AppEngine连接Android项目中的注释失败

时间:2013-10-06 10:58:49

标签: java android eclipse google-app-engine google-cloud-endpoints

我使用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

Screenshot of libs:

1 个答案:

答案 0 :(得分: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>

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