geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Dushok <bdus...@mac.com>
Subject Re: Database pool problem
Date Mon, 04 Sep 2006 01:21:04 GMT
Rik,
         Thanks for the reply.

         The errors change when I make the code changes.  I'm now  
encountering the following:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
Generated servlet error:
Type mismatch: cannot convert from Object to DataSource

An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
Generated servlet error:
javax.sql.Connection cannot be resolved to a type

          Bob

On Sep 3, 2006, at 4:55 PM, Rik wrote:

> Hi,
>
>
> Do you still have those errors if you replace your code with the  
> following?
>
> javax.naming.InitialContext ctx = new javax.naming.InitialContext();
> javax.sql.DataSource ds = ctx.lookup("java:comp/env/jdbc/cl");
> javax.sql.Connection con = ds.getConnection();
>
>
> Rik
>
> Within my code I attempt to access the pool as follows:
>
>          InitialContext ctx = new InitialContext();
>          DataSource ds = ctx.lookup("java:comp/env/jdbc/cl");
>          Connection con = ds.getConnection();
>
> When the page executes I receive the following errors:
> org.apache.jasper.JasperException: Unable to compile class for JSP
>
> An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
> Generated servlet error:
> InitialContext cannot be resolved to a type
>
> An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
> Generated servlet error:
> InitialContext cannot be resolved to a type
>
> An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
> Generated servlet error:
> DataSource cannot be resolved to a type
>
> Could someone tell me what I've done incorrectly?  The process seems
> straightforward, but I've done something incorrectly.
>
> Thanks,
> Bob
>
>


Mime
View raw message