Re: About a JDBC error

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: About a JDBC error
Дата
Msg-id 407636D9.9080005@opencloud.com
обсуждение исходный текст
Список pgsql-jdbc
zhang-x@cnt.mxy.nes.nec.co.jp wrote:
> Hi all,
>
> I have got this error.
> How can I do with this error?
> I have no idea.

What version of the driver are you using? I see this in the CVS logs:

> ----------------------------
> revision 1.31
> date: 2004/02/10 01:56:46;  author: jurka;  state: Exp;  lines: +14 -6
> Don't try to turn the random bytes from a md5 salt into a String
> because it may not be a valid String depending on the encoding.
>
> Per report from Nadeem Bitar.
> ----------------------------

so if your driver is older than that, it may be the problem.

Failing that, are you using crypt-based authentication? ("crypt" in the
appropriate access line in pg_hba.conf). From a quick glance at the code
it looks like the crypt salt suffers from the same problem as md5 used
to -- it tries to turn a couple of bytes into a String using the default
encoding, which will not work reliably. As a temporary workaround, try
changing pg_hba.conf to use "md5" instead of "crypt".

If you use a different default encoding such as ISO-8859-1 (IIRC you can
do this by setting the file.encoding system property, i.e.
-Dfile.encoding=ISO-8859-1) does the problem go away?

> ----------------err----------------------
> DBAccess.getConnection(): Something unusual has occured to cause the driver
> to fail. Please report this exception: Exception:
> java.lang.IllegalArgumentException
> Stack Trace:
>
> java.lang.IllegalArgumentException
>  at java.nio.Buffer.position(Buffer.java:218)
>  at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:575)
>  at java.lang.StringCoding$CharsetSD.decode(StringCoding.java:186)
>  at java.lang.StringCoding.decode(StringCoding.java:224)
>  at java.lang.StringCoding.decode(StringCoding.java:230)
>  at java.lang.String.<init>(String.java:371)
>  at
> org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV2(AbstractJdbc1C
> onnection.java:634)

-O

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Andrew Lazarus"
Дата:
Сообщение: Re: Visual tools
Следующее
От:
Дата:
Сообщение: Re: About a JDBC error