0 Replies Latest reply on Dec 2, 2004 3:53 AM by jerger

    JBoss4.0.0 & Hibernate: Unknown entity class

    jerger

      Hi,

      finally I managed to deploy my hibernate application in the new jboss4.0.0. and the related stuff without deployment errors. But there is one remaining problem:

      If I try, to acess persistence like:

      tx = hibernateSession.beginTransaction();
      Item item = new Item();
      item.setValue(33d);
      hibernateSession.save(item);


      I get the following confusing error:

      09:29:50,312 INFO [STDOUT] net.sf.hibernate.MappingException: Unknown entity class: test.hibernate.model.Item


      I packed the .har file as described in http://docs.jboss.org/jbossas/getting_started/startguide40/hibernate.html#d0e2741

      META-INF/hibernate-service.xml
      META-INF/MANIFEST.MF
      test/hibernate/model/Item.class
      test/hibernate/model/Item.hbm.xml

      and get the deployment message:
      09:27:01,781 INFO [Configuration] Searching for mapping documents in jar: HibernateExmaple.har
      09:27:01,781 INFO [Configuration] Found mapping documents in jar: test/hibernate/model/Item.hbm.xml
      09:27:01,796 INFO [Binder] Mapping class: test.hibernate.model.Item -> Item


      So I'm confused about the message, that Item is unknown. What's wrong?


      hibernate-service.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
       <attribute name="DatasourceName">java:/MysqlDS</attribute>
       <attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
       <attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
       <attribute name="CacheProviderClass">net.sf.hibernate.cache.TreeCacheProvider</attribute>
       <attribute name="Hbm2ddlAuto">create-drop</attribute>
      
       </mbean>
      </server>