Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B413918950 for ; Sun, 11 Oct 2015 12:24:05 +0000 (UTC) Received: (qmail 1156 invoked by uid 500); 11 Oct 2015 12:24:05 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 1117 invoked by uid 500); 11 Oct 2015 12:24:05 -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 1106 invoked by uid 99); 11 Oct 2015 12:24:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Oct 2015 12:24:05 +0000 Date: Sun, 11 Oct 2015 12:24:05 +0000 (UTC) From: "Fadi Mohsen (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-5689) NPE at ThreadLocalProviders.getContextResolver() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14952274#comment-14952274 ] Fadi Mohsen commented on CXF-5689: ---------------------------------- [~sergey_beryozkin] I see this NPE exception and cant figure out why it happens, I do not have custom mappers. I run on Java8, CXF 3.1.0 and jackson 2.6.1, below is how I wire up: {code} JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setProviders(Arrays.asList(new Object[] { new JacksonJsonProvider() })); {code} any hints? thanks in advance > NPE at ThreadLocalProviders.getContextResolver() > ------------------------------------------------ > > Key: CXF-5689 > URL: https://issues.apache.org/jira/browse/CXF-5689 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.7.11 > Reporter: Hooman Valibeigi > Assignee: Sergey Beryozkin > Fix For: 3.0.0, 2.7.12 > > > I have extensions of the following classes in my application used as providers when creating jaxrs clients or servers. > javax.ws.rs.ext.ContextResolver > javax.ws.rs.ext.MessageBodyReader > javax.ws.rs.ext.MessageBodyWriter > javax.ws.rs.ext.ExceptionMapper > org.apache.cxf.jaxrs.client.ResponseExceptionMapper > All my custom providers have the following member field injected at runtime. > @Context private Providers providers; > Within the providers' methods I'm calling this: > providers.getContextResolver(aClass, aMediaType); > This is causing a NullPointerException for the ResponseExceptionMapper. All the other providers have no problem getting the context resolver. > java.lang.NullPointerException > at org.apache.cxf.jaxrs.impl.tl.ThreadLocalProviders.getContextResolver(ThreadLocalProviders.java:50) -- This message was sent by Atlassian JIRA (v6.3.4#6332)