Hi all,
I have an Enterprise application made up of a :
-WAR archive
-HAR archive (Hibernate persistent classes)
now I'm going to add an EJB JAR (A Session Bean). I'm trying to use Hibernate persistent classes from the EJB however I've found some problems:
@Stateless public class ManagerBean implements ManagerLocal { @PersistenceUnit(unitName="unit1") SessionFactory factory; public void executeQuery() { // Factory is correctly injected here System.out.println("Factory is "+factory); // TransactionException // hsession.beginTransaction(); Session hsession = factory.openSession(); List <Data> result = hsession.createQuery("from com.igv.Data").list(); ..... }
08:55:27,982 WARN [QuerySplitter] no persistent classes found for query class: from com.igv.Data
I've been able to reach Hibernate classes, by copying them in the EJB jar file. So it's a matter of classloading. So classes in the .HAR archive are not visible by EJB. Is it possible to change its classloading configuration ?