加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – InvocationTargetException:插件(Bundle)“org.datanuc

发布时间:2020-12-15 08:44:07 所属栏目:Java 来源:网络整理
导读:我正在尝试遵循DataOucleus tutorial for JDO.我正在使用Maven,我已按照 here提供的增强器说明进行操作. 但是,我收到以下错误: [datanucleus:enhance]Could not transfer metadata asm:asm/maven-metadata.xml from/to local.repository (file:../../local.
我正在尝试遵循DataOucleus tutorial for JDO.我正在使用Maven,我已按照 here提供的增强器说明进行操作.

但是,我收到以下错误:

[datanucleus:enhance]
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
  CP: C:... .m2repositoryorgdatanucleusmaven-datanucleus-plugin3.0.0-releasemaven-datanucleus-plugin-3.0.0-release.jar
  CP: C:... .m2repositoryorgdatanucleusdatanucleus-core3.0.2datanucleus-core-3.0.2.jar
  CP: C:... .m2repositoryorgdatanucleusdatanucleus-enhancer3.0.0-releasedatanucleus-enhancer-3.0.0-release.jar
  CP: C:... .m2repositoryjavaxjdojdo-api3.1-SNAPSHOT-20110926jdo-api-3.1-SNAPSHOT-20110926.jar
  CP: C:... .m2repositoryjavaxtransactiontransaction-api1.1transaction-api-1.1.jar
  CP: C:... .m2repositoryorgapachegeronimospecsgeronimo-jpa_2.0_spec1.0geronimo-jpa_2.0_spec-1.0.jar
  CP: C:... .m2repositoryasmasm3.3.1asm-3.3.1.jar
  CP: C:... .m2repositoryorgcodehausplexusplexus-utils1.2plexus-utils-1.2.jar
  CP: C:... .m2repositoryjunitjunit3.8.1junit-3.8.1.jar
  CP: C:... trunkplasmatargetclasses
  CP: C:... .m2repositorynetdwstgenerics1.2.0generics-1.2.0.jar
  CP: C:... .m2repositoryorgswinglabsswing-layout1.0.3swing-layout-1.0.3.jar
  CP: C:... .m2repositoryorgapachemavenmaven-plugin-api2.0.8maven-plugin-api-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenmaven-project2.0.8maven-project-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenmaven-settings2.0.8maven-settings-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenmaven-profile2.0.8maven-profile-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenmaven-model2.0.8maven-model-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenmaven-artifact-manager2.0.8maven-artifact-manager-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenmaven-repository-metadata2.0.8maven-repository-metadata-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenwagonwagon-provider-api1.0-beta-2wagon-provider-api-1.0-beta-2.jar
  CP: C:... .m2repositoryorgapachemavenmaven-plugin-registry2.0.8maven-plugin-registry-2.0.8.jar
  CP: C:... .m2repositoryorgapachemavenmaven-artifact2.0.8maven-artifact-2.0.8.jar
  CP: C:... .m2repositoryorgcodehausplexusplexus-container-default1.0-alpha-9-stable-1plexus-container-default-1.0-alpha-9-stable-1.jar
  CP: C:... .m2repositoryclassworldsclassworlds1.1-alpha-2classworlds-1.1-alpha-2.jar
  CP: C:... .m2repositoryorgcodehausplexusplexus-utils1.4.5plexus-utils-1.4.5.jar
  CP: C:... .m2repositorycomh2databaseh21.3.158h2-1.3.158.jar
  CP: C:... .m2repositoryorgjbossnettynetty3.2.4.Finalnetty-3.2.4.Final.jar
  CP: C:... .m2repositoryorgapachecommonscommons-math2.2commons-math-2.2.jar
  CP: C:... .m2repositorynetflatflat1.2.0flat-1.2.0.jar
  CP: C:... .m2repositorycompyx4meproguard-maven-plugin2.0.4proguard-maven-plugin-2.0.4.jar
  CP: C:... .m2repositoryantant1.6.5ant-1.6.5.jar
  CP: C:... .m2repositoryorgapachemavenmaven-archiver2.3maven-archiver-2.3.jar
  CP: C:... .m2repositoryorgcodehausplexusplexus-archiver1.0-alpha-9plexus-archiver-1.0-alpha-9.jar
  CP: C:... .m2repositoryorgcodehausplexusplexus-io1.0-alpha-1plexus-io-1.0-alpha-1.jar
  CP: C:... .m2repositorycomsuncodemodelcodemodel2.4codemodel-2.4.jar
  CP: C:... .m2repositoryorgdatanucleusdatanucleus-core3.0.0-releasedatanucleus-core-3.0.0-release.jar
  CP: C:... .m2repositoryorgdatanucleusdatanucleus-api-jdo3.0.0-releasedatanucleus-api-jdo-3.0.0-release.jar
  CP: C:... .m2repositoryorgdatanucleusdatanucleus-rdbms3.0.0-releasedatanucleus-rdbms-3.0.0-release.jar
  CP: C:... .m2repositoryjavaxjdojdo-api3.0jdo-api-3.0.jar
07-oct.-2011 18:01:05 org.datanucleus.enhancer.DataNucleusEnhancer <init>
INFO: DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JDO"
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 8.475s
Finished at: Fri Oct 07 18:01:05 CEST 2011
Final Memory: 12M/29M
------------------------------------------------------------------------
Failed to execute goal org.datanucleus:maven-datanucleus-plugin:3.0.0-release:enhance (default) on project plasma:
Error executing enhancer: InvocationTargetException: Plugin (Bundle) "org.datanucleus" is already registered.
Ensure you dont have multiple JAR versions of the same plugin in the classpath.
The URL "file:/C:/... /.m2/repository/org/datanucleus/datanucleus-core/3.0.2/datanucleus-core-3.0.2.jar" is already registered,and you are trying to register an identical plugin located at URL "file:/C:/... /.m2/repository/org/datanucleus/datanucleus-core/3.0.0-release/datanucleus-core-3.0.0-release.jar." -> [Help 1]

有谁知道如何解决这个问题?什么是使本教程适用于3.0.0版本的正确pom.xml配置?

编辑

这是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>net.dwst</groupId>
    <artifactId>datanucleus</artifactId>
    <version>1.0.0</version>

    <name>DataNucleus 1.0.0</name>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.source>1.6</project.build.source>
        <project.build.target>1.6</project.build.target>
    </properties>

    <build>

        <finalName>DataNucleus</finalName>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>        

        <plugins>

            <!-- Source code target JDK version & encoding -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>${project.build.source}</source>
                    <target>${project.build.target}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

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

        </plugins>

    </build>

    <dependencies>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-core</artifactId>
            <version>3.0.0-release</version>
        </dependency>

        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-api-jdo</artifactId>
            <version>3.0.0-release</version>
        </dependency>

        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-rdbms</artifactId>
            <version>3.0.0-release</version>
        </dependency>

        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>maven-datanucleus-plugin</artifactId>
            <version>3.0.0-release</version>
        </dependency>

        <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo-api</artifactId>
            <version>3.0</version>
        </dependency>        

    </dependencies>

</project>

解决方法

阅读 this后,我找到了解决方案:

<dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-core</artifactId>
        <version>3.0.0-release</version>
        <scope>runtime</scope>
    </dependency>

核心依赖范围应该是运行时.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读