camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Camel Guice and JNDi and Hibernate SessionFactory
Date Thu, 19 May 2016 19:49:42 GMT
Trying to integrate Camel Guice and JNDI. 

I have configured DataSource as provider binding in Guice Module. This
module is bootstrapped through file in classpath

public DataSource createDataSource() {
   //Actual code for creating DataSource

Another Provider Binding creates Hibernate SessionFactory

public SessionFactory createHibernateSessionFactory() {
  // Try to create Hibernate Session Factory by loading hibernate.cfg.xml.
Which uses the above created // DataSource 

The above Binding creates an Infinite Recursion in
GuiceInitialContextFactory in the method getInitialContext. i.e  when
SessionFactory is created it looks up DataSource using JNDI then again the
SessionFactory is being Initialized again which triggers again a call to
lookup DataSource  and this becomes recursive.

Any help here would be greatful

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message