Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-1246

Exclude javax.transaction.* from FrameworkFragment



    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.12.0
    • 0.12.0
    • Commons, Contenthub
    • None


      Currently `javax.transaction`and `javax.transaction.xa` are imported from the JDK via the Stanbol framework fragment. This is potentially dangerous as the versions included in the JDK are incomplete. This can be easily checked by comparing the package summary of the packages in the Java6 javadoc [1] and the documentation of JSR 907: Java Transaction API (JTA) available at [2]

      This is for an OSGI environment especially dangerous vor several reasons:

      1. OSGI does not allow to import classes for the same package from different bundles
      2. As `javax.transaction.*` is exported from the system bundle it uses version 0.0.0 and not the correct JSR 907 version 1.1.
      3. javax.transaction is referenced by `javax.sql` that is also exported from the system bundle. So `javax.sql` will always bind to the `javax.transaction` package exported by the system bundle. That means that Bundles that require both the full JTA AND SQL will end up importing two versions from the `javax.transaction.*` (1) version 1.1 from a user provided bundle with the full JSR 907 specification (e.g. [3]) and indirectly 0.0.0 provided by the system bundle (indirectly via the `javax.sql` package. This will cause OSGI to report a Constraint violations because a bundle MUST NOT depend on two versions of the same package (such a setting is best described in [4] page 101ff.

      A check with all modules present in the Stanbol Full Launcher showed that `javax.transaction` is only referenced by the Contenthub component. That means that we will need to add a Bundle for JTA 1.1 in the bundlelist for the Contenthub. I suggest to use the bundle provided by the JBoss community [3]. All other options are not packaged as OSGI bundles and [3] does not come with any additional dependencies.

      [1] http://docs.oracle.com/javase/6/docs/api/javax/transaction/package-summary.html
      [2] http://www.oracle.com/technetwork/java/javaee/jta/index.html
      [3] http://search.maven.org/#artifactdetails|org.jboss.spec.javax.transaction|jboss-transaction-api_1.1_spec|1.0.1.Final|jar
      [4] http://felix.apache.org/site/presentations.data/Learning_to_ignore_OSGi.pdf


        Issue Links



              rwesten Rupert Westenthaler
              rwesten Rupert Westenthaler
              0 Vote for this issue
              1 Start watching this issue