-
1. Re: Hibernate - JNDI - Lookup
getagrip Feb 27, 2004 7:40 PM (in response to getagrip)O.K after some time I see that you set up the session the following way:
Context ctx = new InitialContext();
SessionFactory factory = (SessionFactory)ctx.lookup("java:/DefaultDS");
However the second line throws a ClassCastException because ctx.lookup
returns an Object of type: org.jboss.resource.adapter.jdbc.WrapperDataSource
so all I can do is:
DataSource ds = (DataSource)ctx.lookup("java:/DefaultDS");
How can I obtain a SessionFactory then? -
2. Re: Hibernate - JNDI - Lookup
aradka Feb 27, 2004 9:16 PM (in response to getagrip)If you set up hibernate in a sar you should set your config in jboss-service.xml
Have you read the doc on the hibernate site?
http://www.hibernate.org/66.html
Here is how I got mine configured:
at the bottom of the thread I describe the setup that finally worked for me.
http://forum.hibernate.org/viewtopic.php?t=927974&highlight=
Hope it helps