Solved

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

Posted on 2006-06-30
4
318 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 222
java.util.concurrent.Callable way of creating threads 2 110
eclipse luna javeEE perspecive missing 5 112
java operators 3 120
If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 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