Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F3788200BC8 for ; Wed, 23 Nov 2016 10:32:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id F2183160AFD; Wed, 23 Nov 2016 09:32:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 47944160AFA for ; Wed, 23 Nov 2016 10:32:52 +0100 (CET) Received: (qmail 15420 invoked by uid 500); 23 Nov 2016 09:32:51 -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 15409 invoked by uid 99); 23 Nov 2016 09:32:51 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2016 09:32:51 +0000 Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 217BF1A012B for ; Wed, 23 Nov 2016 09:32:51 +0000 (UTC) Received: by mail-oi0-f49.google.com with SMTP id b126so8118990oia.2 for ; Wed, 23 Nov 2016 01:32:50 -0800 (PST) X-Gm-Message-State: AKaTC026pNgv3rGBvDIkQiN6uXtUCfAnuQ8FERcehkr9YMDU3nvXG8h55g1R1URO6NKWU9CAUjQ6Wd1nnZvP6A== X-Received: by 10.157.63.100 with SMTP id m91mr1249490otc.245.1479893570165; Wed, 23 Nov 2016 01:32:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.49.3 with HTTP; Wed, 23 Nov 2016 01:32:29 -0800 (PST) In-Reply-To: <7502028c-61d2-f635-a153-bf795303072d@die-schneider.net> References: <7502028c-61d2-f635-a153-bf795303072d@die-schneider.net> From: Guillaume Nodet Date: Wed, 23 Nov 2016 10:32:29 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: java.transaction.xa not exported? To: dev Content-Type: multipart/alternative; boundary=001a1147097c8e33940541f4921b archived-at: Wed, 23 Nov 2016 09:32:53 -0000 --001a1147097c8e33940541f4921b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yeah, I suppose it will work as a long as you don't have any bundle requiring a versioned javax.transaction.xa package. 2016-11-23 10:27 GMT+01:00 Christian Schneider : > I recently had a similar problem when trying transactions on bndtools. > > The bndtools guys proposed a different solution by adding the jta 1.1 spe= c > to the runpath. > > See > https://github.com/cschneider/bndtools-tutorials/blob/master > /tasklist-ds/tasklist.bndrun#L14 > > The nice thing with the above solution is that you do not have to exclude > the javax.transaction.xa package from the system bundle exports. > In karaf this is less of an issue as karaf completely redefines the syste= m > package exports anyway. > > Interestingly I was able to get jpa as well as CXF running on bndtools > without redefining the system package exports. So without overriding the > spec apis and impls from java. > > So I wonder what are the advantages / disadvantages of the two approaches= . > > Christian > > > > On 22.11.2016 20:29, Guillaume Nodet wrote: > >> Yes, the long answer is the following: >> * the javax.transaction.xa package provided by the JRE is incomplete >> * it contains a few classes used by the jdbc package >> * if the system bundle exports this package, users will hit >> NoClassDefFoundError because of the missing class >> * if the classes from the JRE are not used, there will be >> ClassCastException when using JDBC because the jdbc package uses the >> classes from the JRE while the driver deployed as an OSGi bundle will us= e >> the classes deployed as a bundle >> The only solution is the one used in karaf since years: >> - the system bundle exports javax.transaction; javax.transaction.xa; >> partial=3Dtrue; mandatory:=3Dpartial >> This means that the package is exported but not really usable >> - the system bundle boot delegate javax.transaction and >> javax.transaction.xa >> - users should deploy a bundle such as >> mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 to provide the >> full packages >> >> >> 2016-11-22 19:49 GMT+01:00 Achim Nierbeck : >> >> There is a Pax-JDBC Postgres feature, which also includes the Aries TX >>> because of that. [1] >>> >>> regards, Achim >>> >>> [1] - >>> https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/ >>> pax-jdbc-features/src/main/resources/features.xml#L83-L90 >>> >>> 2016-11-22 19:45 GMT+01:00 Guillaume Nodet : >>> >>> The package provided by the JRE is incomplete so you need to deploy the >>>> >>> XA >>> >>>> api separately. >>>> >>>> 2016-11-22 19:42 GMT+01:00 Fabian Lange : >>>> >>>> Hi, >>>>> i just tried to use the new postgres driver for java 8: >>>>> >>>>> Error executing command: Error executing command on bundles: >>>>> Error starting bundle 101: Unable to resolve org.postgresql.jdbc42 >>>>> >>>> [101](R >>>> >>>>> 101.0): missing requirement [org.postgresql.jdbc42 [101](R 101.0)] >>>>> osgi.wiring.package; (osgi.wiring.package=3Djavax.transaction.xa) >>>>> >>>> Unresolved >>>> >>>>> requirements: [[org.postgresql.jdbc42 [101](R 101.0)] >>>>> >>>> osgi.wiring.package; >>>> >>>>> (osgi.wiring.package=3Djavax.transaction.xa)] >>>>> >>>>> I see the .xa package is not exported in bootdelegation. I searched f= or >>>>> this and could not find any reason it is not. is it just missing or i= s >>>>> there a deeper reason? >>>>> Fabian >>>>> >>>>> -- >>>>> Fabian Lange | Performance Expert >>>>> mobil: +49 (0) 160.3673393 >>>>> >>>>> codecentric AG | Merscheider Stra=C3=9Fe 1 | 42699 Solingen | Deutsch= land >>>>> >>>>> Sitz der Gesellschaft: Solingen | HRB 25917| Amtsgericht Wuppertal >>>>> Vorstand: Michael Hochg=C3=BCrtel . Mirko Novakovic . Rainer Vehns >>>>> Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus J=C3=A4ger . J= =C3=BCrgen >>>>> >>>> Sch=C3=BCtz >>>> >>>> >>>> -- >>>> ------------------------ >>>> Guillaume Nodet >>>> ------------------------ >>>> Red Hat, Open Source Integration >>>> >>>> Email: gnodet@redhat.com >>>> Web: http://fusesource.com >>>> Blog: http://gnodet.blogspot.com/ >>>> >>>> >>> >>> -- >>> >>> Apache Member >>> Apache Karaf Committer & PMC >>> OPS4J Pax Web Committer >>> & >>> Project Lead >>> blog >>> Co-Author of Apache Karaf Cookbook >>> >>> Software Architect / Project Manager / Scrum Master >>> >>> >> >> > > -- > Christian Schneider > http://www.liquid-reality.de > > Open Source Architect > http://www.talend.com > > --=20 ------------------------ Guillaume Nodet ------------------------ Red Hat, Open Source Integration Email: gnodet@redhat.com Web: http://fusesource.com Blog: http://gnodet.blogspot.com/ --001a1147097c8e33940541f4921b--