tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Ivanov <sha...@webdev.ines.ro>
Subject JDBC Data Sources
Date Wed, 10 Oct 2001 18:29:21 GMT

Hello
I'm trying to use JDBC Data Sources in an aplication, so I read the tomcat
howto regarding jndi resources.
I installed the jdbc driver(for mysql), I declared the resource
requirements in the web application deployment descriptor:

<!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>

    <display-name>Shadow's Application</display-name>
    <description>
  This is a simple web application.
    </description>
    <resource-ref>
      <resource-ref-name>
  jdbc/shadowDB
      </resource-ref-name>
      <res-type>
  javax.sql.DataSource
      </res-type>
      <res-auth>
  Container
     </res-auth>
   </resource-ref>

</web-app>

and then I modified server.xml to:
 <Resource name="jdbc/shadowDB" auth="Container" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/shadowDB">
      <parameter><name>user</name><value>shadow</value></parameter>
      <parameter><name>password</name><value>gigi</value></parameter>
      <parameter><name>driverClassName</name>
        <value>org.gjt.mm.mysql.Driver</value></parameter>
      <parameter><name>driverName</name>
        <value>jdbc:mysql:database</value></parameter>
    </ResourceParams>.

Then I restarted tomcat, but an error occured when tomcat wanted to
initialize my application:
2001-10-10 21:13:17 ContextConfig[/Shadow] Parse error in application web.xml
org.xml.sax.SAXParseException: Element type "resource-ref-name" must be declared.
......

I looked through web-app_2_3.dtd and I think the web application
deployment descriptor looks fine, but I'm new to xml too.

Is there something wrong in what I did ?
Please help me..

If you need other details, just ask.
Btw: I'm using Apache Tomcat/4.0.1-b1, but Tomcat 4.0 did the same thing.


Mime
View raw message