简体   繁体   中英

Datanucleus Enhancer error=7 after GWT Compilation

I'm building a GWT + App Engine + JDO project with Maven and Eclipse Photon (same error when a I build the project from command line). After the compilation phase Datanucleus notifice me the error:

Failed to execute goal org.datanucleus:maven-datanucleus-plugin:3.2.0-m1:enhance (default) on project gwtAppEngineJDOProjectName: Error while executing the DataNucleus tool 'org.datanucleus.enhancer.DataNucleusEnhancer'. Error while executing process. Cannot run program "/bin/sh": error=7

There are a META-INF/jdoconfig.xml at src/main/resources in my project structure. After the war plugin execution the META-INF/jdoconfig.xml have been stored correctly in the /target/WARFOLDER/MET-INF/ folder.

My actual jdo-conf:

  <?xml version="1.0" encoding="utf-8" standalone="no"?>
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd">
  <persistence-manager-factory name="transactions-optional">
      <property name="javax.jdo.PersistenceManagerFactoryClass" value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"/>
      <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
      <property name="datanucleus.cache.level2.mode" value="none"/>
      <property name="javax.jdo.option.NontransactionalRead" value="true"/>
      <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
      <property name="javax.jdo.option.RetainValues" value="true"/>
      <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
      <property name="datanucleus.appengine.singletonPMFForName" value="true"/>
  </persistence-manager-factory>
</jdoconfig>

The auto enhance process at my pom.xml

 <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-core</artifactId>
            <version>3.1.3</version>
        </dependency>
    </dependencies>
</plugin>

How can I solve the error=7 Datanucleus error? Thanks.

Using the datanucleus-maven-plugin with this configuration:

 <plugin>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-maven-plugin</artifactId>
        <version>5.0.2</version>
        <configuration>
            <fork>false</fork>
            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
            <verbose>true</verbose>
        </configuration>
        <executions>
            <execution>
                <phase>process-classes</phase>
                <goals>
                    <goal>enhance</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

The enhance process runs automatically after the compile phase. The fork param have been set to false, preventing the "arguments list too long" message. See http://www.datanucleus.org/products/accessplatform/jdo/enhancer.html#maven .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM