Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7775725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:42:12+00:00 2026-06-01T17:42:12+00:00

Hi my code is generating an arrayoutofbound exception which is caught in the code

  • 0

Hi my code is generating an arrayoutofbound exception which is caught in the code but code terminates abruptly.I want the code to continue. Should an arrayoutofboundexception be caught by Exception or am i doing something wrong, please help catching the error .Exception is expected.Below is the code:-

try{
    CsgLogin=Ldap.getdomain(requesterLoginId);//This returns domain\usernmae
    LoginIDArray = CsgLogin.split("\\\\");
    requesterLoginId = LoginIDArray[1]; //Exception generated here

} catch(Exception e) {
    System.out.println("Error in the GLDAP lookup or error in Domain Mapping");
    e.printStackTrace();
}

output:

java.lang.ArrayIndexOutOfBoundsException: 1
        at com.cs.ws.LdapConnect.getdomain(LdapConnect.java:131)
        at com.cs.ws.AgentConnector.startOfBreakGlass(AgentConnector.java:476)
        at com.cs.ws.AgentConnector.runBreakGlassProcess(AgentConnector.java:208)
        at com.cs.ws.MyAccessTimer.main(MyAccessTimer.java:93)
Error in the GLDAP lookup or error in Domain Mapping
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1768)
        at com.cs.ws.DomainMap.getDomain(DomainMap.java:21)
        at com.cs.ws.AgentConnector.startOfBreakGlass(AgentConnector.java:477)
        at com.cs.ws.AgentConnector.runBreakGlassProcess(AgentConnector.java:208)
        at com.cs.ws.MyAccessTimer.main(MyAccessTimer.java:93)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:42:13+00:00Added an answer on June 1, 2026 at 5:42 pm

    The ArrayIndexOutOfBoundsException is being caught: you can tell by the fact that your message Error in the GLDAP lookup or error in Domain Mapping is printed. The first block that you are seeing is just what printStackTrace() produces.

    The two aren’t in order because one is printing to the standard output stream and the other is printing to the standard error stream.

    The exception that is uncaught is the StringIndexOutOfBoundsException that is printed under your message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written java code for generating json of my searched data from file.But
I found code for generating Sierpinski carpet at http://rosettacode.org/wiki/Sierpinski_carpet#Scheme - but it won't run
I have a website which is code generating practically everything on the page. The
Ideally I want to be using the CreateObject delegate because the code generating these
I'm generating code dynamically, currently using String.Format and embedding placeholders - but reformatting the
I found some Java code for generating combinations on, but I can't understand what
I have ASP.Net code generating my button's HTML for me using divs to get
I have a code generating a timespan to calculate a duration of some action.
The following code is generating an error on the variable con2 saying non-static variable
The following code is generating warning C6284 when compiled with /analyze on MSVC 2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.