阅读背景:

DataNucleus库和maven-gae-plugin

来源:互联网 

I'm using maven-gae-plugin to manage a Google AppEngine project but I don't know how to include the libraries required to use JPA.

我正在使用maven-gae-plugin来管理Google AppEngine项目,但我不知道如何包含使用JPA所需的库。

Google's documentation says:

Google的文档说:

The classpath must contain the JARs 'datanucleus-core-*.jar', 'datanucleus-jpa-*', 'datanucleus-enhancer-*.jar', 'asm-*.jar', and 'geronimo-jpa-*.jar' (where * is the appropriate version number of each JAR) from the 'appengine-java-sdk/lib/tools/' directory, as well as all of your data classes.

类路径必须包含JAR的datanucleus-core - * .jar','datanucleus-jpa- *','datanucleus-enhancer - * .jar','asm - * .jar'和'geronimo-jpa- *。 jar'(其中*是每个JAR的相应版本号)来自'appengine-java-sdk / lib / tools /'目录,以及所有数据类。

How can I tell the plugin to put all the jars in the classpath?

如何告诉插件将所有jar放入类路径?

So far I just edited the pom.xml file setting gae.version to 1.7.3 (Leaving datanucleus.version to 1.1.5 and I run mvn gae:unpack but I cannot get it to work.

到目前为止,我刚刚将pom.xml文件设置为gae.version编辑为1.7.3(将datanucleus.version保留为1.1.5,然后运行mvn gae:unpack但我无法使其工作。

First, I have problems with javax.persistance that is not found. Do I have to add it manually to pom.xml?

首先,我遇到了找不到的javax.persistance问题。我是否必须手动将其添加到pom.xml?

If I do it, the development server starts, but I cannot work with the storage: I get the following error:

如果我这样做,开发服务器启动,但我无法使用存储:我收到以下错误:

SEVERE: Found Meta-Data for class com.sharecost.entities.User but this class is not enhanced!! Please enhance the class before running DataNucleus.

严重:找到类com.sharecost.entities.User的元数据,但这个类没有增强!!请在运行DataNucleus之前增强课程。

1 个解决方案

#1


0  

I found a solution to the second part of my question. Looking at the POM.xml file I discovered that the all entities are supposed to be in a **/model package.

我找到了问题第二部分的解决方案。查看POM.xml文件,我发现所有实体都应该在** / model包中。

I still don't know if the manual inclusion of the javax.persistence dependency is actually required.

我仍然不知道是否实际需要手动包含javax.persistence依赖项。


分享到: