Well, take a look at your stack trace. It shows you that a
NullPointerException occured at line 17 of "querry.java".
Now, if you look at the java api docs in:
http://java.sun.com/products/jdk/1.2/docs/api/index.html
and lookup NullPointerException. There you will find information on why the
exception may occur. It includes the following:
- Calling the instance method of a null object.
- Accessing or modifying the field of a null object.
- Taking the length of null as if it were an array.
- Accessing or modifying the slots of null as if it were an array.
- Throwing null as if it were a Throwable value.
What that tells you is to check the values of your String object. Are they
null? If you try to access a method of a null object you will get the
exception.
To make a long story short, you are calling the equals method on a null
string object. Make sure they're non-null before doing the call. That should
fix der Programmierfehler.
Justy
----- Original Message -----
From: "Haering Christian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 21, 2001 5:14 AM
Subject: tomcat error 500
> hi everybody
>
> could anybody point me, y i'm getting this error?
>
> Error: 500 Location: /servlet/IfI.querryInternal
> Servlet Error:java.lang.NullPointerException
> at IfI.querry.init(querry.java:17)
> at javax.servlet.GenericServlet.init(GenericServlet.java:258)
> at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
> at org.apache.tomcat.core.Handler.init(Handler.java:215)
> at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
> at org.apache.tomcat.core.Handler.service(Handler.java:254)
> at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> at
>
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7)
> at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
>
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:210)
> at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> at java.lang.Thread.run(Thread.java:484)
>
> here is the code:
> package IfI;
>
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.util.*;
>
> public class querry extends HttpServlet {
> private static final String CONTENT_TYPE = "text/html";
> /**Globale Variablen initialisieren*/
> public void init() throws ServletException {
> super.init();
> String sDB_URL = getInitParameter("url");
> String sDB_DRIVER = getInitParameter("driver");
> String sDB_USER = getInitParameter("user");
> String sDB_PWD = getInitParameter("pwd");
> if
>
((sDB_URL.equals(""))||(sDB_DRIVER.equals(""))||(sDB_USER.equals(""))||(sDB_
> PWD.equals("")))
> {
> System.err.println("keine Datenbankparameter gefunden, kann
> Datenbankverbindung nicht aufbauen");
> }
> }
> /**Die HTTP-Anforderung Post bearbeiten*/
> public void doPost(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException {
> String sLieferantenNummer = request.getParameter("lieferantenNummer");
> String sLieferantenName = request.getParameter("lieferantenName");
> String sEwaNummer = request.getParameter("ewaNummer");
> String sBezeichnung = request.getParameter("bezeichnung");
> String sLieferantBestellNummer =
> request.getParameter("lieferantBestellNummer");
> String sEinsatzOrt = request.getParameter("einsatzOrt");
> if ((sLieferantenNummer.equals(""))&&(sLieferantenName.equals(""))
> &&(sEwaNummer.equals(""))&&(sBezeichnung.equals(""))
> &&(sLieferantBestellNummer.equals(""))&&(sEinsatzOrt.equals("")))
> {
> gotoPage("querry.jsp", request, response);
> }
> }
> private void gotoPage(String address, HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException
> {
> RequestDispatcher dispatcher =
> getServletContext().getRequestDispatcher(address);
> dispatcher.forward(request, response);
> }
> /**Ressourcen bereinigen*/
> public void destroy() {
> }
> }
>
> _______________________________
> Christian H�ring
> Siemens AG
> A&D AS OIL B16
> Werner von Siemens Str. 50
> 92224 Amberg
> mailto:[EMAIL PROTECTED]
> Tel: +49 9621 80 3127
> Fax: +49 9621 80 2274
>
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name
http://www.jguru.com/jguru/faq/faqpage.jsp?name
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets