File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes JNDI exception when creating dataSource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI exception when creating dataSource" Watch "JNDI exception when creating dataSource" New topic
Author

JNDI exception when creating dataSource

Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
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 ]

Anadi Mishra.
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
@PersistenceContext(unitName="datasourcename") private EntityManager manager;

Have you done this.


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
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

Joined: Feb 08, 2007
Posts: 159
Oh ok. I think am wrong. Not sure.
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
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


Visit my blog: http://jnassef.blogspot.com/
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI exception when creating dataSource