Google AdSense (text)

hidden logo stop

Moving

거지 같은 이글루스 광고노출 정책이 싫어서,
새 보금자리(http://blog.leocat.kr/)로 이사감.

[JDO, Maven] JDO enhancement 시 예외 - "org.datanucleus" is already registered Computer & Program

JDO를 포함한 프로젝트를 maven으로 enhancement 하다 보면 다음과 같은 예외를 뱉으며 컴파일이 되지 않는 경우가 있다. 하하하 JDO 겁나 난감한 라이브러리고만.. 예제 하나 제대로 돌리려면 만나는 예외가 몇 개여.. =ㅅ=;;
[ERROR] --------------------
[ERROR] Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer :
[ERROR] --------------------
[ERROR] 2011. 8. 1 오후 5:49:15 org.datanucleus.enhancer.DataNucleusEnhancer <init>
정보: DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JDO"
Exception in thread "main" Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/.../.m2/repository/org/datanucleus/datanucleus-core/3.0.0-m6/datanucleus-core-3.0.0-m6.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/.../.m2/repository/org/datanucleus/datanucleus-core/3.0.0-release/datanucleus-core-3.0.0-release.jar."
org.datanucleus.exceptions.NucleusException: Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/.../.m2/repository/org/datanucleus/datanucleus-core/3.0.0-m6/datanucleus-core-3.0.0-m6.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/.../.m2/repository/org/datanucleus/datanucleus-core/3.0.0-release/datanucleus-core-3.0.0-release.jar."
    at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:540)
    at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:395)
    at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(NonManagedPluginRegistry.java:219)
    at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(NonManagedPluginRegistry.java:160)
    at org.datanucleus.plugin.PluginManager.<init>(PluginManager.java:62)
    at org.datanucleus.NucleusContext.<init>(NucleusContext.java:211)
    at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:171)
    at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1265)


라이브러리가 서로 dependency를 가지고 있기 때문에 enhancement 하면서 동일한 라이브러리가 충돌나는 것 같다. 해결 방법은 정말 간단.. 예외 메시지에 써 있는 것처럼 core쪽 라이브러리를 실행할 때 까지 제외시켜 보자.
<dependency>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-core</artifactId>
    <version>${org.datanucleus.version}</version>
    <scope>runtime</scope>
</dependency>


현재 내가 쓰고 있는 JDO 관련 maven dependency 설정이다.
<dependency>
    <groupId>javax.jdo</groupId>
    <artifactId>jdo-api</artifactId>
    <version>${jdo.version}</version>
</dependency>
<dependency>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-core</artifactId>
    <version>${org.datanucleus.version}</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-api-jdo</artifactId>
    <version>${org.datanucleus.version}</version>
</dependency>
<dependency>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-rdbms</artifactId>
    <version>${org.datanucleus.version}</version>
</dependency>



- 출처 : http://stackoverflow.com/questions/877949/problem-using-datanucleus-enhancer-in-a-maven-google-app-engine-project

덧글

댓글 입력 영역

Google AdSense (text/image)