Re: NPE in creating a SQLException

Поиск
Список
Период
Сортировка
От Scot P. Floess
Тема Re: NPE in creating a SQLException
Дата
Msg-id 1348225.1059491878425.JavaMail.nobody@wamui01.slb.atl.earthlink.net
обсуждение исходный текст
Ответ на NPE in creating a SQLException  (Peter Royal <proyal@pace2020.com>)
Ответы Re: NPE in creating a SQLException  (Peter Royal <proyal@pace2020.com>)
Список pgsql-jdbc
Peter

Can you send more code?  Is "s" initialized in your synchronized block?  You might print s before the synchronized
blockto verify...  It could be your null pointer is there... 

Scot
-------Original Message-------
From: Peter Royal <proyal@pace2020.com>
Sent: 07/29/03 10:01 AM
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] NPE in creating a SQLException

>
> 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
>

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

Предыдущее
От: Fernando Nasser
Дата:
Сообщение: Re: Problem with LargeObject/jdbc when writing short (Repost)
Следующее
От: Peter Royal
Дата:
Сообщение: Re: NPE in creating a SQLException