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?

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.

Dominique Pfister
added a comment - 07/Sep/06 13:26 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.

Michael Neale
added a comment - 07/Sep/06 13:38 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).

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.

Dominique Pfister
added a comment - 07/Sep/06 14:18 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.

Michael Neale
added a comment - 07/Sep/06 14:49 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.

Tobias Bocanegra
added a comment - 10/Sep/06 11:45 > 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.

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.

Jukka Zitting
added a comment - 20/Sep/07 17:27 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