Ok, here goes, figured I would allow my classes to lookup the sessionFactory which would simplify things --
Code:
<hibernate-configuration>
<session-factory name="java:comp/env/hibernate/SessionFactory" >
<property name="hibernate.dialect">net.sf.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.datasource">jdbc/DINTDS</property>
<property name="hibernate.connection.username">ATA_CUSTOM</property>
<property name="hibernate.connection.password">ATA_CUSTOM</property>
<!--property name="hibernate.session_factory_name">java:comp/env/hibernate/SessionFactory</property -->
<property name="show_sql">true</property>
<property name="transaction.factory_class">
net.sf.hibernate.transaction.JTATransactionFactory
</property>
<mapping resource="hibernateXML/Client.hbm.xml"/>
<mapping resource="hibernateXML/Person.hbm.xml"/>
<mapping resource="hibernateXML/Extra.hbm.xml"/>
<class-cache class="com.test.test1.Client" usage="read-only"/>
<class-cache class="com.test.test1.Person" usage="read-only"/>
<class-cache class="com.test.test1.Extra" usage="read-only"/>
</session-factory>
</hibernate-configuration>
I Tried accesing the jndi name via the InitialContext:
Code:
Configuration conf = new Configuration().configure();
String jndiLocation = "/hibernate/SessionFactory";
Context ctx = new InitialContext();
sessionFactory = ( SessionFactory ) ctx.lookup(jndiLocation);
Code:
String jndiLocation = "/hibernate/SessionFactory";
Context ctx = new InitialContext();
sessionFactory = ( SessionFactory ) ctx.lookup(jndiLocation);
Both provided the following from the logs:
Code:
javax.naming.NameNotFoundException: hibernate/SessionFactory not found in One2Many/One2ManyWeb, there are no bound values
So, i switch to the following:
Code:
sessionFactory = new Configuration().configure().buildSessionFactory();
With the following log:
Code:
13:44:47,011 DEBUG Configuration:952 - java:comp/env/hibernate/SessionFactory<-org.dom4j.tree.DefaultAttribute@9bf922 [Attribute: name resource value "hibernateXML/Client.hbm.xml"]
And I figured-- Ok Hibernate is JNDI aware, so I added some code to the lookup via InicialContext.lookup and still got a namingException...
What gives: