Обсуждение: problem in getting Large Object from pooled PostgreSQL / Tomcat 6
hello I am trying to Retrieve image ( Large Object) from pooled PostgreSQL / tomcat 6: I am having some exceptions from following ds = (DataSource) ctx.lookup("java:comp/env/jdbc/bzk2"); Connection conn = ds.getConnection(); PGConnection pgCon = (PGConnection) ((DelegatingConnection)conn) // ****exception .getInnermostDelegate(); lobj = ((org.postgresql.PGConnection)pgCon).getLargeObjectAPI(); SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /iki.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEventsource=com.sun.faces.lifecycle.LifecycleImpl@1f0f0c8 Dec 19, 2008 6:04:21 PM org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter SEVERE: Exception in the filter chain javax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource $PoolGuardConnectionWrapper cannot be cast to org.apache.commons.dbcp.DelegatingConnection how can I solve the problem ? regards
ahmettemiz88 wrote: > I am trying to Retrieve image ( Large Object) from pooled PostgreSQL / > tomcat 6: > > I am having some exceptions from following > > ds = (DataSource) ctx.lookup("java:comp/env/jdbc/bzk2"); > Connection conn = ds.getConnection(); > PGConnection pgCon = (PGConnection) ((DelegatingConnection)conn) // > ****exception > .getInnermostDelegate(); > > lobj = ((org.postgresql.PGConnection)pgCon).getLargeObjectAPI(); > [...] > org.apache.tomcat.dbcp.dbcp.PoolingDataSource > $PoolGuardConnectionWrapper cannot be cast to > org.apache.commons.dbcp.DelegatingConnection > > > how can I solve the problem ? I don't thing that this has anything to do with PostgreSQL. Neither an org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper nor an org.apache.commons.dbcp.DelegatingConnection are part of the PostgreSQL JDBC driver. Yours, Laurenz Albe
On Tue, Dec 23, 2008 at 3:12 AM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
Dave
ahmettemiz88 wrote:[...]
> I am trying to Retrieve image ( Large Object) from pooled PostgreSQL /
> tomcat 6:
>
> I am having some exceptions from following
>
> ds = (DataSource) ctx.lookup("java:comp/env/jdbc/bzk2");
> Connection conn = ds.getConnection();
> PGConnection pgCon = (PGConnection) ((DelegatingConnection)conn) //
> ****exception
> .getInnermostDelegate();
>
> lobj = ((org.postgresql.PGConnection)pgCon).getLargeObjectAPI();
>> org.apache.tomcat.dbcp.dbcp.PoolingDataSource
> $PoolGuardConnectionWrapper cannot be cast to
> org.apache.commons.dbcp.DelegatingConnection
>
>
> how can I solve the problem ?
You have to get the underlying connection from the pooled connection.
Dave