Solved

How to fix this error: The server encountered an internal error ()

Posted on 2006-06-30
4
315 Views
Last Modified: 2010-04-01
I get this when I try to go to this servlet

http://localhost:8080/chapters/pub?action=show_policy

Any idea what this error is about. Any help will be greatly appreciated

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1444)
      at java.lang.String.substring(String.java:1411)
      at com.ccim.servlet.PublicServlet.processRequest(PublicServlet.java:53)
      at com.ccim.servlet.PublicServlet.doGet(PublicServlet.java:29)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:534)
0
Comment
Question by:huzefaq
4 Comments
 
LVL 27

Expert Comment

by:rrz
ID: 17021682
>at com.ccim.servlet.PublicServlet.doGet(PublicServlet.java:29)  
Show us  line 29 of  PublicServlet.  Are you looking for a character in a String that isn't there ? Or are you in a loop ? If you are in a loop, then show us the whole loop.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 17029429
>>com.ccim.servlet.PublicServlet.doGet(PublicServlet.java:29)  
At this place he is calling the method processRequest which is getting the error...

>>com.ccim.servlet.PublicServlet.processRequest(PublicServlet.java:53) i.e. we need to look at the line 53 of processRequest.. most probably you are trying to do a substring of a string which is not there or is not long enough...
Show us the code & we will be in a better situation to hep


0
 
LVL 11

Expert Comment

by:Isisagate
ID: 17036630
in at com.ccim.servlet.PublicServlet.processRequest(PublicServlet.java:53)

there is a substring functin being called on a string that is empty or your substring is starting looks something like substring(-1,1) or something and that's making the page throw up.  Check to make sure the string is not empty before doing your substring or has at least the expected amount of characters.
0
 
LVL 5

Accepted Solution

by:
muktajindal earned 500 total points
ID: 17072056
Most probably you are trying to do some string manipulation by passing some boundary values out of its range.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

A Short Story about the Best File Recovery Software – Acronis True Image 2017
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now