com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector not found — while using Swagger

筅森魡賤 提交于 2019-12-05 14:48:49

The stack trace mentions: java.lang.ClassNotFoundException: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector not found by com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider

and you are excluding the JAXB annotation module:

<exclusion>
   <groupId>com.fasterxml.jackson.module</groupId>
   <artifactId>jackson-module-jaxb-annotations</artifactId>
</exclusion>

The exclusion means a dependency is not resolved, and therefore you'll get the ClassNotFoundException

Ron

I don't know if this applies to 4.1.1 as well, but Glassfish 4.1 was shipped with old Jackson version and that was the cause to the issue you bring above.

To solve it, you'd have to force Glassfish to load Jackson 2.4.5 at least which is the minimum requirement for swagger-core. Upgrading Jackson in GlassFish 4.1 covers this procedure.

This worked for me:

Steps: 1-Stop domain

2-Remove content of this folder: Glassfish\glassfish\domains\DOMAIN_NAME\osgi-cache\felix

3-In this folder: C:\Glassfish\glassfish\modules Substitute jackson libraries by the 2.4.4 version:

jackson-module-jaxb-annotations-2.4.4

jackson-jaxrs-json-provider-2.4.4

jackson-jaxrs-base-2.4.4

jackson-databind-2.4.4

jackson-annotations-2.4.4

jackson-core-2.4.4

4-Start domain

I hope it helps :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!