Solved

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

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Google always has something new and amazing up its sleeve, and the most current thing that they have been working on is another step in the evolution of Google Search, from machine learning to its brilliant successor, deep learning.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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