Мой код соответствует, но когда я пытаюсь запустить Enhancer DataNucleus, я не могу завершить этап компиляции сообщения. Я предполагаю, что мне не хватает файла jar, но какой? Я включил ошибку и pom.xmlDataNucleus enchancer не может создать экземпляр org.datanucleus.api.jdo.JDOAdapter
Я скопировать инструкции на страницах Google:
<plugin>
<groupId>org.datanucleus</groupId>
<artifactId>maven-datanucleus-plugin</artifactId>
<version>3.2.0-m1</version>
<configuration>
<api>JDO</api>
<props>${basedir}/datanucleus.properties</props>
<verbose>true</verbose>
<enhancerName>ASM</enhancerName>
</configuration>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
<version>3.1.3</version>
</dependency>
</dependencies>
</plugin>
И я получаю эту ошибку.
And I get this error. [ERROR] -------------------- [ERROR] Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer : [ERROR] -------------------- [ERROR] Exception in thread "main" Error : An error occurred trying to instantiate an instance of the API adapter "org.datanucleus.api.jdo.JDOAdapter" (perhaps you dont have the requisite datanucleus-api-XXX jar in the CLASSPATH, or the jar for the persistence spec you are using?) : {1} org.datanucleus.exceptions.NucleusUserException: Error : An error occurred trying to instantiate an instance of the A adapter "org.datanucleus.api.jdo.JDOAdapter" (perhaps you dont have the requisite datanucleus-api-XXX jar in the CLAS TH, or the api jar for the persistence spec you are using?) : {1} at org.datanucleus.api.ApiAdapterFactory.getApiAdapter(ApiAdapterFactory.java:104) at org.datanucleus.AbstractNucleusContext.(AbstractNucleusContext.java:115) at org.datanucleus.enhancer.EnhancementNucleusContextImpl.(EnhancementNucleusContextImpl.java:48) at org.datanucleus.enhancer.EnhancementNucleusContextImpl.(EnhancementNucleusContextImpl.java:37) at org.datanucleus.enhancer.DataNucleusEnhancer.(DataNucleusEnhancer.java:161) at org.datanucleus.enhancer.CommandLineHelper.createDataNucleusEnhancer(CommandLineHelper.java:148) at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1108)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
\t xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
\t <modelVersion>4.0.0</modelVersion>
\t <packaging>war</packaging>
\t <version>1.0-SNAPSHOT</version>
\t <groupId>com.thechrisoneil.mygroupstogo</groupId>
\t <artifactId>mygroupstogo</artifactId>
\t <properties>
\t \t <appengine.app.version>1</appengine.app.version>
\t \t <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
\t </properties>
\t <prerequisites>
\t \t <maven>3.1.0</maven>
\t </prerequisites>
\t <dependencies>
\t \t <!-- Compile/runtime dependencies, as defined by Google default maven project -->
\t \t <!-- https://cloud.google.com/appengine/docs/java/tools/maven -->
\t \t <dependency>
\t \t \t <groupId>com.google.appengine</groupId>
\t \t \t <artifactId>appengine-api-1.0-sdk</artifactId>
\t \t \t <version>1.9.18</version>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>com.google.appengine</groupId>
\t \t \t <artifactId>appengine-endpoints</artifactId>
\t \t \t <version>1.9.18</version>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>javax.servlet</groupId>
\t \t \t <artifactId>servlet-api</artifactId>
\t \t \t <version>2.5</version>
\t \t \t <scope>provided</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>javax.inject</groupId>
\t \t \t <artifactId>javax.inject</artifactId>
\t \t \t <version>1</version>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>javax.jdo</groupId>
\t \t \t <artifactId>jdo-api</artifactId>
\t \t \t <version>3.1.3</version>
\t \t </dependency>
\t \t <!-- Dependencies added for datastorage persistents -->
\t \t <!-- Datanucleaus (http://www.datanucleus.org/products/datanucleus/jdo/maven.html) -->
\t \t <dependency>
\t \t \t <groupId>com.google.appengine.orm</groupId>
\t \t \t <artifactId>datanucleus-appengine</artifactId>
\t \t \t <version>2.1.2</version>
\t \t </dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>3.1.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
<version>3.1.3</version>
</dependency>
\t \t <!-- Test Dependencies -->
\t \t <dependency>
\t \t \t <groupId>junit</groupId>
\t \t \t <artifactId>junit</artifactId>
\t \t \t <version>4.11</version>
\t \t \t <scope>test</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>org.mockito</groupId>
\t \t \t <artifactId>mockito-all</artifactId>
\t \t \t <version>1.9.5</version>
\t \t \t <scope>test</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>com.google.appengine</groupId>
\t \t \t <artifactId>appengine-testing</artifactId>
\t \t \t <version>1.9.18</version>
\t \t \t <scope>test</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>com.google.appengine</groupId>
\t \t \t <artifactId>appengine-api-stubs</artifactId>
\t \t \t <version>1.9.18</version>
\t \t \t <scope>test</scope>
\t \t </dependency>
\t \t <dependency>
\t \t \t <groupId>javax.jdo</groupId>
\t \t \t <artifactId>jdo-api</artifactId>
\t \t \t <version>3.0.1</version>
\t \t </dependency>
\t </dependencies>
\t <build>
\t \t <!-- for hot reload of the web application -->
\t \t <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
\t \t <plugins>
\t \t \t <plugin>
\t \t \t \t <groupId>org.codehaus.mojo</groupId>
\t \t \t \t <artifactId>versions-maven-plugin</artifactId>
\t \t \t \t <version>2.1</version>
\t \t \t \t <executions>
\t \t \t \t \t <execution>
\t \t \t \t \t \t <phase>compile</phase>
\t \t \t \t \t \t <goals>
\t \t \t \t \t \t \t <goal>display-dependency-updates</goal>
\t \t \t \t \t \t \t <goal>display-plugin-updates</goal>
\t \t \t \t \t \t </goals>
\t \t \t \t \t </execution>
\t \t \t \t </executions>
\t \t \t </plugin>
\t \t \t <plugin>
\t \t \t \t <groupId>org.apache.maven.plugins</groupId>
\t \t \t \t <version>3.1</version>
\t \t \t \t <artifactId>maven-compiler-plugin</artifactId>
\t \t \t \t <configuration>
\t \t \t \t \t <source>1.7</source>
\t \t \t \t \t <target>1.7</target>
\t \t \t \t </configuration>
\t \t \t </plugin>
\t \t \t <plugin>
\t \t \t \t <groupId>org.apache.maven.plugins</groupId>
\t \t \t \t <artifactId>maven-war-plugin</artifactId>
\t \t \t \t <version>2.4</version>
\t \t \t \t <configuration>
\t \t \t \t \t <webXml>${project.build.directory}/generated-sources/appengine-endpoints/WEB-INF/web.xml</webXml>
\t \t \t \t \t <webResources>
\t \t \t \t \t \t <resource>
\t \t \t \t \t \t \t <!-- this is relative to the pom.xml directory -->
\t \t \t \t \t \t \t <directory>${project.build.directory}/generated-sources/appengine-endpoints</directory>
\t \t \t \t \t \t \t <!-- the list has a default value of ** -->
\t \t \t \t \t \t \t <includes>
\t \t \t \t \t \t \t \t <include>WEB-INF/*.discovery</include>
\t \t \t \t \t \t \t \t <include>WEB-INF/*.api</include>
\t \t \t \t \t \t \t </includes>
\t \t \t \t \t \t </resource>
\t \t \t \t \t \t <!--Development of groupstogo front end is imported to deployment server -->
\t \t \t \t \t \t <resource>
\t \t \t \t \t \t \t <directory>C:/software/angularjs/my-gtg/app</directory>
\t \t \t \t \t \t \t <filtering>true</filtering>
\t \t \t \t \t \t \t <includes>
\t \t \t \t \t \t \t \t <include>**/*.js</include>
\t \t \t \t \t \t \t \t <include>**/*.html</include>
\t \t \t \t \t \t \t \t <include>**/*.png</include>
\t \t \t \t \t \t \t \t <include>**/*.css</include>
\t \t \t \t \t \t \t </includes>
\t \t \t \t \t \t \t <targetPath>app</targetPath>
\t \t \t \t \t \t </resource>
\t \t \t \t \t \t
\t \t \t \t \t </webResources>
\t \t \t \t </configuration>
\t \t \t </plugin>
\t \t \t <plugin>
\t \t \t \t <groupId>com.google.appengine</groupId>
\t \t \t \t <artifactId>appengine-maven-plugin</artifactId>
\t \t \t \t <version>1.9.18</version>
\t \t \t \t <configuration>
\t \t \t \t \t <enableJarClasses>false</enableJarClasses>
\t \t \t \t \t <!-- Comment in the below snippet to bind to all IPs instead of just
\t \t \t \t \t \t localhost -->
\t \t \t \t \t <!-- address>0.0.0.0</address> <port>8080</port -->
\t \t \t \t \t <!-- Comment in the below snippet to enable local debugging with a remove
\t \t \t \t \t \t debugger like those included with Eclipse or IntelliJ -->
\t \t \t \t \t <!-- jvmFlags> <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
\t \t \t \t \t \t </jvmFlags -->
\t \t \t \t </configuration>
\t \t \t \t <executions>
\t \t \t \t \t <execution>
\t \t \t \t \t \t <goals>
\t \t \t \t \t \t \t <goal>endpoints_get_discovery_doc</goal>
\t \t \t \t \t \t </goals>
\t \t \t \t \t </execution>
\t \t \t \t </executions>
\t \t \t </plugin>
\t \t \t <plugin>
<groupId>org.datanucleus</groupId>
<artifactId>maven-datanucleus-plugin</artifactId>
<version>3.2.0-m1</version>
<configuration>
<api>JDO</api>
<props>${basedir}/datanucleus.properties</props>
<verbose>true</verbose>
<enhancerName>ASM</enhancerName>
</configuration>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
<version>3.1.3</version>
</dependency>
</dependencies>
</plugin>
\t \t </plugins>
\t </build>
</project>
Почему бы вам использовать datanucleus-core/datanucleus-json из v4.x с datanucleus-api-jdo v3.1.x и datanucleus Maven плагин v3.2.x ??! Совершенно непоследовательно. –
О, и нет такой вещи, как «javax.jdo» jdo-api v3.1.3. –
Какова ваша рекомендация по правильным версиям? Вот что GAE рекомендовал на их [link] (https://cloud.google.com/appengine/docs/java/datastore/jdo/overview-dn2#Copying_the_JARs) веб-сайте: ' org.datanucleus datanucleus- api-jdo 3.1.3 ' –
TheChrisONeil