8 Replies Latest reply on Mar 6, 2011 11:13 PM by Shashidhar Yarabati

    org.hibernate.HibernateException: /hibernate.cfg.xml not fou

    pedro costa Apprentice

      I've a jbpm projects that is structured like:

      jbpm
       |
       - src
       |
       |- config.files
       | |- hibernate.cfg.xml
       | |- hibernate.properties
       | |- jbpm.properties
       |- com
       |- sample
       |-AbstrctDbTestCase
       |-Worflow.java
      


      Whent i try to run Worflow.java, i get the error:

      Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found
       at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1087)
       at org.hibernate.cfg.Configuration.configure(Configuration.java:1111)
       at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
       at org.jbpm.db.JbpmSessionFactory.createConfiguration(JbpmSessionFactory.java:114)
       at org.jbpm.db.JbpmSessionFactory.createConfiguration(JbpmSessionFactory.java:102)
       at com.sample.jbpm.AbstractDbTestCase.getTestConfiguration(AbstractDbTestCase.java:49)
       at com.sample.jbpm.AbstractDbTestCase.getJbpmSessionFactory(AbstractDbTestCase.java:32)
       at com.sample.jbpm.AbstractDbTestCase.beginSessionTransaction(AbstractDbTestCase.java:96)
       at com.sample.jbpm.AbstractDbTestCase.setUp(AbstractDbTestCase.java:84)
       at com.sample.jbpm.WorkFlow.<init>(WorkFlow.java:51)
       at com.sample.jbpm.WorkFlow.main(WorkFlow.java:85)
      


      My jbpm.properties:
      # resource path to a properties file that will overwrite all the hibernate
      jbpm.hibernate.properties = hibernate.properties
      jbpm.hibernate.cfg.xml = hibernate.cfg.xml
      
      # uncomment the next line to use the file system instead of the database for
      # storing files related to a process definition
      # jbpm.files.dir=c:/jbpm.data
      
       jbpm.task.instance.class=org.jbpm.taskmgmt.exe.TaskInstance
      



      Why my project doesn't find the path to hibernate.cfg.xml? What should i do to the project find the xml file?

      Thanks,
      Pedro