hi terje,

haven't got your book at hand, but as tim stated before, the parser doesn't
like your web.xml, hence the error. i would suggest following the example
given here
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html to setup a connection pool and use the example given there for your
code. it is really well documented and easy to follow (even i could :)

hth, jan

> -----Original Message-----
> From: Terje Hops� [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 29, 2003 2:04 PM
> To: 'Tomcat Users List'
> Subject: RE: Database setup?
>
>
> A correction: the web.xml example is on page 155.
>
> I tried to setup my web.xml according to the page you are
> refering to but I
> get the same error! Do I need to install anything else than what
> comes with
> the standard installation?
>
> - Terje
>
>
> -----Original Message-----
> From: Tim Funk [mailto:[EMAIL PROTECTED]
> Sent: 29. mai 2003 13:49
> To: Tomcat Users List
> Subject: Re: Database setup?
>
>
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex
> amples-how
> to.html
>
> But, the particular error you are currently getting is your
> web.xml is not
> valid with respect to the dtd.
>
> -Tim
>
> Terje Hops� wrote:
> > Hi,
> >
> > I am trying to setup Tomcat according to the book "JavaServer
> Pages" page
> > 157. But all I get when starting up tomcat is errors. I also tried JNDI
> but
> > that was less understandable so I will first try this simple
> setup, which
> I
> > cant understand why failes.
> >
> > Anyone got a hint on what I have to to?
> >
> > I have a standard Tomcat 4.1.18 and JSTL installed.
> >
> > - Terje
> >
> >
> > Here is my setup in web.xml:
> > -------------------------
> >  <context-param>
> >   <param-name>
> >    javax.servlet.jsp.jstl.sql.DataSource
> >   </param-name>
> >   <param-value>
> >
> >
> jdbc:mysql://db.server.no:3306/myuser,com.mysql.jdbc.Driver,myuser
> name,mypas
> > sword
> >   </param-value>
> >  </context-param>
> > -------------------------
> > The error when starting tomcat is:
> > Starting service Tomcat-Standalone
> > Apache Tomcat/4.1.18
> > 29.mai.2003 13:28:37 org.apache.commons.digester.Digester error
> > SEVERE: Parse Error at line 28 column 11: The content of element type
> > "web-app" must match
> >
> "(icon?,display-name?,description?,distributable?,context-param*,f
> ilter*,fil
> >
> ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,m
> ime-mappin
> >
> g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resour
> ce-ref*,se
> >
> curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref
> *,ejb-loca
> > l-ref
> > *)".
> > org.xml.sax.SAXParseException: The content of element type
> "web-app" must
> > match
> >
> "(icon?,display-name?,description?,distributable?,context-param*,f
> ilter*,fil
> >
> ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,m
> ime-mappin
> >
> g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resour
> ce-ref*,se
> >
> curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref
> *,ejb-loca
> > l-ref*)".
> >         at
> >
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException
> (ErrorHand
> > lerWrapper.java:232)
> >         at
> >
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException
> (ErrorHand
> > lerWrapper.java:232)
> >         at
> >
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapp
> er.java:17
> > 3)
> >         at
> >
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReport
> er.java:37
> > 1)
> > ....
> > ----------------------------------
> >
> > In my jsp-file this works fine but I want to put the datasource
> parameters
> > into web.xml instead of each jsp-file where I access a database.
> > ---
> > <sql:setDataSource var="ex" scope="application"
> >  driver="com.mysql.jdbc.Driver"
> >  url="jdbc:mysql://db.server.no:3306/myuser"
> >  user="myusername"
> >  password="mypassword"
> > />
> > <sql:query var="init"
> >  dataSource="${ex}"
> >  sql="select name from adress"
> > />
> >
> > <c:forEach items="${init.rows}" var="row">
> >  <c:out value="${row.name}" /><br>
> > </c:forEach>
> > ---
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to