0 Replies Latest reply on Nov 13, 2014 12:41 AM by shirshananda

    fuse not able to map my hbm.xml file

    shirshananda

      Hi,

      i am trying to create a camel project which uses hibernate 4 for DAO queries.

      I have kept the hibernate.cfg.xml file in etc folder where i have given the mapping for my *.hbm.xml files

       

       

      1. <?xml version='1.0' encoding='utf-8'?> 
      2.  
      3.  
      4. <!DOCTYPE hibernate-configuration PUBLIC 
      5.   "-//Hibernate/Hibernate Configuration DTD 3.0//EN" 
      6.   "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> 
      7. <hibernate-configuration> 
      8.  
      9.  
      10.   <session-factory> 
      11.   <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property> 
      12.   <property name="connection.driver_class">oracle.jdbc.OracleDriver</property> 
      13.   <property name="connection.url">jdbc:oracle:thin:@localhost:1521:TPFDB</property> 
      14.   <property name="connection.username">USER_HB</property> 
      15.   <property name="connection.password">USER_HB</property> 
      16.   <property name="hibernate.connection.autocommit">true</property> 
      17.  
      18.  
      19.   <property name="hibernate.show_sql">true</property> 
      20.   <property name="hibernate.format_sql">true</property>  
      21.   <property name="hibernate.generate_statistics">true</property> 
      22.   <property name="hibernate.jdbc.batch_size">100</property> 
      23.   <property name="hibernate.connection.characterEncoding">utf8</property> 
      24.   <property name="hbm2ddl.auto">update</property> 
      25.   <property name="current_session_context_class">thread</property> 
      26.  
      27.   <mapping   jar = "C:/Users/Softwares/jboss-fuse-6.1.0.redhat-379/deploy/entities-0.0.1.jar" resource="Movies.hbm.xml" /> 
      28.   <mapping   jar = "C:/Users/Softwares/jboss-fuse-6.1.0.redhat-379/deploy/entities-0.0.1.jar" resource="Series.hbm.xml" /> 
      29.  
      30.  
      31.   </session-factory> 
      32.  
      33.  
      34. </hibernate-configuration> 

      and the error i am getting is

       

       

      1. Caused by: org.hibernate.MappingNotFoundException: resource: C:/jboss-fuse-6.1.0.redhat-379/deploy/entities-0.0.1.jar/Movies.hbm.xml not found 
      2.         at org.hibernate.cfg.Configuration.addResource(Configuration.java:767)[69:org.hibernate.core:4.3.6.Final] 
      3.         at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2255)[69:org.hibernate.core:4.3.6.Final] 
      4.         at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2227)[69:org.hibernate.core:4.3.6.Final] 
      5.         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2207)[69:org.hibernate.core:4.3.6.Final] 
      6.         at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2160)[69:org.hibernate.core:4.3.6.Final] 
      7.         at org.hibernate.cfg.Configuration.configure(Configuration.java:2133)[69:org.hibernate.core:4.3.6.Final] 
      8.         at com.my.utilities.SessionFactoryUtil.initSessionFactory(SessionFactoryUtil.java:44)[265:utility:0.0.1] 

      any one can tell me why it is not able to map to my hbm.xml file?