Since the <context> element is outside of the server.xml file, you don't need the 'path' attribute. From http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
"The value of this field [path] must not be set except when statically defining a Context in server.xml, as it will be inferred from the filenames used for either the .xml context file or the docBase." Also, the docBase is only needed when your web application is outside of the 'webapps' directory. "You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host." But those are probably unrelated to the JDBC issue. Make sure that your JDBC driver is in the common/lib directory with the DBCP jar files. Since the Tomcat DBCP library will be instantiating the driver, it needs to be able to find the driver in the same classloader. See http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html Now as far as the message itself, most would scoff at the idea that a non-useful error message is a critical bug, but your frustration demonstrates how poor error messages are just as damaging as "real" bugs! SQLState: null Code: 0 Message: Cannot create JDBC driver of class '' for connect URL 'null' How useful! DBCP is not much better, their error logging is nearly non-existent. Bernie Durfee > -----Original Message----- > From: g m [mailto:[EMAIL PROTECTED] > Sent: Friday, January 20, 2006 6:22 AM > To: Tomcat Users List > Subject: RE: Absolute Guide for config of JDBC Connection Pool ? > > > Ok, I have tried it....it fails ..or maybe I am helping it fail? > > Been fighting with it all morning......I followed your > email and the doc...here are my entries/values..any opinions > on what else to try? > > > 1. Resource entry values > > <Context path="/DBS3" docBase="DBS3" reloadable="true" > > <Resource name="jdbc/deebee" > type="javax.sql.DataSource" > auth="Container" > driverClassName="com.sybase.jdbc3.jdbc.SybDriver" > url="jdbc:sybase:Tds:10.xx.xxx.xx:5001" > username="xxxxx" > password="xxxx" > maxIdle="15" > maxActive="50" > maxWait="10000" > factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" > removeAbandoned="true" > removeAbandonedTimeout="60" > logAbandoned="true"/> > </Context> > > 2. web.xml entry > > <description>Sybase Connection Resource</description> > <resource-ref> > <res-ref-name>jdbc/deebee</res-ref-name> > <res-type>javax.sql.DataSource</res-type> > <res-auth>Container</res-auth> > </resource-ref> > > 3. Java code - error checking left out... > > Context ctx = new InitialContext(); > DataSource ds = (DataSource) > ctx.lookup("java:comp/env/jdbc/deebee"); > Connection dbconn = ds.getConnection() ; > > 5. Put resource entry in file > conf/Catalina/localhost/DBS3.xml with following error: > > "WARNING: A docBase C:\Program Files\Apache Software Foundation\ > Tomcat 5.5\webapps\DBS3 inside the host appBase has been > specified, and will be ignored" > > 6. Put resource entry in server.xml with error. > > SQLState: null > Code: 0 > Message: Cannot create JDBC driver of class '' for > connect URL 'null' > > > 7. Put it in webapps/DBS3/META-INF/context.xml with error. > > SQLState: null > Code: 0 > Message: Cannot create JDBC driver of class '' for > connect URL 'null' > > > any suggestions gladly taken .... > Thanks! > > > > > > > g m <[EMAIL PROTECTED]> wrote: > Agreed! Simple no-nonsense description - I shall give it a > 'whirl' ..... > > Thanks Len - your on my Xmas list ;-) > > "Durfee, Bernard" wrote: > Excellent! That is the exact documentation that should be on > the Tomcat > site. It would also be nice to see a quick description of how Tomcat > processes the sections, what exactly it does with the > attributes, so that other drivers and pools can be configured. > > There are also other parameters that DBCP accepts... > > http://jakarta.apache.org/commons/dbcp/configuration.html > > Bernie Durfee > > > > > -----Original Message----- > > From: Len Popp [mailto:[EMAIL PROTECTED] > > Sent: Thursday, January 19, 2006 12:58 PM > > To: Tomcat Users List > > Subject: Re: Absolute Guide for config of JDBC Connection Pool ? > > > > > > I don't know if there's a complete top-to-bottom guide, but here's > > what I know from setting up connection pooling under 5.5.12: > > > > 1. The JDBC driver JAR must go in the common/lib directory (because > > for connection pooling it needs to be accessible to both Tomcat and > > the web app). > > > > 2. DBCP is built into Tomcat so you don't need to install a > > JAR for that. > > > > 3. The tag goes inside the tag for the web app, > > wherever it is (server.xml, webapps//META-INF/context.xml or > > conf/Catalina/localhost/.xml) > > Note that the syntax for has changed from earlier versions > > - see the Tomcat documentation. Here's a sample: > > > > > type="javax.sql.DataSource" > > auth="Container" > > driverClassName="com.mysql.jdbc.Driver" > > url="jdbc:mysql://localhost:3306/???" > > username="???" > > password="???" > > maxIdle="15" > > maxActive="50" > > maxWait="10000" > > factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" > > removeAbandoned="true" > > removeAbandonedTimeout="60" > > logAbandoned="true"/> > > > > The "???" bits are installation-dependent. Some of the > parameters will > > be different for Sybase (driverClassName and url for sure). > > > > 4. Yes, it is supposed to say "... .dbcp.dbcp ..." in the > > factory= line. > > > > 5. The code to get a DB connection is: > > InitialContext initCtx = new InitialContext(); > > DataSource ds = (DataSource) > > initCtx.lookup("java:comp/env/jdbc/???"); > > Connection conn = ds.getConnection(); > > Make sure that "jdbc/???" is the same here as in the tag. > > > > 6. Always close the connection when you're done with it. Use a > > "finally" block to make sure. > > > > 7. If you're trying to decide where to put the declaration, > > the choices are: > > - server.xml - Don't put it here. We're told it's bad. > > - webapps//META-INF/context.xml - If you put it here, it will be > > bundled up in the app's WAR file. That makes it easier to > install, but > > harder to configure if every installation has different details for > > the database tag. > > - conf/Catalina/localhost/.xml - If you put it here, it's easier > > to edit the tag, but it's an extra file to be installed in > > addition to the WAR. > > > > Hope this helps. At least it's shorter than > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-exampl > es-howto.html. > :-) > > On 1/19/06, g m wrote: > > There seems to be 'truckloads' of information on just as many forums > on how best to setup a JDBC connection pool, varying from > which file to > put what entries (server.xml, context.xml, web.xml) etc.... > > > > It looks like the same questions be asked in a slightly different > fashion and for different environments. > > > > Does anyone happen to know where there is a definative guide on how > to do this and what jar files one needs ?... or does this > sort of 'clean > doc' not exist ? > > > > FYI: My environment: Tomcat 5.5.9, Sybase, Windows . > > Many thanks! > > -- > Len > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------- > Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, > & more on new and used cars. > > > > --------------------------------- > Yahoo! Photos - Showcase holiday pictures in hardcover > Photo Books. You design it and we'll bind it! > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]