I haven't seen any issues in running CXF in Tomcat 8, we've had it added to the actual war, looks like you put CXF into the common lib folder ? If yes, how did you patch it for the given resource be loaded if it is 'null', did you delegate to the system loader ?

Thanks, Sergey
On 20/02/17 14:46, Andres Almiray wrote:
Hello everyone,

I'm trying to run a simple webservice on Tomcat 8.5.11 with CXF 3.1.10 and have 
encountered two separate NPEs when CXF attempts to resolve a BusFactory.

The first one appears at 
https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/BusFactory.java#L397
 apparently cls.getClassLoader() returns null.

The second one is at 
https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java#L154
 where getClass().getClassLoader() also returns null.

More details at 
http://stackoverflow.com/questions/42341942/tomcat8-org-apache-cxf-busfactory-getbusfactoryclass-failed-to-determine-busfact

I've build a local version of cxf-core with these two spots patched to handle 
the NPE and forward the loading to a non-null ClassLoader, such as the 
ContextClassLoader.

My question is, am I missing setup on the Tomcat side so that the intended 
ClassLoader is not null?

Should CXF have additional checks for potential nulls in these two (possibly 
other) cases?

TIA
Andres


Reply via email to