Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to configure tomcat 6.0 datasource from within eclipse.

 
Tom Sayer
Greenhorn
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
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
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 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic