Re: NPE in creating a SQLException

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Peter Royal <proyal(at)pace2020(dot)com>
Cc: Postgres JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: NPE in creating a SQLException
Date: 2003-07-29 16:39:18
Message-ID: 1059496759.4593.29.camel@coppola.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I'm pretty sure the PSQLException#toString() method itself returns null
for some strange reason... if you take a look at PrintWriter:392,
PrintWriter:247 and String:2177, that's the only reason I can think of
based on the stack trace.
I've checked my local sources (don't know the version),
PSQLException#toString there won't return null. Can you check your
sources ?

Cheers,
Csaba.

On Tue, 2003-07-29 at 16:01, Peter Royal wrote:
> I'm getting the below NPE:
>
> java.lang.NullPointerException
> at java.io.PrintWriter.write(PrintWriter.java:247)
> at java.io.PrintWriter.print(PrintWriter.java:392)
> at java.io.PrintWriter.println(PrintWriter.java:529)
> at java.lang.Throwable.printStackTrace(Throwable.java:509)
> at java.sql.SQLException.<init>(SQLException.java:103)
> at
> org.postgresql.util.PSQLException.<init>(PSQLException.java:19)
> at
> org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connec
> tion.java:480)
> at
> org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connec
> tion.java:461)
> at
> org.postgresql.jdbc1.AbstractJdbc1Connection.setAutoCommit(AbstractJdbc1
> Connection.java:942)
>
> The offense starts here (SQLException:103)
>
> if (!(this instanceof SQLWarning)) {
> if (DriverManager.getLogWriter() != null) {
> printStackTrace(DriverManager.getLogWriter());
> }
> }
>
> And then continues on to (Throwable:509)
>
> synchronized (s) {
> s.println(this);
> StackTraceElement[] trace = getOurStackTrace();
>
>
> It is the "s.println(this)" that is causing errors... All of this is
> happening in the constructor, so I guess that is why 'this' is null?
> I'm not 100% sure and pretty confused by it all :/
> -pete
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Csaba Nagy 2003-07-29 16:40:38 Re: NPE in creating a SQLException
Previous Message Michael Stephenson 2003-07-29 16:27:01 Re: NPE in creating a SQLException