【问题标题】:Maven GAE/Datanucleus uncertaintiesMaven GAE/Datanucleus 不确定性
【发布时间】:2011-10-02 22:37:59
【问题描述】:

我今天花了一些时间,尝试制作我的第一个 Maven 托管 Google 应用引擎 1.5.4 + GWT 2.4.0 版本。

我终于到了一切都可以编译的阶段,并且 gae:run 目标有效。这是我想象中的更多工作,但是,嘿,这一切都很有趣。

无论如何,我现在的问题是,尽管一切正常,但当数据核增强器运行时,我得到以下错误。

[ERROR] --------------------
[ERROR]  Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer :
[ERROR] --------------------
[ERROR] Oct 02, 2011 11:04:39 PM org.datanucleus.enhancer.DataNucleusEnhancer <init>
INFO: DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JDO"
Oct 02, 2011 11:04:39 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
INFO: Bundle "org.datanucleus" has an optional dependency to "org.eclipse.equinox.registry" but it cannot be resolved
Oct 02, 2011 11:04:39 PM org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
INFO: Bundle "org.datanucleus" has an optional dependency to "org.eclipse.core.runtime" but it cannot be resolved
Oct 02, 2011 11:04:39 PM org.datanucleus.enhancer.DataNucleusEnhancer main
INFO: DataNucleus Enhancer (version 1.1.4) : Validation of enhancement state
Oct 02, 2011 11:04:40 PM org.datanucleus.jdo.metadata.JDOAnnotationReader processClassAnnotations
INFO: Class "net.kindleit.gae.example.model.Message" has been specified with JDO annotations so using those.
Oct 02, 2011 11:04:40 PM org.datanucleus.metadata.MetaDataManager loadClasses
INFO: Class "net.kindleit.gae.example.model.Messages" has no MetaData or annotations. 
Oct 02, 2011 11:04:40 PM org.datanucleus.enhancer.DataNucleusEnhancer addMessage
INFO: ENHANCED (PersistenceCapable) : net.kindleit.gae.example.model.Message
Oct 02, 2011 11:04:40 PM org.datanucleus.enhancer.DataNucleusEnhancer addMessage
INFO: DataNucleus Enhancer completed with success for 1 classes. Timings : input=78 ms, enhance=15 ms, total=93 ms. Consult the log for full details
[ERROR] --------------------

那里发生了什么? [ERROR] 块是怎么回事?好像完全没有错误?

另外,我收到以下警告,我不完全理解

[WARNING] Could not transfer metadata asm:asm/maven-metadata.xml from/to local.repository (file:../../local.repository/trunk): No connector available to access repository local.repository (file:../../local.repository/trunk) of type legacy using the available factories WagonRepositoryConnectorFactory

最后,为什么所有依赖项都添加到 datanucleus enchancer 类路径中? 有一个来自 datanucleus 增强器的 [INFO] 消息,列出了其类路径中的所有 jar,它似乎包含所有内容,为什么?我会认为那里只需要 JDO 和持久性相关的库吗?

【问题讨论】:

    标签: java google-app-engine maven-2 google-cloud-datastore maven-gae-plugin


    【解决方案1】:

    我和你有同样的错误。然后我将版本更改为最新版本。错误消失了。

    <properties>
        <datanucleus.version>3.0.1</datanucleus.version>
        <maven-datanucleus-plugin>3.0.0-release</maven-datanucleus-plugin>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    
        <!--datanucleus related dependencies-->
        <dependency>
            <groupId>com.google.appengine.orm</groupId>
            <artifactId>datanucleus-appengine</artifactId>
            <version>1.0.10</version>
        </dependency>
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-core</artifactId>
            <version>${datanucleus.version}</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.transaction</groupId>
                    <artifactId>transaction-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--jdo related dependencies-->
        <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo2-api</artifactId>
            <version>2.3-ec</version>
            <exclusions>
                <!--
                    exclude the legacy javax.transaction:transaction-api and replace it
                    with javax.transaction:jta (it appears to be the same thing)
                -->
                <exclusion>
                    <groupId>javax.transaction</groupId>
                    <artifactId>transaction-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
        </dependency>
    
    
    <build>
        <plugins>
        ..........
            <plugin>
                <groupId>org.datanucleus</groupId>
                <artifactId>maven-datanucleus-plugin</artifactId>
                <version>${maven-datanucleus-plugin}</version>
                <configuration>
                    <!--
                        Make sure this path contains your persistent classes!
                    -->
                    <mappingIncludes>**/db/*.class</mappingIncludes>
                    <verbose>true</verbose>
                    <enhancerName>ASM</enhancerName>
                    <api>JDO</api>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>enhance</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-core</artifactId>
                        <version>${datanucleus.version}</version>
                        <exclusions>
                            <exclusion>
                                <groupId>javax.transaction</groupId>
                                <artifactId>transaction-api</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-rdbms</artifactId>
                        <version>${datanucleus.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-enhancer</artifactId>
                        <version>${datanucleus.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-api-jdo</artifactId>
                        <version>${datanucleus.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-12
      • 2011-02-21
      • 2013-10-04
      • 2014-11-12
      • 2012-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多