• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring & Hibernate on Geronimo

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Hey! Wanna see my flashlight? It looks like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic