• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

JNDI exception when creating dataSource

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have configured the following context tag for using a dataSource over JNDI,
this is added within the Host Tag in server.xml



And in my web application I add the following defintion



However initialization still fails and I get the Error



the enite trace is as follows



Sorry I forgot to add, its a spring web app, and I have the following addedthe applicationContext.xml



I am using Spring 2.5.4. Please help
[ July 31, 2008: Message edited by: Anadi Mishra ]
 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@PersistenceContext(unitName="datasourcename") private EntityManager manager;

Have you done this.
 
Anadi Misra
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Not sure what you meant but I am not using an Entity Manager, I am using the HibernateTransactionManager in the application. The application runs on Tomcat 5.5.28.

The application persists POJOs which hold User, and Event information



As you can see i was earlier using the JndiObjectFacotryBean but then i used to get

 
Jetendra Ivaturi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh ok. I think am wrong. Not sure.
 
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context



Your JNDI name is "jdbc/webmeet" but "jdbc" is not bound to your context
 
Anadi Misra
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Any specific way or configuration that i have to do to bind this 'jdbc' name? I have provided a Context definition and a resource ref definition in the web.xml. The reason for asking is that even if i use a name like wmAppDS i get the sane exception with wmAppDS replacing jdbc.

More I some how see that tomcats pooling restricts you to using javax.sql.DataSource only. For example if i use something like these



and the web xml res-type tag to



or even



It still fails. It only works if i keep res-type in the web.xml and the type attribute or resource tag in server.xml to javax.sql.DataSource, but then the logs show that C3P0 is not being used.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic