This was one of the problems I had.

Mark

----- Original Message -----
From: "Soefara Redzuan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 4:16 PM
Subject: Re: jndi versus database connection pooling


> Yes, sorry, I was using dummy values and forgot that.  Thank you for
> pointing that out. But my main problem seems to be with the XML parsing of
> the config file, regardless of the values I use, since the Tomcat error on
> the console is
>
> org.xml.sax.SAXParseException: Element "resource-ref" does not allow
> "resource-ref-name" here.
>
> I'm surprised nobody else got this following the JNDI howto.
>
> Soefara.
>
>
>
> >From: [EMAIL PROTECTED]
> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: jndi versus database connection pooling
> >Date: Thu, 14 Mar 2002 11:03:07 -0500
> >
> >
> >Hi Soefara,
> >
> >Your <res-ref-name> in web.xml should have same name with <Resource
name="
> >        jdbc/creditel" auth="Container"  type="javax.sql.DataSource"/> in
> >        server.xml.
> >
> >Good luck,
> >
> >
> >
> >
> >
> >"Soefara Redzuan" <[EMAIL PROTECTED]> on 03/14/2002 10:47:51 AM
> >
> >Please respond to "Tomcat Users List" <[EMAIL PROTECTED]>
> >
> >To:    [EMAIL PROTECTED]
> >cc:
> >Fax to:
> >Subject:    Re: jndi versus database connection pooling
> >
> >
> > >>"Mark Muffett" <[EMAIL PROTECTED]> on 03/14/2002 04:18:13 AM
> > >>The coding side seems to be well documented, and there have been
> > >>several instances posted here, but (as far as I can see) we're all
> > >>working in the dark with server.xml.  I've spent a lot of time trying
> > >>to get database pooling to work with Postgresql, but I've failed and
> > >>given up.  I'd be interested to know what database/tomcat
configurations
> > >>anyone has got to work - with some sample server.xml fragments if
> > >>possible.
> >
> >Thank goodness it's not just me. I was starting to feel very stupid.
> >
> > >From: [EMAIL PROTECTED]
> > >Hi, here is an example.
> > >
> > >Server.xml
> > >
> > ><Context path="/creditel" docBase="creditel" debug="0"
> > >                  reloadable="true" crossContext="true">
> > >   <Resource name="jdbc/creditel" auth="Container"  type
> > >="javax.sql.DataSource"/>
> > >    <ResourceParams name="jdbc/creditel">
> > >      <parameter><name>driverClassName</name>
> > >       <value>COM.ibm.db2.jdbc.net.DB2Driver</value></parameter>
> > >     <parameter><name>driverName</name>
> > >       <value>jdbc:db2://URL/DATABASENAME</value></parameter>
> > >     <parameter><name>user</name><value>USERNAME</value></parameter>
> > >
<parameter><name>password</name><value>PASSWORD</value></parameter>
> > >     <parameter><name>maxPoolSize</name><value>2</value></parameter>
> > >     <parameter><name>loginTimeout</name><value>10</value></parameter>
> > >
> > >   </ResourceParams>
> > ></Context>
> >
> >I did something similar in server.xml and Tomcat has not complained yet.
> >
> >This is mine for mysql
> >
> ><Context path="/myapp" docBase="myapp" debug="0" reloadable="true">
> >
> ><Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource"/>
> ><ResourceParams name="jdbc/mydb">
> >   <parameter>
> >     <name>user</name>
> >     <value></value>
> >   </parameter>
> >   <parameter>
> >     <name>password</name>
> >     <value></value>
> >   </parameter>
> >   <parameter>
> >     <name>driverClassName</name>
> >     <value>org.gjt.mm.mysql.Driver</value>
> >   </parameter>
> >   <parameter>
> >     <name>driverName</name>
> >     <value>jdbc:mysql://url/databasename</value>
> >   </parameter>
> ></ResourceParams>
> ></Context>
> >
> > >web.xml
> > >
> > ><resource-ref>
> > >   <res-ref-name>jdbc/creditel</res-ref-name>
> > >   <res-type>javax.sql.DataSource</res-type>
> > >   <res-auth>Container</res-auth>
> > ></resource-ref>
> >
> >My web.xml has more in it.
> >
> ><web-app>
> >     <servlet>
> >         <servlet-name>myServlet</servlet-name>
> >         <servlet-class>myServlet</servlet-class>
> >     </servlet>
> >     <servlet-mapping>
> >         <servlet-name>myServlet</servlet-name>
> >         <url-pattern>/myServlet</url-pattern>
> >     </servlet-mapping>
> >              <resource-ref>
> >                <description>
> >                  Resource reference to a factory for java.sql.Connection
> >                  instances that may be used for talking to a particular
> >                  database that is configured in the server.xml file.
> >                </description>
> >                <resource-ref-name>
> >                  jdbc/mydb
> >                </resource-ref-name>
> >                  <res-type>javax.sql.DataSource</res-type>
> >                  <res-auth>Container</res-auth>
> >              </resource-ref>
> ></web-app>
> >
> >But when I start Tomcat it gives me this error
> >
> >Apache Tomcat/4.0
> >PARSE error at line 29 column -1
> >org.xml.sax.SAXParseException: Element "resource-ref" does not allow
> >"resource-ref-name" here.
> >
> >Which is very strange because I just followed the examples in the JNDI
> >howto.
> >
> >Soefara.
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.
>
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to