Error in servlet

From: Andreas Tille <tillea(at)rki(dot)de>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Error in servlet
Date: 2000-09-14 15:20:54
Message-ID: Pine.LNX.4.21.0009141702270.546-100000@wr-linux02.rki.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

is there any known reason for the following behaviour:

I wrote a servlet with several database accesses via stored functions
and select statements. On a certain point of my servlet I get
the following:

[14/09/2000 16:31:51:216 CEST] Runtime.log: org(dot)postgresql(dot)jdbc1(dot)ResultSet(at)80ab4ff
[14/09/2000 16:31:51:217 CEST] java.lang.NullPointerException:
at org.postgresql.jdbc1.ResultSet.getString(ResultSet.java)
at WebSQL.pGetGroupMemberByLocation(WebSQL.java:484)
at Web.DoWeb(Web.java:272)
at ehec.service(ehec.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:311)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
at org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java)

I try to give a short description of the critical function in WebSQL.java:484

----- snip ----

public boolean pGetGroupMemberByLocation(Webdata data, int IdStandort,
String S_IdArbeitsgruppe, String S_IdMitarbeiter)
{
try {
query = "SELECT * FROM Mitarbeiter; " ;
query = "SELECT count(*) As FName FROM standort; " ;

query = "SELECT '<td class=\"MenuMain\"><a class=\"MenuMain\" href=\"' || '" +
project.GetServletName() + "' || '?" + "mid" +
"=' || i.IdMenuShow || '&" + "tid" +
"=' || i.IdWebSeite || '\">' || i.MenuItem || '</a></td>' " +
"AS getmenu FROM Menu m " +
"INNER JOIN MenuItem i ON i.IdMenu = m.IdMenu WHERE m.IdMenu = " + "54" +
" ORDER BY i.Sort ; " ;
rs = stmt.executeQuery(query);

if ( rs == null ) error.Common("Write message to logfile");
else error.Common("rs = " + rs); // This is the entry in Runtime.log
query = rs.getString(1);
error.Common("Are you living?");

---- snip ----

I tried different querys (see the strings "query"). First I reduced to
simple ones, later I used a more complex which worked inside the same
servlet some statements before and worked. They show all the same
behaviour to fail with the NullPointerException.

I'm using PostgreSQL 7.0.2, Apache, Jserv.
The behaviour is the same using

http://www.retep.org.uk/postgres/jdbc7.0-1.1.jar
http://www.retep.org.uk/postgres/jdbc7.0-1.2.jar

as JDBC driver.

I'm really in desperation with this stupid problem and tried
two days to solve it but failed. Any idea what might went wrong
here. It is a problems of threads od anything else. I can't see
any pointer which could be null here.

Really hoping for your help

Andreas.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hernan 2000-09-14 15:23:28 testing...(ignore)
Previous Message Bryan Field-Elliot 2000-09-14 15:13:16 Show triggers in psql?