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 F395718FC3 for ; Tue, 30 Jun 2015 17:58:06 +0000 (UTC) Received: (qmail 52358 invoked by uid 500); 30 Jun 2015 17:58:06 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 52300 invoked by uid 500); 30 Jun 2015 17:58:06 -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 52286 invoked by uid 99); 30 Jun 2015 17:58:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jun 2015 17:58:06 +0000 Date: Tue, 30 Jun 2015 17:58:06 +0000 (UTC) From: "Ravi Luthra (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CXF-6480) InjectionUtils createThreadLocalServletApiContext better error message for invalid @Context classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Ravi Luthra created CXF-6480: -------------------------------- Summary: InjectionUtils createThreadLocalServletApiContext better error message for invalid @Context classes Key: CXF-6480 URL: https://issues.apache.org/jira/browse/CXF-6480 Project: CXF Issue Type: Bug Environment: All OS Reporter: Ravi Luthra When you have an \@Context field in a JAXRS class (maybe JAXWS too?) there is a select list of possible proxy classes. This method checks for the proxy class using an if/else/if/else... structure, but there is no final else clause with a good exception. Instead the method attempts to instantiate a null class name (proxyClassName), which throws a NullPointerException. This leaves the method wrapped inside a RuntimeException. A common forgetful change someone might make is to add {code}@Context private HttpSession session; //(instead of private HttpServletRequest){code} Which leaves a massive stack trace leaving just an NPE and Spring also tends to obscure the stack-trace of this issue. A better error would be to suggest that the given class ...HttpSession is not a valid Context type. No proxy classes can be created for this type. -- This message was sent by Atlassian JIRA (v6.3.4#6332)