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

Datasource Problem

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone look at this context and datasource and see if you can see anything wrong.
I am getting an "Unable to load JDBC Driver 'null'" error. I have my JAR file for Connector/J in the right place.
Thanks
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A stab in the dark, but I've noticed that when I'm setting up JDBC connection (javax.sql.DataSource) resources that the driver has to be in {TOMCAT}/common/lib in order for the application to work. If you have your Connector/J drivers in {TOMCAT}/webapps/holocron/WEB-INF/lib move them to {TOMCAT}/common/lib and see if it works.
I've tried it with Connector/J and Oracle-thin drivers and in both cases the JAR file had to be in the ".../common/lib" directory in order for the app to work.
I guess that even though they are application-specific resources, the "<Context>" tag is virtually part of the "server.xml" configuration and it doesn't look in the individual application context directories.
[ September 17, 2003: Message edited by: Wayne L Johnson ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is in the common/lib folder which is where I put it originally. I also put it in my WEB-INF/lib just in case, but as you said, I don't think tomcat looks there cor Context libraries.
Thanks for the suggestion thought.
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha! I believe that all of the "<Parameter>" tags should be "</parameter>". Nasty case-sensitive values. I changed my ".xml" file and was able to re-create the error you are seeing.
Otherwise it looks good.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wish that were it for me. I had caught that the first time I posted this thread. So I changed all those to lower case, and still got the error. Oh well, I will keep digging. It is probably something just as stupid as the case issue.
Thanks.
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I installed Tomcat-5.0.9 on a secondary machine (running Linux) and ran into the same problem you did. I did some searching on the 'net and found the following from the Tomcat 5 Servlet/JSP Container documentation.
A Context XML descriptor is a fragment of XML data which contains a valid Context element which would normally be found in the main server configuration file (conf/server.xml), and allows easy and automated manipulation of web applications by the various management tools available in Tomcat. For a given host, the Context descriptors are located in $CATALINA_HOME/conf/[enginename]/[hostname]/foo.xml. Note that while the name of the file is not tied to the webapp name, Tomcat will create Context descriptors which match the webapp name whenever it will generate a Context descriptor.

I moved my "estore.xml" file from {TOMCAT}/webapps to {TOMCAT}/conf/Catalina/localhost (where you will find the admin.xml and manager.xml files) and, voila, it worked.
If you aren't running Tomcat 5x this may not help you, but if you are it should solve your problem.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not running Tomcat 5 but it could be the same problem. I will move my context file there and see what happens.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic