• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

an error I cannot figure out

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
We can walk to school together. And we can both read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic