2

folks,

i am trying to deploy a ear with a ejb in the ear root. the ejb has a persistence.xml file where the tag has to be a jar file in the Glassfish's domain lib. (this i have put it there because the jar is used across ears)

so what exactly should be the content of the <jar-file>*****/myjar.jar</jar-file> tag, for the jar in the glassfish's domain lib directory.

thanks fr yure time,

rajan.

Rajan
  • 626
  • 3
  • 8
  • 18

1 Answers1

2

The path should be either an absolute path to a JAR (not recommended) or the simple file name for a JAR inside the EAR deployment file. So, assuming you have an EAR with the jars "ejbs.jar", "jpa.jar" and "myjar.jar", the <jar-file> tag in jpa.jar for myjar.jar should be:

<jar-file>myjar.jar</jar-file> 
jpkroehling
  • 13,881
  • 1
  • 37
  • 39
  • thanks fr yure reply, yes thats the problem exactly... my jar is outside the ear deployment... i have put in it in the glassfish domains lib directory... – Rajan Dec 21 '10 at 14:55
  • Not sure it's correct nor supported to leave your jars there. I mean, your dependencies are supposed to be in the EAR, as the EAR should be a "deployable" artifact for your application, no matter which Application Server you are using. So, I would stick with the standards and benefit from its features, like using an "external" jar file via in the JPA jar :-) – jpkroehling Dec 21 '10 at 15:14