users@glassfish.java.net

Re: GF2-v41 + JDK 1.6 + PostgreSQL 8.2 problems, as seen in issue 1522

From: Ryan de Laplante <ryan_at_ijws.com>
Date: Thu, 16 Aug 2007 15:05:23 -0400

Hi,

I'm using Glassfish V2 b58 RC1, and JDK 1.6 update 2. I've tried to use
the latest stable JDBC4 driver for Postgres 8.2 and experienced the same
exceptions you saw. I switched to the JDBC3 driver, restarted the app
server and experienced the other exception you described.

I see a ticket was created for this issue:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=2779

WORKAROUND:

1) Use DataSource of type "javax.sql.DataSource" instead of
ConnectionPoolDataSource/XADataSource, if jdk 1.6 is mandatory
2) Use jdk 1.5 (since the driver is jdbc 3.0 compatible only), if
XADataSource
support is mandatory.

Neither of those workarounds are good for me. I could use JDK 1.5 but I
don't think I should have to.

The fix was to add a new property to your datasource to indicate that
you are using a JDBC3 datasource:

name=JDBC30DataSource
value=true


Does that mean if I want to use any JDBC3 driver in GlassfishV2 on JDK
1.6, I have to add that property? Why not add a checkbox for that
property directly below the Datasource Classname?


Also, is the JDBC 4 issue on JDK 1.6 specific to postgres, or all JDBC4
drivers?


Thanks,
Ryan


glassfish_at_javadesktop.org wrote:
> Nono, I was a bit unclear. The point is that, if I understand the problem, GF always seems to think I've loaded JDBC 4 drivers, and tries to call JDBC 4 methods on my JDBC 3 drivers, and all exceptions are not equal.
>
> PostgreSQLs JDBC 4 drivers throw a "org.postgresql.util.PSQLException, (...) xxxxxx() is not yet implemented" for all JDBC 4 methods, which GF catches, and continues processing normally. This gives me the page correctly anyhow, but a lot of gunk in server.log unless I up the loglevel. But with the JDBC 3 drivers there's no stub that throws an exception, and instead the JVM (IIUC) throws a java.lang.AbstractMethodError, which GF doesn't seem to catch, and the browser gets a HTTP 503 (I think) with the exception on.
> [Message sent by forum member 'thormick' (thormick)]
>
> http://forums.java.net/jive/thread.jspa?messageID=211094
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>