I just started to try and use a database source for some of my pages in my web app and am not getting a connection.  I am using Tomcat 5.0.19 with JRE 1.4.2_04 on redhat 9 with mysql.  Every time I try to connect I get a exception saying Datasource invalid, not suitable driver for class '' url null (actual error page attached).  I am trying the examples in the docs, I get the same error in either servlet or jsp page, I have included the jsp page.  I have everything packaged in the web.xml file of the application to try and keep it portable.  I also tried using the admin tool and register a global data source and get the same result.
 
If I mistype the datasource name in the jsp it says it cannot find it so I does find some of it to verify, but why does it not find the resource parameters providing the driver and url?  I tried to google for some answers, but did not find much that applied to the same versions.
 
Thanks in advance.
 
===========
Attached are my web.xml, sqltest.jsp, and the error output
<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- 
<!DOCTYPE web-app 
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
    "http://java.sun.com/dtd/web-app_2_3.dtd";>
-->

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="htp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
  version="2.4"  >

<!-- Global declaration for Broadline DB access -->
    <Resource name="jdbc/BroadlineDB" auth="Container"
              type="javax.sql.DataSource"
       description="Broadline Global DB connection to local database">
    </Resource>

    <ResourceParams name="jdbc/BroadlineDB">
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>95</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>10</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>100000</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>tomcat</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>tomcat</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>com.mysql.jdbc.Driver</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:mysql://localhost/broadline?autoreconnect=true</value>
      </parameter>
   </ResourceParams>

    <!-- General description of your web application -->

    <display-name>Broadline File Manager</display-name>
    <description>
      This is version X.X of an application to perform
      a File stuff using JSP pages.  It was written for
      Broadline Media Corp, who should be contacted for
      more information.
    </description>

    <resource-ref>
      <description>DB Connector</description>
      <res-ref-name>jdbc/BroadlineDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
    <resource-ref>
      <description>DB Connector test</description>
      <res-ref-name>jdbc/TestDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
    
    <!-- Context initialization parameters that define shared
         String constants used within your application, which
         can be customized by the system administrator who is
         installing your application.  The values actually
         assigned to these parameters can be retrieved in a
         servlet or JSP page by calling:

             String value =
               getServletContext().getInitParameter("name");

         where "name" matches the <param-name> element of
         one of these initialization parameters.

         You can define any number of context initialization
         parameters, including zero.
    -->

    <context-param>
      <param-name>webmaster</param-name>
      <param-value>[EMAIL PROTECTED]</param-value>
      <description>
        The EMAIL address of the administrator to whom questions
        and comments about this application should be addressed.
      </description>
    </context-param>


    <!-- Servlet definitions for the servlets that make up
         your web application, including initialization
         parameters.  With Tomcat, you can also send requests
         to servlets not listed here with a request like this:

           http://localhost:8080/{context-path}/servlet/{classname}

         but this usage is not guaranteed to be portable.  It also
         makes relative references to images and other resources
         required by your servlet more complicated, so defining
         all of your servlets (and defining a mapping to them with
         a servlet-mapping element) is recommended.

         Servlet initialization parameters can be retrieved in a
         servlet or JSP page by calling:

             String value =
               getServletConfig().getInitParameter("name");

         where "name" matches the <param-name> element of
         one of these initialization parameters.

         You can define any number of servlets, including zero.
    -->

<!--
    <servlet>
      <servlet-name>controller</servlet-name>
      <description>
        This servlet plays the "controller" role in the MVC architecture
        used in this application.  It is generally mapped to the ".do"
        filename extension with a servlet-mapping element, and all form
        submits in the app will be submitted to a request URI like
        "saveCustomer.do", which will therefore be mapped to this servlet.

        The initialization parameter namess for this servlet are the
        "servlet path" that will be received by this servlet (after the
        filename extension is removed).  The corresponding value is the
        name of the action class that will be used to process this request.
      </description>
      <servlet-class>com.mycompany.mypackage.ControllerServlet</servlet-class>
      <init-param>
        <param-name>listOrders</param-name>
        <param-value>com.mycompany.myactions.ListOrdersAction</param-value>
      </init-param>
      <init-param>
        <param-name>saveCustomer</param-name>
        <param-value>com.mycompany.myactions.SaveCustomerAction</param-value>
      </init-param>
-->
      <!-- Load this servlet at server startup time -->
<!--
      <load-on-startup>5</load-on-startup>
    </servlet>
-->
    <servlet>
      <servlet-name>loginValidator</servlet-name>
      <description>
         Validates login of user and set session cookie
      </description>
      <servlet-class>com.broadline.loginValidator</servlet-class>
    </servlet>
    <servlet-mapping>
      <servlet-name>loginValidator</servlet-name>
      <url-pattern>/login.jasx</url-pattern>
    </servlet-mapping>


    <!-- Define the default session timeout for your application,
         in minutes.  From a servlet or JSP page, you can modify
         the timeout for a particular session dynamically by using
         HttpSession.getMaxInactiveInterval(). -->

    <session-config>
      <session-timeout>30</session-timeout>    <!-- 30 minutes -->
    </session-config>

    <welcome-file-list>
       <welcome-file>index.html</welcome-file>
       <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to