persistence@glassfish.java.net

RE: Example use of jar-file element in persistence.xml

From: Mike Keith <michael.keith_at_oracle.com>
Date: Mon, 12 Dec 2005 16:08:13 -0500

Sahoo,

We actually have an action item to clarify these cases so that
they are more clear.

Yes on #1, the dots probably shouldn't be there as they do
lead to confusion.

Yes on number #2 as well. This is to allow specifying JARs
that exist in the /lib dir of the WAR as well as external ones.

-Mike

> -----Original Message-----
> From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM]On Behalf Of
> Sanjeeb Kumar Sahoo
> Sent: Monday, December 12, 2005 11:51 AM
> To: Mike Keith; persistence_at_glassfish.dev.java.net
> Subject: Example use of jar-file element in persistence.xml
>
>
> Hi Mike,
>
> In the spec section #6.2.1.6 I find the following:
>
> *Such JAR files are specified relative to the root of the persistence
> unit (e.g.,
> ../utils/myUtils.jar).
> *
> I am confused by existence of *..* in the example above. I want to
> clarify the use of jar-file using a couple of examples:
>
> 1)
> a.ear
> utils/myUtils.jar
> par.jar#META-INF/persistence.xml (contains utils/myUtils.jar as
> jar-file)
> ejb.jar
>
> In the example above, if some PU defined in *par.jar* includes classes
> from *myUtils.jar*, then persistence.xml will contain
> *utils/myUtils.jar* as jar-file. I say this because if there were a
> Class-Path attribute in par.jar's manifest file, then its value would
> have been utils/myUtils.jar.
>
> 2) Also, I would like to clarify use of jar-file in a PU defined
> inside a war file.
> a.ear
> utils/myUtils.jar
> foo.war#WEB-INF/classes/META-INF/persistence.xml
>
> In the example above, if some PU defined in
> foo.war#WEB-INF/classes/META-INF/persistence.xml includes classes from
> *myUtils.jar*, then persistence.xml will contain
> ../../*utils/myUtils.jar* as jar-file.
>
> Would you mind confirming if the above two usage of jar-file
> is correct
> or not?
>
> Thanks,
> Sahoo
>