Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Unable to configure tomcat 6.0 datasource from within eclipse.

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Few months ago, I was able to setup my eclipse/tomcat6 to pull datasource. Now it is failing with "Name jdbc is not bound in this Context error".
I recently reconfigured my project, which did not involve removing/adding any jar files. I googled this issue and applied numerous solution without

Below is what I did then:



java code:


What I have? I have configured eclipse to start/stop tomcat from within eclipse so I don't have to deploy/undeploy using ant etc.
This configuration created a Servers as eclipse project with its own set of server.xml, web.xml & context.xml. So now:
1. I have these 3 files in tomcat 6.0/conf/ folder
2. I have these 3 files in .../Servers/Tomcat v6.0 Server at localhost-config/ folder (in eclipse)
3. I have context.xml and web.xml in WEB-INF folder
4. I have context.xml in META-INF folder

Can anybody guide me through? When tomcat is started from within eclipse what xml files take precedence over others (listed from 1 - 4 above).
How can I find what context.xml file is being used?

Thanks in advance.

Tom Sayer
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed it at last. Let me share my ordeal with all those who spared sometime to, at least, read it.

1. I started by removing all the code changes mentioned above and added them back one by one.
2. Added WEB-INF/web.xml entry back. This solved the posted issue but got "Cannot create JDBC driver of class '' for connect URL 'null'". Obviously, I needed to add driver/database information somewhere.
3. Adding anything in WEB-INF/context.xml did not impact anything. So removed it all together.
4. Added back the META-INF/context.xml file. This brought back the posted error. So this was the culprit.
5. Googled the new error listed in #2 above and landed on
6. Tried almost everything but post by rxaviers dated 3/14/06 make it work. I replaced the code in META-INF/context.xml with the following:

As I mentioned ealier, I start tomcat from within Eclipse, this causes the application to be deployed to C:\yourProject\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps in eclipse work space. When I made changes in <host> tab in the tomcat's conf/server.xml the changes won't propagate to the above tmp0 folder. And when I put the META-INF/context.xml back into my project, anything in there would appear in there.
Hope this would help someone out there.
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic