Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2946A200BB2 for ; Fri, 14 Oct 2016 16:10:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 283BD160ADD; Fri, 14 Oct 2016 14:10:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 78A0D160AF7 for ; Fri, 14 Oct 2016 16:10:23 +0200 (CEST) Received: (qmail 60560 invoked by uid 500); 14 Oct 2016 14:10:21 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 59961 invoked by uid 99); 14 Oct 2016 14:10:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2016 14:10:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2CD422C4C75 for ; Fri, 14 Oct 2016 14:10:21 +0000 (UTC) Date: Fri, 14 Oct 2016 14:10:21 +0000 (UTC) From: "Colm O hEigeartaigh (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (CXF-6966) Using CXF in JDK endorsed dir as JAX-WS impl crashes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 14 Oct 2016 14:10:24 -0000 [ https://issues.apache.org/jira/browse/CXF-6966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colm O hEigeartaigh closed CXF-6966. ------------------------------------ > Using CXF in JDK endorsed dir as JAX-WS impl crashes > ---------------------------------------------------- > > Key: CXF-6966 > URL: https://issues.apache.org/jira/browse/CXF-6966 > 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= using Oracle JDK 1.8 causes the program to crash when starting a WebService using the Endpoint API. > 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(BundleUtils.java:80) > at org.apache.cxf.common.logging.LogUtils.createLogger(LogUtils.java:246) > at org.apache.cxf.common.logging.LogUtils.getL7dLogger(LogUtils.java:198) > at org.apache.cxf.jaxws.spi.ProviderImpl.(ProviderImpl.java:76) > ... 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 (v6.3.4#6332)