aspose file tools*
The moose likes Tomcat and the fly likes Datasource Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Datasource Problem" Watch "Datasource Problem" New topic
Author

Datasource Problem

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

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


GenRocket - Experts at Building Test Data
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
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
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

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

Joined: Sep 03, 2003
Posts: 399
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
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

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

Joined: Sep 03, 2003
Posts: 399
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
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Datasource Problem