3 Replies Latest reply on May 12, 2004 2:00 PM by cuddles

    Hibernate mapping files not found

    cuddles

      Hi,

      I am using JBoss3.2.3, Hibernate 2.1.2 and MySQL 4.0.17. I am in the process of moving my application that uses Hibernate in a non-J2EE environment into the JBoss environment. My application uses hibernate.cfg.xml to find its *.hbm.xml mapping files. It is failing when the net.sf.cfg.Configuration instance can't find the mapping files declared in hibernate.cfg.xml. My hibernate.cfg.xml is in my deploy directory along with my mapping files. I have set my classpath to the deploy directory and get the same error. I have tried using absolute paths as well.

      Where should I put my mapping files so that the Hibernate Configuration object can find them? I should mention that I set the classpath and start the JBoss server using an ant task.

      PS Long term I will use the Hibernate MBean and CMP, but for a short term deadline getting that configured, setup and implemented has taken too long and been fraught with gotchas to serve my short term needs.

      Thanks!

        • 1. Re: Hibernate mapping files not found

          Try using SAR to deploy your configuration.
          Take a look at http://www.hibernate.org/66.html, if you follow this document all will work great and easy!
          Gio

          • 2. Re: Hibernate mapping files not found
            cuddles

            Thanks for the pointer. I used that doc to try and convert my app to use the Hibernate MBean. I am having various problems getting my MessageDrivenBean to start after following those steps. I won't have time to slog through those issues till next week.

            Are you suggesting that I use the sar file solely so my mapping files can be found, or to do the full conversion to use the Hibernate MBean? Per my previous message I am not ready to convert to use the HMB. Any ideas about why my .hbm.xml files are not found in the classpath by Hibernate?

            • 3. Re: Hibernate mapping files not found
              cuddles

              formenti,

              i undid my MBean implementation and left only the mapping files in my sar. it worked like a charm. i guess that is what you meant in your reply. thanks!

              cuddles