Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2607

Import range for javax.transaction is to small

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.3.0, 2.4.0
    • Fix Version/s: 2.4.1
    • Component/s: osgi
    • Labels:
      None

      Description

      Currently the import for javax.transaction looks like this:
      javax.transaction.*;version="[1.1.0,1.2)";resolution:=optional

      Unfortunately this makes openjpa incompatible with jta 1.2 which should be compatible for a consumer. As the Aries blueprint transaction support now uses jta 1.2 it does not work with openjpa.

      I just change the import range on trunk and tested using the aries itests.
      It seems openjpa works fine with jta 1.2 if the import range is corrected like below:
      javax.transaction.*;version="[1.1.0,2)";resolution:=optional

      I only tested with trunk (2.4.1-SNAPSHOT) but the increased range should work for 2.3.x and 2.2.x too.

      1. OPENJPA-2607-1.patch
        2 kB
        Christian Schneider

        Issue Links

          Activity

          Hide
          struberg Mark Struberg added a comment -

          Christian, it sounds reasonable that OpenJPA will also work with JTA-1.2. So from this pov we could easily update to "[1.1.0,1.3)".
          I would not update to ,2) as I have no idea if the next version of JTA will be 1.3 or 2.0. Would need to talk to my EG mates.

          One other question: what happens with a container which provides both jta spec versions per osgi? Is such a thing possible? Or is it a containers problem to solve this dependency problem (adding the 'right' of the 2 jars to the classloader)?

          Show
          struberg Mark Struberg added a comment - Christian, it sounds reasonable that OpenJPA will also work with JTA-1.2. So from this pov we could easily update to "[1.1.0,1.3)". I would not update to ,2) as I have no idea if the next version of JTA will be 1.3 or 2.0. Would need to talk to my EG mates. One other question: what happens with a container which provides both jta spec versions per osgi? Is such a thing possible? Or is it a containers problem to solve this dependency problem (adding the 'right' of the 2 jars to the classloader)?
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          Hi Mark,
          sorry for the late response. Was on vacation. About the import range. is you set the upper bound to 2.0) it will exclude a 2.0.0 version but include everything 1.x. So as long as the next jta 1.x is compatible it should work.
          If you want to be more converative then [1.1.0,1.3) will at least solve the current problem with jta 1.2.
          Several versions of the spec could be installed at the same time. It would then only work though if the transaction manager implements every of the minor versions which is not the case today.

          The solution is to install the jta spec bundle with dependency=true. This makes sure that karaf will only install the highest version of jta all importing bundles are ok with. So this solves the above problem.

          Show
          chris@die-schneider.net Christian Schneider added a comment - Hi Mark, sorry for the late response. Was on vacation. About the import range. is you set the upper bound to 2.0) it will exclude a 2.0.0 version but include everything 1.x. So as long as the next jta 1.x is compatible it should work. If you want to be more converative then [1.1.0,1.3) will at least solve the current problem with jta 1.2. Several versions of the spec could be installed at the same time. It would then only work though if the transaction manager implements every of the minor versions which is not the case today. The solution is to install the jta spec bundle with dependency=true. This makes sure that karaf will only install the highest version of jta all importing bundles are ok with. So this solves the above problem.
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          We seem to have another issue with the limited import range for jta. The karaf jms feature requires jta 1.2. As soon as it is installed openjpa also breaks. So it would be really important to have the increased import range in the next bugfix versions.

          Show
          chris@die-schneider.net Christian Schneider added a comment - We seem to have another issue with the limited import range for jta. The karaf jms feature requires jta 1.2. As soon as it is installed openjpa also breaks. So it would be really important to have the increased import range in the next bugfix versions.
          Hide
          chris@die-schneider.net Christian Schneider added a comment - - edited

          Mark Struberg any news about this? Would be great if we could include fixed versions of openjpa in karaf 4.0.3.

          Show
          chris@die-schneider.net Christian Schneider added a comment - - edited Mark Struberg any news about this? Would be great if we could include fixed versions of openjpa in karaf 4.0.3.
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          We still have this issue .. First users are already statrting to rebundle openjpa to open up the import range.

          Show
          chris@die-schneider.net Christian Schneider added a comment - We still have this issue .. First users are already statrting to rebundle openjpa to open up the import range.
          Hide
          struberg Mark Struberg added a comment -

          Would apreciate if you can send a fix with the new versions.
          I'm not an OSGi guy but I assume the bits are in trunk/openjpa/pom.xml line 123

          <Import-Package>com.ibm.;resolution:=optional,org.postgresql.;resolution:=optional,org.apache.tools.ant.;resolution:=optional,org.apache.log4j.;resolution:=optional,org.slf4j.;resolution:=optional,org.apache.commons.logging.;resolution:=optional,javax.activation.xa*;resolution:=optional,javax.jms.;version="[1.1.0,1.3)";resolution:=optional,javax.transaction.;version="[1.1.0,2.0)";resolution:=optional,javax.validation.;version="[1.0.0,1.2)";resolution:=optional,javax.xml.bind.;resolution:=optional,serp.;resolution:=optional,javax.persistence.;version="[1.1.0,2.1)",*</Import-Package>

          Just try out the upgraded version and attach the final pom to this ticket as patch plz. I'll apply it asap

          Show
          struberg Mark Struberg added a comment - Would apreciate if you can send a fix with the new versions. I'm not an OSGi guy but I assume the bits are in trunk/openjpa/pom.xml line 123 <Import-Package>com.ibm. ;resolution:=optional,org.postgresql. ;resolution:=optional,org.apache.tools.ant. ;resolution:=optional,org.apache.log4j. ;resolution:=optional,org.slf4j. ;resolution:=optional,org.apache.commons.logging. ;resolution:=optional,javax.activation.xa*;resolution:=optional,javax.jms. ;version="[1.1.0,1.3)";resolution:=optional,javax.transaction. ;version="[1.1.0,2.0)";resolution:=optional,javax.validation. ;version="[1.0.0,1.2)";resolution:=optional,javax.xml.bind. ;resolution:=optional,serp. ;resolution:=optional,javax.persistence. ;version="[1.1.0,2.1)",*</Import-Package> Just try out the upgraded version and attach the final pom to this ticket as patch plz. I'll apply it asap
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          This should work. I also formatted the imports a bit

          Show
          chris@die-schneider.net Christian Schneider added a comment - This should work. I also formatted the imports a bit
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1717505 from Mark Struberg in branch 'openjpa/trunk'
          [ https://svn.apache.org/r1717505 ]

          OPENJPA-2607 increase OSGi import range for javax.transaction

          • allow jta and bval imports from newer - but binary backward compat - spec jars

          Thanks to cschneider for the patch!

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1717505 from Mark Struberg in branch 'openjpa/trunk' [ https://svn.apache.org/r1717505 ] OPENJPA-2607 increase OSGi import range for javax.transaction allow jta and bval imports from newer - but binary backward compat - spec jars Thanks to cschneider for the patch!
          Hide
          struberg Mark Struberg added a comment -

          I've fixed this in trunk. Will be shipped with the next version. Thanks for the patch!

          Show
          struberg Mark Struberg added a comment - I've fixed this in trunk. Will be shipped with the next version. Thanks for the patch!
          Hide
          yogu13 Yogesh Rao added a comment -

          Hi,

          I am intrested in this fix, when would the next version get released ?

          Show
          yogu13 Yogesh Rao added a comment - Hi, I am intrested in this fix, when would the next version get released ?
          Hide
          jira-bot ASF subversion and git services added a comment -
          Show
          jira-bot ASF subversion and git services added a comment - Commit 1727495 from Romain Manni-Bucau [ https://svn.apache.org/r1727495 ] applying OPENJPA-2607

            People

            • Assignee:
              struberg Mark Struberg
              Reporter:
              chris@die-schneider.net Christian Schneider
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development