Sankar -

I just realized what your error might be:  it looks like the JDBC
parameter string you're using has spaces in it.  This isn't allowed by the
spec.  Try removing the spaces.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)

On Fri, 26 Apr 2002, Sankar B wrote:

> Dear All,
> 
> I can not able to connect using the JNDI relative path
> 'jdbc/jstl' when I give in the <sql:setDataSource> tag
> or in other tags I can able to see the message in the
> Tomcat Console as follows:
> 
> DbcpDataSourceFactory: 
> driverClassName=oracle.jdbc.driver.OracleDriver,
> url=jdb
> c:oracle:thin:@172.17.56.1:1521:idch, user=vms_test
> 
> But, I get the following error in the page:
> 
> HTTP Status 500 - Internal Server Error
> 
> --------------------------------------------------------------------------------
> 
> type Exception report
> 
> message Internal Server Error
> 
> description The server encountered an internal error
> (Internal Server Error) that prevented it from
> fulfilling this request.
> 
> exception 
> 
> java.lang.ClassCastException:
> org.apache.commons.dbcp.PoolingDataSource
>       at
> 
>org.apache.taglibs.standard.tag.common.sql.DataSourceUtil.setDataSource(DataSourceUtil.java:121)
>       at
> 
>org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:182)
>       at
> org.apache.taglibs.standard.tag.el.sql.QueryTag.doStartTag(QueryTag.java:124)
>       at
> org.apache.jsp.jstl$jsp._jspService(jstl$jsp.java:69)
>       at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>       at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>       at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
>       at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
>       at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
>       at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>       at
> 
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
>       at
> 
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
>       at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>       at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
>       at
> org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
>       at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>       at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2349)
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
>       at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
>       at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
>       at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
>       at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
>       at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
>       at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>       at
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1029)
>       at
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1140)
>       at java.lang.Thread.run(Thread.java:484)
> 
> The following is the code im using from the example:
> 
> <%@ taglib prefix="sql"
> uri="http://java.sun.com/jstl/sql"; %>
> <%@ taglib prefix="c"
> uri="http://java.sun.com/jstl/core"; %>
> 
> <html>
> <head>
>   <title>JSTL: SQL action examples</title>
> </head>
> <body bgcolor="#FFFFFF">
> 
> <h1>SQL Query Execution using an iterator</h1>
> 
> <!-- NOTE: the sql:setDataSource tag is for
> prototyping and simple applications. You should really
> use a DataSource object instead -->
> 
>   <sql:query var="deejays" dataSource="jdbc/jstl">
>     SELECT * FROM ID_COUNTRY_MASTER
>   </sql:query>
> 
> 
> <h2>Putting it all together</h2>
> 
> <%-- Easiest example showing how to populate a table
> --%>
> <table border="1">
>   <tr>
>   <%-- Get the column names for the header of the
> table --%>
>   <c:forEach var="columnName"
> items="${deejays.columnNames}">
>     <th><c:out value="${columnName}"/></th>
>   </c:forEach>
> 
>   <%-- Get the value of each column while iterating
> over rows --%>
>   <c:forEach var="row" items="${deejays.rowsByIndex}">
>     <tr>
>       <c:forEach var="column" items="${row}">
>         <td><c:out value="${column}"/></td>
>       </c:forEach>
>   </c:forEach>
> </table>
> 
> </body>
> </html>
> 
> 
> Yours,
> Sankar.B
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 


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

Reply via email to