SwaggerFeature: SetScannerInterceptor causes NPE in Fuse 6.2
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 assumesHTTP.CONTEXT
is available on the camel message context, but the Jetty component doesn't set this, so this line inSetScannerInterceptor
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.