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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content