Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 269DC18B62 for ; Thu, 11 Feb 2016 12:02:34 +0000 (UTC) Received: (qmail 78435 invoked by uid 500); 11 Feb 2016 12:02:32 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 78382 invoked by uid 500); 11 Feb 2016 12:02:32 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 78355 invoked by uid 99); 11 Feb 2016 12:02:32 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2016 12:02:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id BA2731A03FA for ; Thu, 11 Feb 2016 12:02:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.797 X-Spam-Level: X-Spam-Status: No, score=0.797 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=unicag.onmicrosoft.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id L4fUQ_6_MuSs for ; Thu, 11 Feb 2016 12:02:27 +0000 (UTC) Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0067.outbound.protection.outlook.com [157.56.112.67]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 75B4920271 for ; Thu, 11 Feb 2016 12:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unicag.onmicrosoft.com; s=selector1-unic-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=j3RA9Dc9prSHRvokIwO4v8bzSFOqIfwL0UpIb9sUDsE=; b=RYV2rLNFM5OFRqfpDGC8ethERV4+xgsvwzk/7oJjDKqB0OwsFI/ptvqYEsOdX8wpe20aMVEKH6LwsASxXgZrYUxGKWwsaa5Lw0GfgjVJmY+6teGS21kBLPTFgbGNUD5TDQGv6mLddwjtPCW5WMPpC6mhIKRK8IVJ7IkJgBQWcNI= Received: from HE1PR05MB1369.eurprd05.prod.outlook.com (10.162.250.23) by HE1PR05MB1372.eurprd05.prod.outlook.com (10.162.250.26) with Microsoft SMTP Server (TLS) id 15.1.409.15; Thu, 11 Feb 2016 12:02:23 +0000 Received: from HE1PR05MB1369.eurprd05.prod.outlook.com ([10.162.250.23]) by HE1PR05MB1369.eurprd05.prod.outlook.com ([10.162.250.23]) with mapi id 15.01.0409.017; Thu, 11 Feb 2016 12:02:23 +0000 From: Olaf Otto To: "users@felix.apache.org" Subject: RE: Classloading issue for XML with Apache CXF in Felix Thread-Topic: Classloading issue for XML with Apache CXF in Felix Thread-Index: AQHRZME79vvA4kBuHUq8Ii8Iy6PMk58muTRw Date: Thu, 11 Feb 2016 12:02:23 +0000 Message-ID: References: <2017_1455186363_56BC61BB_2017_9682_1_OF1B80E9CB.92CEE145-ONC1257F56.003057C1-C1257F56.00394FFA@nbg.sdv.spb.de> In-Reply-To: <2017_1455186363_56BC61BB_2017_9682_1_OF1B80E9CB.92CEE145-ONC1257F56.003057C1-C1257F56.00394FFA@nbg.sdv.spb.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: felix.apache.org; dkim=none (message not signed) header.d=none;felix.apache.org; dmarc=none action=none header.from=unic.com; x-originating-ip: [195.191.133.242] x-microsoft-exchange-diagnostics: 1;HE1PR05MB1372;5:ObNYUyzGzGQRH0FRVYXPjWN5slHvY3zzzk5MgTxEJmEny/JCfXdAhIy/k71RiAxTqBbCIip+qnrKdO1tdoXg4GapFNphZTsOqAyNMDldIdGZtuaOxL96FzG1fZonE0Ip1pPDGX8q+cjXTWjck5274w==;24:m63b+XFwbO6zYkiya1BoaQbpgemc/9qPePb5FzMt0wjLO4+sicux4pg0g9GcHyDuPqZsFPipeZSMlFav7P+WuE4CXCErl+zUKc8apldR0jk= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1372; x-ms-office365-filtering-correlation-id: 8ac555b6-ebdb-400d-62f2-08d332db33e9 x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(22321516928792); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:HE1PR05MB1372;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1372; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(57704003)(13464003)(53754006)(19580405001)(19580395003)(107886002)(54356999)(5001960100002)(110136002)(86362001)(50986999)(76176999)(189998001)(33656002)(15395725005)(11100500001)(66066001)(2351001)(106116001)(5003600100002)(1720100001)(122556002)(74316001)(87936001)(5008740100001)(1220700001)(1096002)(586003)(6116002)(102836003)(3846002)(450100001)(92566002)(76576001)(40100003)(5004730100002)(15975445007)(2501003)(2906002)(77096005)(3280700002)(2900100001)(10400500002)(3660700001)(2950100001)(19627235001);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB1372;H:HE1PR05MB1369.eurprd05.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: unic.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2016 12:02:23.5781 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 042e0683-46ad-4232-b9d6-455de2e2095a X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1372 Hi Marc This looks very familiar. We've had a couple of projects with CXF integrati= on. Basically, the uber-bundle they are providing introduces classloading i= ssues beyond repair. We've got it to work for a customer by modifying the m= anifest of the uber bundle. But eventually, we had to upgrade to a more rec= ent CXF version and had to re-do everything. Bottom line, the total cost of= ownership was too high. I'd suggest the following solutions (in order of preference): 1.) Don't use CXF at runtime. Instead, use the jax-* support shipped with t= he JDK. For this, modify the sling.properties to expose the relevant packag= es via the system class loader, as mentioned here: https://helpx.adobe.com/= experience-manager/using/creating-cq-bundles-consume-web.html / https://hel= px.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html 2.) Wrap your application along with the CXF uber-bundle in an application = Subsystem to isolate it (see OSGi enterprise spec: https://osgi.org/downloa= d/r5/osgi.enterprise-5.0.0.pdf). Good luck! - Olaf -----Original Message----- From: marc.schlegel@sdv-it.de [mailto:marc.schlegel@sdv-it.de] Sent: Donnerstag, 11. Februar 2016 11:26 To: users@felix.apache.org Subject: Classloading issue for XML with Apache CXF in Felix Hello everyone I have set up a test-environment for several frontend-bundles (struts, jsf) which use our internal webservices via Apache CXF. The basic configura= tion is working and simple webservice-calls are running fine. However, when I am accessing some other services CXF is running into classl= oading-errors. I guess that the webservice is returning some error-response= which CXF cannot handle. Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to= create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFactory impleme= ntation found for the object model: http://java.sun.com/jaxp/xpath/dom After some research I found out that a lot of imports in the CXF bundles ar= e actually optional which is why I am running into runtime-classloader-prob= lems. After some more research, I found out that CXF needs Saxon as well as= Xerces and Xalan...and here the real trouble starts. Servicemix is providing the required libraries as a bundle, so I add those = org.apache.servicemix.bundles.saxon (9.7.0.1_1) org.apache.servicemix.bundl= es.xerces (2.11.0.1) org.apache.servicemix.bundles.xalan (2.7.2.2) This also resolves fine in BndTools, so time for another round Failed to start bundle org.apache.servicemix.bundles.xalan-2.7.2.2, exception Unable to resolve org.apache.servicemix.bundles.xalan [53](R 53.0): missing requirement [org.apache.servicemix.bundles.xalan [53](R 53.0= )] osgi.wiring.package; (osgi.wiring.package=3Dorg.w3c.dom.traversal) Unresolved requirements: [[org.apache.servicemix.bundles.xalan [53](R 53.0)= ] osgi.wiring.package; (osgi.wiring.package=3Dorg.w3c.dom.traversal)] A lot of the xml-apis have been moved to the JDK, but not all. So I've adde= d org.apache.servicemix.specs.jaxp-api-1.4 (2.5.0) And now I am doomed :-) At first, it seemed Felix is not booting because nothing happened, but when= I set felix.log.level=3D4 I can see endless repetition of this ---------------------------------------------------- DEBUG: Candidate permutation failed due to a conflict between imports; will= try another if possible. (Uses constraint violation. Unable to resolve res= ource org.ops4j.pax.web.pax-web-jsp [org.ops4j.pax.web.pax-web-jsp [77](R 7= 7.0)] because it is exposed to package 'org.w3c.dom' from resources org.apa= che.felix.framework [org.apache.felix.framework [0](R 0)] and org.apache.servicemix.specs.jaxp-api-1.4 [org.apache.servicemix.specs.jaxp-api-1.4 [56](R 56.0)] via two dependency = chains. Chain 1: org.ops4j.pax.web.pax-web-jsp [org.ops4j.pax.web.pax-web-jsp [77](R 77.0)= ] import: (osgi.wiring.package=3Dorg.w3c.dom) | export: osgi.wiring.package: org.w3c.dom org.apache.felix.framework [org.apache.felix.framework [0](R 0)] Chain 2: org.ops4j.pax.web.pax-web-jsp [org.ops4j.pax.web.pax-web-jsp [77](R 77.0)= ] import: (osgi.wiring.package=3Dorg.w3c.dom.traversal) | export: osgi.wiring.package: org.w3c.dom.traversal; uses:=3Dorg.w3c.dom export: osgi.wiring.package=3Dorg.w3c.dom org.apache.servicemix.specs.jaxp-api-1.4 [org.apache.servicemix.specs.jaxp-api-1.4 [56](R 56.0)]) ---------------------------------------------------- There are other packages as well, but this should be enough to make the poi= nt. Despite that Felix seems not to be able to recover from this, Felix is = right: because the SystemBundle exports the JDK packages [1] which are also= included in org.apache.servicemix.specs.jaxp-api-1.4 it doesnt know what t= o do. The problem is that due to its xml-history [2], the JDK is not providing al= l classes or packages CXF needs to work. Despite the missing org.w3c.dom.tr= aversal package, other packages do not inlcude all classes (for example org= .w3c.dom.ElementTraversal which is also accessed at some point by CXF). Is there any way I can tell Felix which packages it should not export, so I= can use org.apache.servicemix.specs.jaxp-api-1.4? Or what bundles do I nee= d to get full xml-processing within OSGI/Felix for CXF? I have tried setting "org.osgi.framework.system.packages" to the list provi= ded by [1] without the offending packages from jaxp but then the framework = complains about tons of other problems. Any help is really appreciated because I am running out of ideas. regards Marc [1] https://github.com/apache/felix/blob/trunk/framework/src/main/resources/def= ault.properties (in my case section jre-1.8 ) [2] http://stackoverflow.com/questions/11677572/dealing-with-xerces-hell-in-jav= a-maven ___________________________________________ Sparda-Datenverarbeitung eG AD-POR Freiligrathstrasse 32, 90482 N=FCrnberg Tel.: 0911/5486-722 mailto: marc.schlegel@sdv-it.de Sitz der Genossenschaft: N=FCrnberg Amtsgericht N=FCrnberg, GnR 271 Vorstand: Ludwig Oberhammer (Vorsitzender), Burkhard Kintscher Aufsichtsratsvorsitzender: Manfred Stevermann Diese E-Mail enth=E4lt vertrauliche und/oder rechtlich gesch=FCtzte Informa= tionen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt=FC= mlich erhalten haben, informieren Sie bitte sofort den Absender und vernich= ten Sie diese E-Mail. Das unerlaubte Kopieren und die unbefugte Weitergabe = dieser E-Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you = are not the intended recipient or have received this e-mail in error, pleas= e notify the sender immediately and delete this e-mail. Any unauthorized co= pying, disclosure or distribution of the material in this e-mail is strictl= y forbidden. Webinar: Marketing Automation | 16. Februar = 2016 | 11-12 Uhr Wir freuen uns auf Ihre Teilnahme! Internet World 2016 | M=FCnche= n | 01.-02. M=E4rz 2016 Wir freuen uns auf Ihren Besuch | Stand B 104, Halle B6 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org