java.lang.ClassNotFoundException: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector - PullRequest
0 голосов
/ 11 апреля 2019

Примечание: я уже попробовал решения, упомянутые здесь и здесь

Я работаю над приложением, в котором я использую JAX-RS.Когда я пытаюсь отправить запрос POST, я получаю следующее исключение:

java.lang.NoClassDefFoundError: com / fastxml / jackson / module / jaxb / JaxbAnnotationIntrospector

java.lang.ClassNotFoundException: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector не найден com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider [92]

Сервер, который я использую, - Glassfish 4.1.2

Я попытался добавить необходимые зависимости Джексона (com.fasterxml.jackson.jaxrs) в pom.xml, но все еще получаю ту же ошибку.

pom.xml

<dependency>
    <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.1</version>
</dependency>
<dependency>
         <groupId>org.glassfish.jersey.containers</groupId>
         <artifactId>jersey-container-servlet</artifactId>
         <version>2.26</version>
    </dependency>
    <dependency>
         <groupId>org.glassfish.jersey.core</groupId>
         <artifactId>jersey-server</artifactId>
         <version>2.26</version>
    </dependency>
    <dependency>
         <groupId>org.glassfish.jersey.inject</groupId>
         <artifactId>jersey-hk2</artifactId>
         <version>2.26</version>
    </dependency>
    <dependency>
         <groupId>com.fasterxml.jackson.jaxrs</groupId>
         <artifactId>jackson-jaxrs-json-provider</artifactId>
         <version>2.9.8</version>
    </dependency>
    <dependency>
         <groupId>com.fasterxml.jackson.module</groupId>
         <artifactId>jackson-module-jaxb-annotations</artifactId>
         <version>2.9.8</version>
    </dependency>
<dependency>
         <groupId>com.fasterxml.jackson.jaxrs</groupId>
         <artifactId>jackson-jaxrs-base</artifactId>
         <version>2.9.8</version>
    </dependency>
...