jersey
  1. jersey
  2. JERSEY-1963

Dependency Error for jersey-media-moxy 2.0

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: media
    • Labels:
      None
    • Environment:

      Apache Maven 3.0.5
      java version "1.7.0_25"
      OpenJDK Runtime Environment (fedora-2.3.10.4.fc19-x86_64)

      Description

      I followed the documentation on https://jersey.java.net/documentation/latest/user-guide.html#json.moxy and added

      <dependency>
         <groupId>org.glassfish.jersey.media</groupId>
         <artifactId>jersey-media-moxy</artifactId>
         <version>2.0</version>
      </dependency>
      

      to my project.

      Now I get the following maven error:
      The following artifacts could not be resolved: org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.5.0-M13, org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.3.2: Could not find artifact org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.5.0-M13 in central (http://repo.maven.apache.org/maven2)

      Also I can't find 2.5.0-M13 on maven central:
      http://search.maven.org/#search|gav|1|g%3A%22org.eclipse.persistence%22%20AND%20a%3A%22org.eclipse.persistence.moxy%22

        Activity

        Hide
        Michal Gajdos added a comment -

        This will be fixed in version 2.1, in the meantime, you can use:

        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-moxy</artifactId>
            <version>2.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>org.eclipse.persistence.moxy</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>org.eclipse.persistence.antlr</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.moxy</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.antlr</artifactId>
            <version>2.5.0</version>
        </dependency>
        
        Show
        Michal Gajdos added a comment - This will be fixed in version 2.1 , in the meantime, you can use: <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-moxy</artifactId> <version>2.0</version> <exclusions> <exclusion> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.moxy</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.antlr</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.moxy</artifactId> <version>2.5.0</version> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.antlr</artifactId> <version>2.5.0</version> </dependency>
        Hide
        fredroth added a comment - - edited

        Thanks, now it compiles, but now it get:
        java.lang.NoClassDefFoundError: org/eclipse/persistence/jaxb/rs/MOXyJsonProvider
        java.lang.NoClassDefFoundError: org/glassfish/jersey/moxy/json/internal/ConfigurableMoxyJsonProvider

        After deploying my project to a tomcat server. Is this related? Should I switch to Jackson until 2.1?

        Show
        fredroth added a comment - - edited Thanks, now it compiles, but now it get: java.lang.NoClassDefFoundError: org/eclipse/persistence/jaxb/rs/MOXyJsonProvider java.lang.NoClassDefFoundError: org/glassfish/jersey/moxy/json/internal/ConfigurableMoxyJsonProvider After deploying my project to a tomcat server. Is this related? Should I switch to Jackson until 2.1?
        Hide
        Michal Gajdos added a comment -

        Do you have these dependencies in your .war file?

        WEB-INF/lib/org.eclipse.persistence.moxy-2.5.0.jar
        WEB-INF/lib/org.eclipse.persistence.asm-2.5.0.jar
        WEB-INF/lib/org.eclipse.persistence.antlr-2.5.0.jar
        WEB-INF/lib/org.eclipse.persistence.core-2.5.0.jar
        WEB-INF/lib/jersey-media-moxy-2.0.jar
        
        Show
        Michal Gajdos added a comment - Do you have these dependencies in your .war file? WEB-INF/lib/org.eclipse.persistence.moxy-2.5.0.jar WEB-INF/lib/org.eclipse.persistence.asm-2.5.0.jar WEB-INF/lib/org.eclipse.persistence.antlr-2.5.0.jar WEB-INF/lib/org.eclipse.persistence.core-2.5.0.jar WEB-INF/lib/jersey-media-moxy-2.0.jar
        Hide
        fredroth added a comment -

        Sorry, my mistake

        Thanks for your help Michal!

        Show
        fredroth added a comment - Sorry, my mistake Thanks for your help Michal!

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            fredroth
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: