0 Replies Latest reply on Oct 10, 2003 2:14 PM by ihateloginnames

    Error looking up class resources

    ihateloginnames

      Hello,

      I have been banging my head against a problem that seems to be a JBoss-Hibernate class loader problem for a couple days now. (Note, for reason I don't care to go into, I can not use the JBoss MBean configuration option.)

      I am trying to configure my hibernate session factory in the following way:

      Configuration cfg = new Configuration().addClass(PurchaseOrderImpl.class);
      SessionFactory sessFac = cfg.buildSessionFactory();

      When I fire up my application in jboss I get the following stack trace:
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      net.sf.hibernate.MappingException: Resource: com/partnet/netops2/domain/events/PurchaseOrderImpl.hbm.xml not found
      at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:285)
      at com.partnet.netops2.persistence.dao.hibernate.PurchaseOrderDaoFactory.initialize(PurchaseOrderDaoFactory.java:59)
      ... 68 more
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      I am using JBoss 3.2.1, and I have the following jars (among others) in my server's lib dir:

      commons-collections.jar
      commons-lang.jar
      commons-logging.jar
      cglib-asm.jar
      hibernate2.jar
      odmg.jar

      In WEB-INF/lib and WEB-INF/classes I have all of my applicatioin code, including my hibernate specific dao, whos factory is blowing up durring initialization. Also, note that the mapping file that can not be found (PurchaseOrderImpl.hbm.xml) is sitting right next to the class (PurchaseOrderImpl.class) under WEB-INF/classes, which is being successfully loaded.

      Hibernate version is 2.0.3

      Any insight would be greatly appreciated!

      Troy