Return-Path: X-Original-To: apmail-karaf-dev-archive@minotaur.apache.org Delivered-To: apmail-karaf-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0370918C90 for ; Fri, 18 Mar 2016 16:29:47 +0000 (UTC) Received: (qmail 35867 invoked by uid 500); 18 Mar 2016 16:29:46 -0000 Delivered-To: apmail-karaf-dev-archive@karaf.apache.org Received: (qmail 35828 invoked by uid 500); 18 Mar 2016 16:29:46 -0000 Mailing-List: contact dev-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list dev@karaf.apache.org Received: (qmail 35816 invoked by uid 99); 18 Mar 2016 16:29:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Mar 2016 16:29:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 1DCB9C0192 for ; Fri, 18 Mar 2016 16:29:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.28 X-Spam-Level: X-Spam-Status: No, score=0.28 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id cJh8gn0CcYW5 for ; Fri, 18 Mar 2016 16:29:44 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 156445F19A for ; Fri, 18 Mar 2016 16:29:44 +0000 (UTC) Received: from mfilter21-d.gandi.net (mfilter21-d.gandi.net [217.70.178.149]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id D4966172100 for ; Fri, 18 Mar 2016 17:29:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter21-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter21-d.gandi.net (mfilter21-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id SrtIbj3BCciS for ; Fri, 18 Mar 2016 17:29:41 +0100 (CET) X-Originating-IP: 50.205.163.58 Received: from [192.168.13.115] (50-205-163-58-static.hfc.comcastbusiness.net [50.205.163.58]) (Authenticated sender: jb@nanthrax.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id E546B1720C9 for ; Fri, 18 Mar 2016 17:29:40 +0100 (CET) Subject: Re: Problems due to the endorsed java.lang.Exception To: dev@karaf.apache.org References: From: =?UTF-8?Q?Jean-Baptiste_Onofr=c3=a9?= Message-ID: <56EC2CF3.6050708@nanthrax.net> Date: Fri, 18 Mar 2016 17:29:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Cristiano, I think you are right, it's probably something existing for a while. I'm just surprised that you encountered now. Let me check your detailed use case that you sent previously. Regards JB On 03/18/2016 05:14 PM, Cristiano Costantini wrote: > Hello all, > > it is some days I was having troubles using CXF services on ServiceMix (and > it is some days I spam on the mailing list of ServiceMix, Camel and CXF :-D > ) and I've finally come to the source of my issues which are due to the > "endorsed" java.lang.Exception which is used by Karaf: > > https://github.com/apache/karaf/blob/master/exception/src/main/java/java/lang/Exception.java > > My problem is due to the fact that this class has a public property, > public Class[] getClassContext() { > return classContext; > } > which is seen by JaxB at runtime inside Karaf which cause it to marshall > the Exception in SOAP services with a wrong XML, an XML which include > tags. > > The class in Karaf has not changed since committed by Guillaume Nodet in > 2010, so this issue with CXF has probably always been there. > > In my opinion, this getter should be private or protected as I guess it is > only used on the nested class method's getThrowableContext (it is a > replacement for the JRE's class, I don't think there are external project > using this modification of the Exception class). > > > To confirm my thesis, I've hacked the org.apache.karaf.exception-2.4.0.jar > inside the lib/endorsed folder with a class compiled by myself where I've > changed the method to > private Class[] getClassContext() { > return classContext; > } > and with this hack, Karaf has continued to work (and my CXF service now > works properly). > > Do you think there are potential side effects in this fix? > Do you need me to open an issue on Jira to handle the problem? > If it is confirmed that the fix of making this method private, do you think > it could be included soon on the next Karaf Release? > > Thank you very much to all, > Cristiano > -- Jean-Baptiste Onofré jbonofre@apache.org http://blog.nanthrax.net Talend - http://www.talend.com