• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internal Servlet Error

 
Wilfred D'Souza
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am new to JSP and would like to know as to how to understand some of the error pages that are put forth on the webpage by the server.
For example I am working on this page and i get this error :
Error: 500
Location: /eshop/wizard/rep200.jsp
Internal Servlet Error:
javax.servlet.ServletException: String index out of range: -10
at javax.servlet.ServletException.(ServletException.java:161)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
at wizard._0002fwizard_0002frep_00032_00030_00030_0002ejsprep200_jsp_0._jspService(_0002fwizard_0002frep_00032_00030_00030_0002ejsprep200_jsp_0.java(Compiled Code))
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java(Compiled Code))
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:481)
Root cause:
java.lang.StringIndexOutOfBoundsException: String index out of range: -10
at java.lang.RuntimeException.(RuntimeException.java:49)
at java.lang.IndexOutOfBoundsException.(IndexOutOfBoundsException.java:46)
at java.lang.StringIndexOutOfBoundsException.(StringIndexOutOfBoundsException.java:59)
at java.lang.String.substring(String.java(Compiled Code))
at wizard._0002fwizard_0002frep_00032_00030_00030_0002ejsprep200_jsp_0._jspService(_0002fwizard_0002frep_00032_00030_00030_0002ejsprep200_jsp_0.java(Compiled Code))
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java(Compiled Code))
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:481)

How to understand as to what is to be corrected and where to find it.
Ur help is greatly appreciated.
Thanx
Wilfred
 
Gert Cuppens
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each Java Server Page is translated to a servlet. So each JSP will have a corresponding .java file.
In my case, (working with Tomcat) those translated servlets can be found at C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\brukkerlin
In your error message you can find the name of the translated servlet (rep200_jsp.java). Unfortunately, the error message doesn't add the line in the rep200_jsp.java where it goes wrong. I'm so lucky that Tomcat mostly adds the line no from the translated servlet where he encountered the problem.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic