im trying to get hibernate to work with Spring in Geronimo. So far, I have Hibernate 3.4 integrated into Geronimo and it works fine. When I try and configure the EntityManagerFactory bean in Spring, I make no headway. I get a NonContextException.
Here's what I did in persistence.xml:
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="wakapeekPU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>postgresDS</jta-data-source>
<non-jta-data-source>postgresDS</non-jta-data-source>
<class>com.wakapeek.persist.entity.SystemUserEntity</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="false" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.GeronimoTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
and in Spring...
<
jee:jndi-lookup id="myEmf" jndi-name="persistence/wakapeekPU" resource-ref="true"/>
</beans>
I've tried all sorts of variations on the jndi-name (including
java:comp/env/jdbc/postgresDS).. just can't get it working and don't know why... I just finished my POC with Ibatis and Spring and that went very well, not sure why this is giving me such a headache.. oh wait, i know why.. i dont know what im doing !
btw, my datasource is created in the geronimo plan and its called postgresDS ... one thing i wasnt sure of, is what to pass in the jndi-name .. is it the PU as in wakapeekPU or the datasource? i tried them all anyway, still didnt work... I dont normally ask here until ive exhausted at least 48 hrs on the same issue, so i hope you dont think im being lazy...
Anyway, any clues or suggestions would be really appreciated.
-B ill y