Details

      Description

      Geronimo JTA is marked as a dependency for runtime when it should be (at most) a compile time dependency.
      Is it possible to remedy this so when using the war or building your own, you don't get the geronimo jar stowing away?

      1. jta.patch
        7 kB
        Jukka Zitting

        Activity

        Hide
        Jukka Zitting added a comment -

        Patch committed in revision 582264.

        Show
        Jukka Zitting added a comment - Patch committed in revision 582264.
        Hide
        Jukka Zitting added a comment -

        Interesting, we actually had an existing issue for the change that was recently discussed on the mailing list [1].

        The attached patch changes the scope of the geronimo-jta dependency from compile to test within jackrabbit-core. The only required code changes are about copying a few private transaction status constants. In fact, looking at the code flow, the status codes are mostly unused, and could easily be replaced with two boolean flags (prepared & rolledBack). However, in order to keep this patch strictly non-functional, I didn't include such changes.

        I haven't yet looked at how this change affects downstream components like jackrabbit-jca.

        [1] http://www.nabble.com/Using-the-geronimo-jta-dependency-only-in-test-scope-tf4466162.html

        Show
        Jukka Zitting added a comment - Interesting, we actually had an existing issue for the change that was recently discussed on the mailing list [1] . The attached patch changes the scope of the geronimo-jta dependency from compile to test within jackrabbit-core. The only required code changes are about copying a few private transaction status constants. In fact, looking at the code flow, the status codes are mostly unused, and could easily be replaced with two boolean flags (prepared & rolledBack). However, in order to keep this patch strictly non-functional, I didn't include such changes. I haven't yet looked at how this change affects downstream components like jackrabbit-jca. [1] http://www.nabble.com/Using-the-geronimo-jta-dependency-only-in-test-scope-tf4466162.html
        Hide
        Tobias Bocanegra added a comment -

        > OK, in maven 2 you can mark it as "provided" which means it is a compile/test time dep, but at
        > runtime it is expected to be provided by the container
        exactly.

        > - not sure if maven 1 has the equivalent.
        unfortunately not, but the similar functionality is built using the 'war.bundle' property.

        Show
        Tobias Bocanegra added a comment - > OK, in maven 2 you can mark it as "provided" which means it is a compile/test time dep, but at > runtime it is expected to be provided by the container exactly. > - not sure if maven 1 has the equivalent. unfortunately not, but the similar functionality is built using the 'war.bundle' property.
        Hide
        Michael Neale added a comment -

        OK, in maven 2 you can mark it as "provided" which means it is a compile/test time dep, but at runtime it is expected to be provided by the container - not sure if maven 1 has the equivalent.

        Show
        Michael Neale added a comment - OK, in maven 2 you can mark it as "provided" which means it is a compile/test time dep, but at runtime it is expected to be provided by the container - not sure if maven 1 has the equivalent.
        Hide
        Dominique Pfister added a comment -

        You're right: some classes are actually contained in a JDK's/JRE's rt.jar (1.4 or higher). The operations leaving that scope are the tests related to XA functionality: particularly o.a.j.core.UserTransactionImpl working as dummy javax.xa.UserTransaction, an interface that is not contained in the JRE's rt.jar. Therefore, I don't think, removing the dependency to geronimo-spec-jta is an option.

        Show
        Dominique Pfister added a comment - You're right: some classes are actually contained in a JDK's/JRE's rt.jar (1.4 or higher). The operations leaving that scope are the tests related to XA functionality: particularly o.a.j.core.UserTransactionImpl working as dummy javax.xa.UserTransaction, an interface that is not contained in the JRE's rt.jar. Therefore, I don't think, removing the dependency to geronimo-spec-jta is an option.
        Hide
        Michael Neale added a comment -

        yeah that would be it, OK no problems.

        I was able to run it stand alone with no JTA on the classpath just fine, there must only be some operations which would touch it at runtime ?

        I assume the standard JTA would do just fine (and like you said, can be removed when in an appropriate container anyway).

        Show
        Michael Neale added a comment - yeah that would be it, OK no problems. I was able to run it stand alone with no JTA on the classpath just fine, there must only be some operations which would touch it at runtime ? I assume the standard JTA would do just fine (and like you said, can be removed when in an appropriate container anyway).
        Hide
        Dominique Pfister added a comment -

        You probably allude to the following lines in jackrabbit/trunk/jcr-server/webapp/project.xml:

        <dependency>
        <groupId>geronimo-spec</groupId>
        <artifactId>geronimo-spec-jta</artifactId>
        <version>1.0-M1</version>
        <properties>
        <war.bundle>true</war.bundle>
        </properties>
        </dependency>

        Actually, Jackrabbit's session implementation o.a.j.core.XASessionImpl references XAResource from the javax.transaction.xa package. Being of course a mandatory part of an application server, this jar has been included in the web application when used in servlet container environments, where it is optional. If you still need the "geronimo-free" web application, changing the value of the property "war.bundle" to "false" in your local copy should do the trick.

        Show
        Dominique Pfister added a comment - You probably allude to the following lines in jackrabbit/trunk/jcr-server/webapp/project.xml: <dependency> <groupId>geronimo-spec</groupId> <artifactId>geronimo-spec-jta</artifactId> <version>1.0-M1</version> <properties> <war.bundle>true</war.bundle> </properties> </dependency> Actually, Jackrabbit's session implementation o.a.j.core.XASessionImpl references XAResource from the javax.transaction.xa package. Being of course a mandatory part of an application server, this jar has been included in the web application when used in servlet container environments, where it is optional. If you still need the "geronimo-free" web application, changing the value of the property "war.bundle" to "false" in your local copy should do the trick.

          People

          • Assignee:
            Jukka Zitting
            Reporter:
            Michael Neale
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development