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
... 68 more
I am using JBoss 3.2.1, and I have the following jars (among others) in my server's lib dir:
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!