Hi all,
my hibernate.cfg.xml is configured to load the Database from a database pool with JNDI reference and the container is Tomcat 6.0.
every thing is working fine. But the problem is with Testing (Struts which user hibernate for DB interactions).
i implemented MockStrutsTestCase to test my Struts which needs no container. In the development environment, i changed the hibernate.cfg.xml from JNDI connection to hard coded values for DB connection and works fine.
my requirement is, i need to write the ant script, to test these test cases and if works fine, i need to make a war file and deploy in container.
now, the hibernate.cfg.xml is configured to JNDI connection, which in turns, getting fail in MockStrutsTestCase (as, it cant maintain the DB POOL).
i maintain a copy of hibernate.cfg.xml in other directory with hard coded values and put this directory in classpath first and then classes directory in classpath later.
but Hibernate API is not loading the hibernate.cfg.xml in classpath order and loading from classes directory directly.
how to resolve this issue.
Thanks in advance.
Regards
Pavan