aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Unable to configure tomcat 6.0 datasource from within eclipse. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Unable to configure tomcat 6.0 datasource from within eclipse." Watch "Unable to configure tomcat 6.0 datasource from within eclipse." New topic
Author

Unable to configure tomcat 6.0 datasource from within eclipse.

Tom Sayer
Greenhorn

Joined: Jan 19, 2008
Posts: 7
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
success.

Below is what I did then:

WEB-INF/context.xml


WEB-INF/web.xml

java code:

CATALINE_HOME=C:\Tomcat 6.0

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.

T.
Tom Sayer
Greenhorn

Joined: Jan 19, 2008
Posts: 7
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 http://forums.sun.com/thread.jspa?threadID=567630&start=0&tstart=0
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.
Thanks.
T.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to configure tomcat 6.0 datasource from within eclipse.
 
Similar Threads
Unable make database connection using JNDI with tomcat
'jdbc' in JNDI name causes problem on Tomcat 6
Juddi DB connection problem
Whacky db problem.
Re Connection pooling