[ 
https://issues.apache.org/jira/browse/STANBOL-1254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rupert Westenthaler reopened STANBOL-1254:
------------------------------------------


Reopening again, because javax.transaction.xa MUST NOT be included in the 
framework fragment.

The reason for that is that the JDK version of this package does only provide 
some of the classes (see [1]) that are defined by JSR 907: Java Transaction API 
(JTA).

As both do use the same package 'javax.transaction.xa' but with different 
contents the OSGI environment will refuse to load bundles that require full JTA 
if this package is already exported by the System Bundle.

Here an example of an execution caused by this: Here Infinispan requires full 
JTA and 'javax.sql' having already loaded the 'javax.transaction.xa' from the 
System bundle.

ERROR: Bundle {root-bundle} [98]: Error starting 
slinginstall:{root-bundle}-{version}.jar (org.osgi.framework.BundleException: 
Constraint violation for package 'javax.transaction.xa' when resolving module 
98.0 between existing import 168.0.javax.transaction.xa BLAMED ON [[98.0] 
package; (&(package=javax.transaction.xa)(version>=1.1.0)(!(version>=2.0.0)))] 
and uses constraint 0.javax.transaction.xa BLAMED ON [[98.0] package; 
(&(package=org.infinispan.configuration.global)(version>=6.0.1)(!(version>=7.0.0))),
 [32.0] package; 
(&(package=org.jgroups.protocols.relay)(version>=3.4.0)(!(version>=4.0.0))), 
[37.0] package; (package=javax.sql)])
org.osgi.framework.BundleException: Constraint violation for package 
'javax.transaction.xa' when resolving module 98.0 between existing import 
168.0.javax.transaction.xa BLAMED ON [[98.0] package; 
(&(package=javax.transaction.xa)(version>=1.1.0)(!(version>=2.0.0)))] and uses 
constraint 0.javax.transaction.xa BLAMED ON [[98.0] package; 
(&(package=org.infinispan.configuration.global)(version>=6.0.1)(!(version>=7.0.0))),
 [32.0] package; 
(&(package=org.jgroups.protocols.relay)(version>=3.4.0)(!(version>=4.0.0))), 
[37.0] package; (package=javax.sql)]
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3449)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1727)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1156)
        at 
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:744)

The problem is that as soon as 'javax.transaction.xa' is exported by the 
SystemBundle this can not be solved! However if the package is not included in 
the framework fragment one can add an mother bundle that exports JTA. One 
possibility is to use the bundles provided by JBoss [2]

Here the bundle definition for version 1.1 of the spec.

    <bundle>
        <groupId>org.jboss.spec.javax.transaction</groupId>
        <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        <version>1.0.1.Final</version>
    </bundle>

So to sum up: IMHO we MUST NOT add 'javax.transaction.xa' exported by the 
framework fragment. Users that do need the package need to include a bundle 
exporting this package that is also part of JTA.

WDYT
Rupert

[1] 
http://docs.oracle.com/javase/6/docs/api/javax/transaction/xa/package-summary.html
[2] 
http://search.maven.org/#search|ga|1|g%3A%22org.jboss.spec.javax.transaction%22

> Add javax.transaction.xa to fragment bundle
> -------------------------------------------
>
>                 Key: STANBOL-1254
>                 URL: https://issues.apache.org/jira/browse/STANBOL-1254
>             Project: Stanbol
>          Issue Type: Improvement
>    Affects Versions: 0.12.0
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Rupert Westenthaler
>             Fix For: 0.12.0
>
>
> This makes the virtuoso clerezza storage provider usable with stanbol



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to