*
The moose likes JSP and the fly likes Internal Servlet Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Internal Servlet Error" Watch "Internal Servlet Error" New topic
Author

Internal Servlet Error

Wilfred D'Souza
Greenhorn

Joined: Mar 09, 2004
Posts: 8
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


Best regards<br />Wilfred D'Souza
Gert Cuppens
Ranch Hand

Joined: Jul 13, 2003
Posts: 87
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.
 
subject: Internal Servlet Error
 
Similar Threads
newbie - problems with bean
Cannot view Tomcat/JSP example source
HELP!!!
Java Bean in JSP
Apache Tomcat Errors???