Erro com DataSource

Iai pessual, bele??

então estou estudando DataSource aki e estava fazendo esse exemplo usando mysql, da documentação do site do Tomcat :

http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html

tb fiz esse desse site:

http://www.arquivodecodigos.net/arquivo/visualizar_dica.php?qual_dica=594

porem os dois me retrornam o msm erro, lembrando que eu fiz exatamente igual está descrito.

segue o erro:

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at foo.DBTest.init(DBTest.java:21) at org.apache.jsp.data_002dsource_jsp._jspService(data_002dsource_jsp.java:51) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773) ... 33 more

alguem ai manja o q pode ser??

obrigado

Você configurou tudo certo, usuario, senha, banco, porta, adicionou o driver do mysql no classpath, criou a base usada no mysql?

Disponibilize seu código…

Cara, vlw pela ajuda…

então, creio q esteja tudo configurado, alem do classpath da minha aplicação…eu necessito colocar tb o driver no %CATALINA_HOME%/common/lib né…então tb coloquei la e nda… vou colocar o trecho do server.xml aki:

[code]

factory org.apache.commons.dbcp.BasicDataSourceFactory
<!-- Maximum number of dB connections in pool. Make sure you
     configure your mysqld max_connections large enough to handle
     all of your db connections. Set to 0 for no limit.
     -->
<parameter>
  <name>maxActive</name>
  <value>100</value>
</parameter>

<!-- Maximum number of idle dB connections to retain in pool.
     Set to 0 for no limit.
     -->
<parameter>
  <name>maxIdle</name>
  <value>30</value>
</parameter>

<!-- Maximum time to wait for a dB connection to become available
     in ms, in this example 10 seconds. An Exception is thrown if
     this timeout is exceeded.  Set to -1 to wait indefinitely.
     -->
<parameter>
  <name>maxWait</name>
  <value>10000</value>
</parameter>

<!-- MySQL dB username and password for dB connections  -->
<parameter>
 <name>username</name>
 <value>root</value>
</parameter>
<parameter>
 <name>password</name>
 <value>xxxxxx</value>
</parameter>

<!-- Class name for mm.mysql JDBC driver -->
<parameter>
   <name>driverClassName</name>
   <value>com.mysql.jdbc.Driver</value>
</parameter>

<!-- The JDBC connection url for connecting to your MySQL dB.
     The autoReconnect=true argument to the url makes sure that the
     mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
     connection.  mysqld by default closes idle connections after 8 hours.
     -->
<parameter>
  <name>url</name>
  <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
[/code]

o web.xml da minha aplicação esta assim:

[code]<?xml version="1.0" encoding="ISO-8859-1"?>

<resource-ref>
  <description>DB Connection</description>
  <res-ref-name>jdbc/TestDB</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>

[/code]

sera q vc tem alguma ideia doq possa ser??
vlw

segue novamente o server.xml, sem os comentarios para ficar mais legivel:

[code]

factory org.apache.commons.dbcp.BasicDataSourceFactory
<parameter>
  <name>maxActive</name>
  <value>100</value>
</parameter>

<parameter>
  <name>maxIdle</name>
  <value>30</value>
</parameter>

<parameter>
  <name>maxWait</name>
  <value>10000</value>
</parameter>

<parameter>
 <name>username</name>
 <value>root</value>
</parameter>

<parameter>
 <name>password</name>
 <value>cienci123</value>
</parameter>

<parameter>
   <name>driverClassName</name>
   <value>com.mysql.jdbc.Driver</value>
</parameter>

<parameter>
  <name>url</name>
  <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
[/code]

esse codigo esta dentro da tag

eu não sei o q eu tenho q colocar aki:

<Context path="/DBTest" docBase="DBTest"

vlw