java.lang.NullPointerException msg after upgrade

From: Olivier BULLAT <Olivier(dot)Bullat(at)ifma(dot)fr>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: java.lang.NullPointerException msg after upgrade
Date: 2003-05-15 07:18:59
Message-ID: 5.0.2.1.2.20030515091316.018b9b88@mail.ifma.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

<html>
Hello,<br>
<br>
With some programs which are OK, we upgrade our version of soft:<br>
Now, we use Apache, Posgresql 7.2, servlet java (JDK 1.2), Jserv and
jdbc7.2dev-1.2.jar.<br>
<br>
Log gives a message &quot;java.lang.NullPointerException&quot; on
instruction <br>
con = DriverManager.getConnection(jdbc:postgresql://127.0.0.1:5432/menu,
session.getValue(&quot;nom&quot;) + &quot;&quot;,
session.getValue(&quot;passe&quot;) + &quot;&quot;)<br>
<br>
The name of JDBC Driver has been changed in java source (msg
ClassNotFound):<br>
before: Class.forName(&quot;postgresql.Driver&quot;);<br>
now: Class.forName(&quot;org.postgresql.Driver&quot;);<br>
<br>
Example:<br>
try {<br>
<br>
System.err.println(&quot;ChoixRecherche.java: Avant ouverture
driver&quot;);<br>
try {<br>
// Modif OBULLAT 13/05/03<br>
// Class.forName(&quot;postgresql.Driver&quot;);<br>
Class.forName(&quot;org.postgresql.Driver&quot;); //on charge le driver
postgresql<br>
} catch (ClassNotFoundException cnfe) {<br>
System.err.println(&quot;Programme ChoixRecherche.java: Couldn't find
driver class:&quot;);<br>
cnfe.printStackTrace();<br>
}<br>
<br>
System.err.println(&quot;ChoixRecherche.java: Aprés ouverture
driver&quot;);<br>
System.err.println(&quot;Programme ChoixRecherche.java:
variables_menu.url_base &quot; + variables_menu.url_base);<br>
con =
DriverManager.getConnection(variables_trombi.url_base,session.getValue(&quot;nom&quot;)+&quot;&quot;,session.getValue(&quot;passe&quot;)+&quot;&quot;);<br>
System.err.println(&quot;ChoixRecherche.java: Aprés con =
DriverManager.getConnection&quot;);<br>
stmt = con.createStatement();<br>
System.err.println(&quot;ChoixRecherche.java: Aprés stmt =
con.createStatement()&quot;);<br>
choix(stmt, out);<br>
System.err.println(&quot;ChoixRecherche.java: Aprés
choix(stmt,out)&quot;);<br>
stmt.close();<br>
con.close();<br>
}<br>
catch (SQLException ex) {<br>
while (ex != null) {<br>
out.println(&quot;&lt;SQLEXCEPTION&gt; &quot;+ ex);<br>
System.err.println(&quot;Programme ChoixRecherche.java: SQLEXCEPTION
&quot;+ ex);<br>
ex = ex.getNextException();<br>
}<br>
}<br>
catch (java.lang.Exception ex) {<br>
ex.printStackTrace();<br>
out.println(&quot;&lt;JAVALANGEXEPTION&gt;&quot;+ ex);<br>
System.err.println(&quot;ChoixRecherche.java: JAVALANGEXCEPTION &quot;+
ex);<br>
}<br>
}<br>
<br>
<br>
log are:<br>
<br>
ChoixRecherche.java: Avant ouverture driver<br>
ChoixRecherche.java: Aprés ouverture driver<br>
Programme ChoixRecherche.java: variables_menu.url_base
jdbc:postgresql://127.0.0.1:7654/menu<br>
java.lang.NullPointerException: <br>
at ChoixRecherche.service(ChoixRecherche.java:40)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)<br>
at
org.apache.jservssi.ServletInfoRequest.runServlet(JServSSI.java:917)<br>
at org.apache.jservssi.JServSSI.interpretPage(JServSSI.java:366)<br>
at org.apache.jservssi.JServSSI.doGet(JServSSI.java:302)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:499)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)<br>
at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)<br>
at org.apache.jserv.JServConnection.run(JServConnection.java:188)<br>
at java.lang.Thread.run(Thread.java:479)<br>
ChoixRecherche.java: JAVALANGEXCEPTION java.lang.NullPointerException:
<br>
<br>
Any idea ?<br>
<br>
--------------------------------------------------------------------------<br>
Olivier BULLAT<br>
Responsable du Centre de Ressources Informatiques<br>
Institut Francais de Mecanique Avancee - IFMA<br>
Campus de CLERMONT-FERRAND / Les Cezeaux<br>
BP 265<br>
63175 AUBIERE Cedex<br>
Tel: 04.73.28.80.35<br>
Fax: 04.73.28.81.00<br>
mail: <font color="#0000FF"><u>Olivier(dot)Bullat(at)ifma(dot)fr<br>
<a href="http://www.ifma.fr/" eudora="autourl">http://www.ifma.fr</a><br>
</u></font>--------------------------------------------------------------------------
<br>
</html>

Attachment Content-Type Size
unknown_filename text/html 3.8 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nick Fankhauser 2003-05-15 14:07:21 Re: java.lang.NullPointerException msg after upgrade
Previous Message Randall Lucas 2003-05-14 15:43:41 Re: [SQL] insert problem with special characters