Skip to main content

How to add Jackson 2.0.x to Glassfish?

No replies
ossaert
Offline
Joined: 2007-03-09

Hi,

I want to deploy a WAR file which includes Jackson 2.0.5. I added the following to the pom.xml:

        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
            <version>2.0.5</version>
        </dependency>
              <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.0.5</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.0.5</version>
        </dependency>

A transitive dependency also adds:

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.0.5</version>
        </dependency>

When I deploy my WAR to the server, Jersey picks up the JSON-Providers:

  class com.fasterxml.jackson.jaxrs.json.JsonMappingExceptionMapper
  class com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
  class com.fasterxml.jackson.jaxrs.json.JsonParseExceptionMapper
  class com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider

However, when I query the REST-Resource, "old" JSON is delivered. It does not come from these new classes.

I used the "fasterxml" annotations instead of the "codehaus" annotations.

I tried to set <class-loader delegate="false" /> in the glassfish-web.xml. But that didn't help either.

How can I fix this problem?

Greetings
Jan De Cooman