Return-Path: X-Original-To: apmail-stanbol-dev-archive@www.apache.org Delivered-To: apmail-stanbol-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8361DDFD9 for ; Thu, 8 Nov 2012 09:46:11 +0000 (UTC) Received: (qmail 28935 invoked by uid 500); 8 Nov 2012 09:46:11 -0000 Delivered-To: apmail-stanbol-dev-archive@stanbol.apache.org Received: (qmail 28727 invoked by uid 500); 8 Nov 2012 09:46:11 -0000 Mailing-List: contact dev-help@stanbol.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stanbol.apache.org Delivered-To: mailing list dev@stanbol.apache.org Received: (qmail 28687 invoked by uid 99); 8 Nov 2012 09:46:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 09:46:09 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rupert.westenthaler@gmail.com designates 209.85.223.170 as permitted sender) Received: from [209.85.223.170] (HELO mail-ie0-f170.google.com) (209.85.223.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 09:46:03 +0000 Received: by mail-ie0-f170.google.com with SMTP id c12so8073328ieb.1 for ; Thu, 08 Nov 2012 01:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=UKwmu7LVGd2UDM0U1BYTTsGLhYDW+ZY8N+CmtbT7p4A=; b=mdionGJ1M6fnqHQNPY8ckZNwD03+vG6sNOtSdQZ5iu6kzo4lZJzEhBl1JdWAWxuv/V ztFj5aiVfSVUL5TfSk4wIHEOao5yyuI8EFNOBEa9E82iKH7pJwjPEQ1Gyko3ph+age32 pBDFK9tYL/6QPbeuKIafaf1LLgoHrNt19rUjDk793UIMWzSF1IDpHowhxbemJD3Fdbus ZnqiI60gAEWlMushYhSQ9zATYOvwZ3CXAdYWc3CC3Pb4/7VrQLzXMXS7HyE6rQVdD3kl BO/RF/OYwFBLIwUZS3SoJNsSm/e6a5qNwmOUVDua5UHt4kMFzD1eoGiAnvnLBS8OqHHj mx3w== MIME-Version: 1.0 Received: by 10.50.41.165 with SMTP id g5mr7878183igl.66.1352367942591; Thu, 08 Nov 2012 01:45:42 -0800 (PST) Received: by 10.50.8.102 with HTTP; Thu, 8 Nov 2012 01:45:42 -0800 (PST) In-Reply-To: <509A5C8F.8040502@srdc.com.tr> References: <509A5C8F.8040502@srdc.com.tr> Date: Thu, 8 Nov 2012 10:45:42 +0100 Message-ID: Subject: Re: java.lang.LinkageError for javax.xml.stream.XMLStreamReader From: Rupert Westenthaler To: dev@stanbol.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Suat, My experience is regarding the Java XML stuff it that there are two possibilities that do work (1) to embed everything in your bundle and exclude those packages from the imported (2) to import everything and embed nothing You should avoid * exporting XML stuff * use XML stuff in your interfaces (as this would require to export things) With the change from Solr 3.2 to 3.6.1 I decided to switch from (2) to (1) and because of that there are now bundles (from the ServiceMix project) that provide some of the XML libraries. The XML api, Xerxes and Xalan is anyway provided by the JDK. Because of that option (1) should be now fine for most of cases. The error you encounter seams to be related to two different instances of "javax/xml/stream/XMLStreamReader" Class loaded from different Classloaders. AFAIK this class is part of the Java XML apis so one guess is that your Bundle Classpath does include its own version for the Java XML apis. If this is the case you should get rid of the embedded dependency. An other possibility is that the bootloader instance is initialised by using the ContextClassloader and those is a different one as the BundleClassloader. If this is the case you need to replace the context classloader with the bundle classloader (you can find examples in the o.a.stanbol.commons.solr.core module as it needs to do the same when instantiating Solr components). > As far as I see both "Apache ServiceMix :: Specs :: Stax API 1.0" bundle > and our "frameworkfragment" injects the javax.xml.stream package into > the OSGi environment. Even that this is not the cause for your problem this is indeed an issue. AFAIK bundles that export packages should also import them, because then it does not interfere with packages exported by the system bundle (as it is the case because of the Stanbol frameworkfragment). best Rupert --=20 | Rupert Westenthaler rupert.westenthaler@gmail.com | Bodenlehenstra=C3=9Fe 11 ++43-699-11108907 | A-5500 Bischofshofen