Jackson error: java.lang.NoClassDefFoundError: com / quickxml / jackson / core / Versioned

I am working on Maven-EJB and want to convert a java object to JSON, I use json json lib, but I got:

java.lang.ClassNotFoundException: com.fasterxml.jackson.core.Versioned

I added these dependencies to the pom.xml file:

<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jaxb-annotations</artifactId> <version>2.4.0</version> </dependency> </dependencies> 

in Java Facade I write these lines for conversion:

String json = "";

  try { ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter(); json = ow.writeValueAsString(userlist); } catch (JsonProcessingException e) { throw new BusinessException("error_json"); } 

and here is the import:

import com.fasterxml.jackson.core.JsonProcessingException; Import com.fasterxml.jackson.databind.ObjectMapper; Import com.fasterxml.jackson.databind.ObjectWriter;

I checked the path to the classes and made a lot of clean and prefabricated, but could not, the same exception appears !!

I am working on NetBeans8 and Java 1.7

Thanks in advance Mariam

+5
source share
1 answer

Thank you, Quettos, it works, I checked the versions of the application server and maven jars, after which I downloaded the latest 2.4.0 Jackson jars and updated the jars from Glassfish lib with version 2.4.0

-1
source

All Articles