Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15473

Spring Boot Swagger Example - API specification generation fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0, 3.4.4
    • Component/s: camel-spring-boot
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Hi! I'm currently looking through your examples for Camel Spring Boot integration and am having an issue with Camel SB Examples :: REST DSL and Swagger. As opposed to the other example where an API specification should be generated I can get this example to run, however when I try to access the API specification (http://localhost:8080/api/api-doc) I get the following exception:

      org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[]
      {{ at org.apache.camel.CamelExecutionException.wrapCamelExecutionException(CamelExecutionException.java:47) ~[camel-api-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.support.DefaultExchange.setException(DefaultExchange.java:425) ~[camel-support-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:70) ~[camel-support-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.component.rest.RestApiProducer.process(RestApiProducer.java:39) ~[camel-rest-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168) ~[camel-base-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395) ~[camel-base-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) ~[camel-base-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60) ~[camel-base-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.processor.Pipeline.process(Pipeline.java:147) ~[camel-base-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:286) ~[camel-base-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) ~[camel-base-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:40) ~[camel-support-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.http.common.CamelServlet.doService(CamelServlet.java:214) ~[camel-http-common-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:80) ~[camel-http-common-3.4.3.jar:3.4.3]}}
      {{ at javax.servlet.http.HttpServlet.service(HttpServlet.java:584) ~[jakarta.servlet-api-4.0.4.jar:4.0.4]}}
      {{ at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]}}
      {{ at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]}}
      {{ at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]}}
      {{ at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]}}
      {{ at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]}}
      {{ at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.8.RELEASE.jar:5.2.8.RELEASE]}}
      {{ at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) ~[undertow-servlet-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.server.Connectors.executeRootHandler(Connectors.java:370) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) ~[undertow-core-2.1.3.Final.jar:2.1.3.Final]}}
      {{ at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) ~[jboss-threads-3.1.0.Final.jar:3.1.0.Final]}}
      {{ at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019) ~[jboss-threads-3.1.0.Final.jar:3.1.0.Final]}}
      {{ at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558) ~[jboss-threads-3.1.0.Final.jar:3.1.0.Final]}}
      {{ at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449) ~[jboss-threads-3.1.0.Final.jar:3.1.0.Final]}}
      {{ at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]}}
      Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(Lcom/fasterxml/jackson/databind/type/TypeBindings;)Lcom/fasterxml/jackson/databind/JavaType;
      {{ at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:425) ~[swagger-core-1.5.24.jar:1.5.24]}}
      {{ at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:203) ~[swagger-core-1.5.24.jar:1.5.24]}}
      {{ at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:103) ~[swagger-core-1.5.24.jar:1.5.24]}}
      {{ at io.swagger.converter.ModelConverters.read(ModelConverters.java:76) ~[swagger-core-1.5.24.jar:1.5.24]}}
      {{ at io.swagger.converter.ModelConverters.read(ModelConverters.java:67) ~[swagger-core-1.5.24.jar:1.5.24]}}
      {{ at org.apache.camel.swagger.RestModelConverters.readClass(RestModelConverters.java:33) ~[camel-swagger-java-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.swagger.RestSwaggerReader.appendModels(RestSwaggerReader.java:755) ~[camel-swagger-java-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.swagger.RestSwaggerReader.parse(RestSwaggerReader.java:225) ~[camel-swagger-java-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.swagger.RestSwaggerReader.read(RestSwaggerReader.java:111) ~[camel-swagger-java-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.swagger.RestSwaggerSupport.renderResourceListing(RestSwaggerSupport.java:240) ~[camel-swagger-java-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.swagger.RestSwaggerProcessor.process(RestSwaggerProcessor.java:119) ~[camel-swagger-java-3.4.3.jar:3.4.3]}}
      {{ at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:67) ~[camel-support-3.4.3.jar:3.4.3]}}
      {{ ... 57 common frames omitted}}

       

      My research led me to the following issue threads:

      https://github.com/jersey/jersey/issues/3783 and

      https://github.com/FasterXML/jackson-databind/issues/1865

       

      Is there any way for me to get this example running, maybe by importing another version of the Jackson dependency?

       

      Kind Regards,

      Franz J. Lanzendorfer

        Attachments

          Activity

            People

            • Assignee:
              acosentino Andrea Cosentino
              Reporter:
              franz.lanzendorfer Franz J. Lanzendorfer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: