I am running a web application that uses Hibernate for data persistence.
Now I have created another webproject and included necessary jar files etc. While fetching data I got an exception.
Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.sit.util.HibernateUtil.<clinit>(Unknown Source)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at com.core.dao.OpenIncidentDao.getAllOpenIncidents(Unknown Source)
at Test.main(Test.java:17)
Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1405)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1427)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
... 5 more
My other web project is running fine. Also hibernate.cfg.xml is in its place. hibernate.cfg.xml is under EarContent/hibernate.cfg.xml. Both the web projects and hibernate project are added in EAR.