Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

an error I cannot figure out

 
kevin schmidt
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
kevin schmidt
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
some of ur code can really really help....can u put it here
 
kevin schmidt
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic