0 Replies Latest reply on Jun 5, 2019 8:50 AM by Sathish Kumar

    how to exclude jackson-bind in org.jboss.resteasy.resteasy-jackson2-provider in jboss7

    Sathish Kumar Newbie

      HI i have working in openapi(swagger) integration with java rest project.  we are using the jboss 7 server in defalut we have jackson-2.5.4 version but i need jackson-2.9.4 version so i need to exclude the org.jboss.resteasy.resteasy-jackson-provider  so i exclude the module in the jboss-deployment-structure.xml then swagger is working fine as expected but when we call the restservice we get the error as

       

      16:06:12,150 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-2) RESTEASY002010: Failed to execute: javax.ws.rs.NotSupportedException: RESTEASY003200: Could not find message body reader for type: class com.xx.xxx.xxx.sample.loginRequest of content type: application/json

          at org.jboss.resteasy.core.interception.ServerReaderInterceptorContext.throwReaderNotFound(ServerReaderInterceptorContext.java:52) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:75) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:52) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(DigitalVerificationInterceptor.java:34) [resteasy-crypto-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:55) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:55) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:151) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:91) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:114) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:792) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_181]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_181]

          at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_181]

       

       

       

       

       

      jboss-deployment-structure.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

          <deployment>

              <dependencies>

                  <module name="custom.discovery" meta-inf="export">

                      <imports>

                          <include path="META-INF" />

                      </imports>

                  </module>

              </dependencies>

              <exclusions>

                  <module name="org.jboss.resteasy.resteasy-jackson2-provider" />

              </exclusions>

          </deployment>

      </jboss-deployment-structure>

       

       

      if i remove the exclusions then rest service is working swagger is not working. and if we access the swagger then we get the follwoing error

       

       

       

       

      16:20:55,671 ERROR [io.undertow.request] (default task-4) UT005023: Exception handling request to /demo/rest/openapi.json: org.jboss.resteasy.spi.UnhandledException: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.AnnotationIntrospector.findPropertiesToIgnore(Lcom/fasterxml/jackson/databind/introspect/Annotated;Z)[Ljava/lang/String;

          at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:168) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:411) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175) [undertow-servlet-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:792) [undertow-core-1.3.21.Final-redhat-1.jar:1.3.21.Final-redhat-1]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_181]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_181]

          at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_181]

      Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.AnnotationIntrospector.findPropertiesToIgnore(Lcom/fasterxml/jackson/databind/introspect/Annotated;Z)[Ljava/lang/String;

          at io.swagger.v3.core.jackson.ModelResolver.getIgnoredProperties(ModelResolver.java:1757) [swagger-core-2.0.0.jar:2.0.0]

          at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:458) [swagger-core-2.0.0.jar:2.0.0]

          at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:90) [swagger-core-2.0.0.jar:2.0.0]

          at io.swagger.v3.core.converter.ModelConverters.resolveAsResolvedSchema(ModelConverters.java:112) [swagger-core-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.Reader.parseMethod(Reader.java:943) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.Reader.parseMethod(Reader.java:748) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.Reader.read(Reader.java:422) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.Reader.read(Reader.java:169) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.Reader.read(Reader.java:196) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at io.swagger.v3.oas.integration.GenericOpenApiContext.read(GenericOpenApiContext.java:353) [swagger-integration-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.integration.resources.BaseOpenApiResource.getOpenApi(BaseOpenApiResource.java:49) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.integration.resources.OpenApiResource.getOpenApi(OpenApiResource.java:32) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at io.swagger.v3.jaxrs2.integration.resources.OpenApiResource$Proxy$_$$_WeldClientProxy.getOpenApi(Unknown Source) [swagger-jaxrs2-2.0.0.jar:2.0.0]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_181]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_181]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_181]

          at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_181]

          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar:3.0.16.Final-redhat-1]

          ... 32 more

       

       

       

      org.jboss.resteasy.resteasy-jackson2-provider module.xml

      <?xml version="1.0" encoding="UTF-8"?>

       

       

      <module xmlns="urn:jboss:module:1.3" name="org.jboss.resteasy.resteasy-jackson2-provider">

          <resources>

              <resource-root path="resteasy-jackson2-provider-3.0.16.Final-redhat-1.jar"/>

          </resources>

          <dependencies>

              <module name="com.fasterxml.jackson.core.jackson-annotations" export="true"/>

              <module name="com.fasterxml.jackson.core.jackson-core" export="true"/>

              <module name="com.fasterxml.jackson.core.jackson-databind" export="true"/>

              <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider"/>

              <module name="javax.xml.bind.api"/>

              <module name="javax.api"/>

              <module name="javax.enterprise.api"/>

              <module name="javax.servlet.api"/>

              <module name="javax.ws.rs.api"/>

              <module name="org.jboss.resteasy.resteasy-jaxrs"/>

              <module name="org.jboss.logging"/>

          </dependencies>

      </module>

       

      in above the module i have to exclude the com.fasterxml.jackson package only can you help to ssetup the jboss-deployment-structure.xml