cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colm O hEigeartaigh (JIRA)" <>
Subject [jira] [Closed] (CXF-6966) Using CXF in JDK endorsed dir as JAX-WS impl crashes
Date Fri, 14 Oct 2016 14:10:21 GMT


Colm O hEigeartaigh closed CXF-6966.

> Using CXF in JDK endorsed dir as JAX-WS impl crashes
> ----------------------------------------------------
>                 Key: CXF-6966
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Core, JAX-WS Runtime
>    Affects Versions: 3.1.6
>         Environment: Oracle JDK 1.8 (Update 91), not tested with other environments.
>            Reporter: Max Bureck
>            Assignee: Daniel Kulp
>            Priority: Critical
>             Fix For: 3.0.10, 3.1.7
> Placing the basic CXF libraries into a directory and calling a java program with -Djava.endorsed.dirs=<selected_dir>
using Oracle JDK 1.8 causes the program to crash when starting a WebService using the Endpoint
> Here is the relevant stack trace:
> Caused by: java.lang.NullPointerException
> at java.util.ResourceBundle.getBundle(Unknown Source)
>         at org.apache.cxf.common.i18n.BundleUtils.getBundle(
>         at org.apache.cxf.common.logging.LogUtils.createLogger(
>         at org.apache.cxf.common.logging.LogUtils.getL7dLogger(
>         at org.apache.cxf.jaxws.spi.ProviderImpl.<clinit>(
>  ... 20 more
> The root cause seems to be that class "org.apache.cxf.jaxws.spi.ProviderImpl" has the
following static field:
> {code:java}
> protected static final Logger LOG = 
> LogUtils.getL7dLogger(ProviderImpl.class);
> {code}
> Unfortunately the {{ProviderImpl.class}} does not reference a ClassLoader when using
Oracles JDK. Down the stack the method {{java.util.ResourceBundle.getBundle(String, Locale,
ClassLoader)}} is called with {{null}} as ClassLoader, and the implementation of Oracles JDK
throws a {{NullPointerException}}.
> This can most likely be avoided by slightly modifying  {{org.apache.cxf.common.i18n.BundleUtils.getBundle(Class<?>)}}
to not only catch {{MissingResourceException}}, but {{RuntimeException}} in general or check
if the ClassLoader is {{null}} beforehand and not pay the cost of an exception being thrown.

This message was sent by Atlassian JIRA

View raw message