Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:20:28+00:00 2026-06-17T17:20:28+00:00

I have a problem building an android maven project (eclipse m2e, android for maven).

  • 0

I have a problem building an android maven project (eclipse m2e, android for maven).

The “install” goal resumes with:

[INFO] UNEXPECTED TOP-LEVEL EXCEPTION:
[INFO] java.lang.IllegalArgumentException: already added: Ljavax/persistence/Access;
[INFO]  at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)

I’ve added the following dependency to the project:

<dependency>
    <groupId>org.odata4j</groupId>
    <artifactId>odata4j-jersey</artifactId>
    <version>0.7.0</version>
</dependency>

This dependency adds also (among other things) javax.persistence-2.0.0.jar.

So I think the library is added twice? But how to solve this problem?
When I remove the dependency the project can be built without errors.

Here is the output of the command: maven dependency:tree

[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ myapp ---
[INFO] org.subby.android:myapp:apk:0.0.1-SNAPSHOT
[INFO] +- com.google.android:android:jar:4.1.1.4:provided
[INFO] |  +- commons-logging:commons-logging:jar:1.1.1:provided
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.0.1:provided
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.0.1:provided
[INFO] |  |  +- (commons-logging:commons-logging:jar:1.1.1:provided - omitted for  duplicate)
[INFO] |  |  \- commons-codec:commons-codec:jar:1.3:provided
[INFO] |  +- org.khronos:opengl-api:jar:gl1.1-android-2.1_r1:provided
[INFO] |  +- xerces:xmlParserAPIs:jar:2.6.2:provided
[INFO] |  +- xpp3:xpp3:jar:1.1.4c:provided
[INFO] |  \- org.json:json:jar:20080701:provided
[INFO] \- org.odata4j:odata4j-jersey:jar:0.7.0:compile
[INFO]    +- org.odata4j:odata4j-core:jar:0.7.0:compile
[INFO]    |  +- org.core4j:core4j:jar:0.5:compile
[INFO]    |  +- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO]    |  +- org.eclipse.persistence:javax.persistence:jar:2.0.0:compile
[INFO]    |  +- org.eclipse.persistence:eclipselink:jar:2.1.2:compile
[INFO]    |  \- joda-time:joda-time:jar:1.6:compile
[INFO]    +- com.sun.jersey:jersey-core:jar:1.1.5:compile
[INFO]    |  \- (javax.ws.rs:jsr311-api:jar:1.1.1:compile - omitted for duplicate)
[INFO]    +- com.sun.jersey:jersey-server:jar:1.1.5:compile
[INFO]    |  +- (com.sun.jersey:jersey-core:jar:1.1.5:compile - omitted for duplicate)
[INFO]    |  \- asm:asm:jar:3.1:compile
[INFO]    \- com.sun.jersey:jersey-client:jar:1.1.5:compile
[INFO]       \- (com.sun.jersey:jersey-core:jar:1.1.5:compile - omitted for duplicate)

Am I doing something wrong? I’m still very new on maven.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:20:29+00:00Added an answer on June 17, 2026 at 5:20 pm

    I got the solution:

    It seems that the two dependencies of odata4j:

    eclipselink-2.1.2
    javax.persistence
    

    have some classes in common.

    So the problem is solved when either the one or the other dependency is excluded.

    Seems like this is really just an android/adt issue. Normally you do not need to exclude dependencies of a single artifact, do you?

    The dependency now looks like this:

    <dependency>
        <groupId>org.odata4j</groupId>
        <artifactId>odata4j-core</artifactId>
        <version>0.7.0</version>
        <exclusions>
            <exclusion>
                <groupId>org.eclipse.persistence</groupId>
                <artifactId>javax.persistence</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    

    Big thanks to Mite for the helpful hint.

    Regards,
    Alex

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem when running mvn clean install in my android project:
Pretty new with java/eclipse. Problem: I have two packages in one android project. I
I have a problem with building multi level select box. I have category table
I have a bit of a problem building my project. I'm getting the bellow
I have an old C++ project and I'm having problem building it. For a
I have a new problem. I am building an Android timer. In the main
I have an Android project on Eclipse (STS) and it is giving me this
Using eclipse, first of all. I'm building an Android calculator. I have all my
I have a problem with building the Platinum UPnP stack with Android NDK on
I have been building my android app in an android eclipse environment. Building my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.