Hi, I'm working on a JSP page and keep getting this error: Internal error: exception thrown from the servlet service function (uri=/test/kevin/news/index.jsp): javax.servlet.ServletException, stack: javax.servlet.ServletException There is some more to the error, but it is unimportant. What is there that I could do to solve this problem, or is there anyone that could guide me in the direction of solving the problem. TIA. Kevin
chanoch wiggers
Author
Ranch Hand
Joined: May 24, 2001
Posts: 245
posted
0
can you please send the "unimportant error". Thats the bit that tells you what really went wrong. The first bit is a stack trace of the servlet container, the second bit is the stack trace of your application.
chanoch<p><a href="http://www.amazon.com/exec/obidos/ASIN/1861007736/" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
kevin schmidt
Ranch Hand
Joined: Aug 24, 2001
Posts: 85
posted
0
[07/Sep/2001:09:27:28] failure (18520): Internal error: exception thrown from the servlet service function (uri=/test/kevin/news/index.jsp): javax.servlet.ServletException, stack: javax.servlet.ServletException at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) at javax.servlet.ServletException.(Compiled Code) at org.apache.jasper.runtime.PageContextImpl.handlePageException(Compiled Code) at _jsps._test._kevin._n_00025ws._index_jsp._jspService(Compiled Code) at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.netscape.server.http.servlet.NSServletRunner.Service(Compiled Code) , root cause: java.lang.NullPointerException at _jsps._test._kevin._n_00025ws._index_jsp._jspService(Compiled Code) at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.netscape.server.http.servlet.NSServletRunner.Service(Compiled Code) I hope this helps Oh, this is also run on iPlanet 4.1 Web Server. Kevin [This message has been edited by kevin schmidt (edited September 07, 2001).]
PC RE
Greenhorn
Joined: Aug 28, 2001
Posts: 29
posted
0
some of ur code can really really help....can u put it here
kevin schmidt
Ranch Hand
Joined: Aug 24, 2001
Posts: 85
posted
0
Here is a the code that creates the error: if(request.getParameter("sort").equals("Date")) %> <%@ include file="display_sort.jsp" %> <% out.println("</td></tr>"); out.println("<tr><td>"); } else { %> <%@ include file="display_news.jsp" %> <% out.println("</td></tr>"); out.println("<tr><td>"); } %> The page crashes somewhere in this code, I'm not sure why.
the clue is in the stack trace. "root cause: java.lang.NullPointerException"
If for whatever reason, your request does not contain a parameter called 'sort', then trying to perform an equals(String) function on a null will throw the nullpointer exception.
It should read: [This message has been edited by Mike Curwen (edited September 10, 2001).]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.