Hi,

 

I have a regular java project containing code used by many other projects.
Call it project "SharedProject".

 

SharedProject has a class which initializes a Hibernate session in its
constructor.  Call it ParentClass.

 

In order to test that project inside Eclipse, I put a hibernate.cfg.xml file
in its "src" folder.

 

 

 

Now, I have a web service project, WSProject, which "uses" SharedProject.
In Eclipse terminology, SharedProject shows up in the properties for
WSProject, Projects tab.

 

 

WSProject has a java class which extends ParentClass, so that when it's
constructed (when the service is called for the first time), the Hibernate
initialization happens.

 

In WSProject's ant build file, I include SharedProject's classes, so that
they end up in the final .aar file as .class files...

 

 

What I want to do is figure out how to make the web service (WSProject) use
an EXTERNAL hibernate.cfg.xml file once deployed on a tomcat server.  The
reason is that I'll have multiple such web services, and I want them all to
use the same configuration file, instead of having each web service having
its own hibernate config file...

 

 

I tried putting the hibernate.cfg.xml file in the
$TOMCAT_HOME/webapps/axis2/WEB-INF directory, but when I start Tomcat, the
service gets deployed but it can't find the config file...

 

 

I also have the <parameter name="ServiceTCCL">composite</parameter> in the
services.xml...

 

 

Also, as a side question, I would like to be able to use a centralized
generic config file (that has nothing to do with Hibernate), again to be
used by all web services...  Some kind of properties file, for example
config.properties...  Is that possible, and if so, where do I put it ?

 

Thanks. 

 

 

 

Reply via email to