Looks like the first time the servlet is invoked it works OK.
Subsequent invocations mess up the connection (never
worked on mysql but I'd close and reopen the connection
or better use a connection pooling package, maybe stmt
isn't being closed).
When you open via the address bar I suspect you get the
cached HTML produced the first time.

Marco

----- Original Message -----
From: andrew tollin
To: [EMAIL PROTECTED]
Sent: Tuesday, July 31, 2001 10:14 PM
Subject: Refresh servlet page problem



Hello

I have a problem with my servlets. I have created a number of servlets that
connect to a database, access a particular table, and insert the database
information into skeletal HTML. When I view my page on Tomcat port
8090(changed from port 8080 due to DB probs) by entering
http://localhost:8090/servlet/UsefulAddresses for example, it loads with no
errors. However when I refresh the page I get this error:

Error: 500: Location: /servlet/UsefulAddresses: Internal Servlet Error:
: java.lang.NullPointerException
 at org.gjt.mm.mysql.Statement.executeQuery(Statement.java)
 at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78)
 at UsefulAddresses.doGet(UsefulAddresses.java:50)

If i enter the servlet URL in the address bar again press return it returns
to the error free page! Every time I refresh this page or any other of my
servlets I get this error. Could anyone please tell me why this is. My
servlet code is the next email.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to