karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Nodet <gno...@apache.org>
Subject Re: java.transaction.xa not exported?
Date Tue, 22 Nov 2016 19:29:34 GMT
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 use
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=true; mandatory:=partial
     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 <bcanhome@googlemail.com>:

> 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 <gnodet@apache.org>:
>
> > 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 <fabian.lange@codecentric.de>:
> >
> > > 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=javax.transaction.xa)
> > Unresolved
> > > requirements: [[org.postgresql.jdbc42 [101](R 101.0)]
> > osgi.wiring.package;
> > > (osgi.wiring.package=javax.transaction.xa)]
> > >
> > > I see the .xa package is not exported in bootdelegation. I searched for
> > > this and could not find any reason it is not. is it just missing or is
> > > there a deeper reason?
> > > Fabian
> > >
> > > --
> > > Fabian Lange | Performance Expert
> > > mobil: +49 (0) 160.3673393
> > >
> > > codecentric AG | Merscheider Straße 1 | 42699 Solingen | Deutschland
> > >
> > > Sitz der Gesellschaft: Solingen | HRB 25917| Amtsgericht Wuppertal
> > > Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns
> > > Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen
> > Schütz
> > >
> >
> >
> >
> > --
> > ------------------------
> > Guillaume Nodet
> > ------------------------
> > Red Hat, Open Source Integration
> >
> > Email: gnodet@redhat.com
> > Web: http://fusesource.com
> > Blog: http://gnodet.blogspot.com/
> >
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>



-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message