I've got a Java application that uses Hibernate for persistence. Now I'm trying to expose part of this app as a web service deployed to Glassfish 3.0.1.
The code that implements the service is in a JAR file that is deployed along with the WAR file into Glassfish. The service code in the WAR has no problem accessing the classes that use Hibernate in the JAR file.
When I try to call the service, however, an exception is thrown saying Hibernate can't find the hibernate.cfg.xml file. For the life of me I can't figure out where the .cfg file should go in either the JAR, the WAR or in Glassfish so that it can be found on the classpath.
I've tried putting it in a META-INF directory in the WAR file (which is actually "meta-inf" when I examine the WAR) and in that same directory in the JAR. I also tried creating a META-INF directory in several different Glassfish directories, all to no avail.
I had to monkey around quite a bit with where to put the .cfg file while developing this service in Eclipse in order to get it into the classpath. It seems this is the issue when deploying it to GF as well.
Can anyone tell me where the .cfg file should go so it can be accessed when this service is deployed in GF?
Thanks,
Chris