All - I am trying to integrate Spring 2.5 with Hibernate 3.0 and encountered an issue and sitting like a duck. Tried for more than 4 hours and exhausted now.
The standalone program with public static void main (which is not inside an applicaiton server) will read following spring-config.xml
and access the dao and execute a simple a select.
spring-config.xml
**************
ForumDAOImpl.java
*****************
I encountered the following error
****************************
2531 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
2750 [main] ERROR org.hibernate.LazyInitializationException - could not initialize proxy - no Session
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
Then I changed the spring-config.xml to create a data source using jndi (jdbc/myoracle) configured in
Tomcat App server and
JndiObjectFactoryBean as follows... I also have a seprate hibernate.cfg.xml which contains database information.
Also I had tomcat server running when I was running the program.
Another Different Error this time
**************************
Error creating bean with name 'dataSource' defined in class path resource [spring-config.xml]:
Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name
java:comp is not bound in this Context
Any thoughts or suggestions on how to fix this? Thanks in advance for your time.
Cheers,
Yogesh