SwaggerFeature: SetScannerInterceptor causes NPE in Fuse 6.2

Solution Verified - Updated -

Issue

  • We run a cxfbean: component as a provider that runs behind a camel jetty consumer. Upgrading to Fuse 6.2.0 create a NullPointerException when calling via the jetty endpoint.

  • The cause is that there is a SwaggerFeature added to the default CXF bus which assumes HTTP.CONTEXT is available on the camel message context, but the Jetty component doesn't set this, so this line in SetScannerInterceptor produces an NPE.


mci.getServletContext().setAttribute("SCANNER", beanConfig); (mci.getServletContext() is null)
  • The workaround is to stop the bundle fabric-cxf that registers the SwaggerFeature, but this is not convenient and doesn't allow us to use this feature.

Environment

  • Red Hat JBoss Fuse
    • 6.2.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.