While loop brings out of bounds error

I cannot see why this while loop is bring the out of bounds errror in my program please let me know how to correct it
thanx
import java.util.Scanner;
public class UniqueNumbers
     public int count3 = 0;
     public int count2 = 0;
     public int count = 0;
public int number = 0;
// public int ifnumber;
public int arrayBuild()
     int numbers[]; // declare array named array
     numbers = new int[ 5 ]; // create the space for array
Scanner input = new Scanner(System.in);
//System.out.println("Enter a number between 10 and 100.");
//int ifnumber = input.nextInt();
while (count3 <=numbers.length)
System.out.println("Enter a number between 10 and 100.");
int ifnumber = input.nextInt();
          if (ifnumber >= 10 || ifnumber <= 100)
          numbers[count] = ifnumber;
               count++;
               count3++;
if (ifnumber < 10 || ifnumber > 100)
System.out.println("Number is out of range.");
          continue;
//for(count2 = 0; count2 < numbers.length; count2++)
// if(numbers[count] != ifnumber)
// System.out.printf("%d\n",ifnumber);
}//end while loop
return numbers[count];
}//end arrayBuild
public void displayMessage()
     //display number inputted by user
          System.out.printf("The number you entered is: %d \n", getNumbers() );
}//end displayMessage
public int getNumbers( )
     number = arrayBuild();
     return number;
}//end getNumbers
}

Do this instead:
while (count3 <numbers.length)

Similar Messages

  • ArrayIndex out of bounds error.

    I'm using a while loop to perpetuate a for loop with the aim of changing each element of an array starting at different points. This is the piece getting the error.
    java.lang.ArrayIndexOutOfBoundsException: 101
    while (rwPlace < periods) {
         for(j=0; j<timeLine.length; j++) {
              if ((place == 0) || (place < startTimes[rwPlace])) {
                   place++;
              } else {
                   timeLine[place] = timeLine[place-1] + rates[rwPlace];
                   place++;
                   rwPlace++;
    }I'm getting an out of bounds error at the "timeLine[place] = timeLine[place-1] + rates[rwPlace];" line.
    *The array has 101 elements (0-100).
    *place and rwPlace both start with a value of 0.
    *The loop works when "periods" has a value of 0 or 1.  2 or more and I get the error.  (Also, rates[] has the appropriate number of elements depending on the value of "periods"...atleast it should.
    Edited by: Time_Guy on Jun 19, 2009 11:03 PM

    Which array is giving rise to the ArrayIndexOutOfBoundsException?
    The typical message from an AIOOBE is "java.lang.ArrayIndexOutOfBoundsException: 10" which tells you about the bad index value, but not the array. If you are unsure which array is being used with an invalid index, print the values of rwPlace and place each time around the while and for loops.
    Then when you know which array it is you can decide whether (1) You did not make the array big enough in the first place or (2) You are accessing it with an index value that is not what you intend.
    It might be a good idea to construct a SSCCE: something that others can actually compile and run, that illustrates the AIOOBE.

  • Out of bounds error

    i'm trying to get this code to count down from 60 to 40 and then from 100 to 90.
    i attempted to make an empty array, put the appropriate numbers in the array and then put the numbers from the array into an empty string.
    but i get an out of bounds error. what do i need to change?
    thanks
    class CounterSS
         public static void main(String[] args)
         System.out.println(counter (60, 40, 2) );
         //count down from 60 to 40 in twos.
         System.out.println(counter (100, 90, 1) );
         //count down from 100 to 90 in ones.
         public static String counter(int z, int x, int c)
         String countnums = "";
         if(z > x) {
         int s = z - x;
         int[] count = new int[s]; //create an empty array
         int k = 0;
         while(k < count.length) {
         k++;
         count[k] = z;
         z = z -c;
         for(int r = 0; r< count.length; r++)
         countnums = countnums + count[r];
         return countnums;
    }java.lang.ArrayIndexOutOfBoundsException: 20
    at CounterSS.counter(CounterSS.java:32)
    at CounterSS.main(CounterSS.java:8)
    Exception in thread "main"
    **** JDK Commander: E n d o f j a v a e x e c u t i o n ****

    i suppose i should know this but when counting downwards, all lines miss the last number.
    for example, the first line counts down to 42 and not 40.
    is the problem with the while or for loop? or maybe both?
    class Counter
         public static void main(String[] args)
         System.out.println(counter (60, 40, 2) );
         //count down from 60 to 40 in twos.
         System.out.println(counter (100, 90, 1) );
         //count down from 100 to 90 in ones.
         System.out.println(counter (100, 80, 10) );
         //count down from 100 t0 80 in tens.
         public static String counter(int z, int x, int c)
         String countnums = "";
         if(z > x) {
         int s = z - x; s = s / c;
         int[] count = new int[s]; //create an empty array
         int k = 0;
         while (k < count.length) {
         count[k] = z;
         z = z -c;
         k++;
         for(int r = 0; r< count.length; r++)
         countnums = countnums + count[r]+" ";
         return countnums;
    }60 58 56 54 52 50 48 46 44 42
    100 99 98 97 96 95 94 93 92 91
    100 90
    **** JDK Commander: E n d o f j a v a e x e c u t i o n ****

  • Array out of bound error

    Hi everybody , I'm trying to print out the value of an array using the following code
    import java.text.*;
    public class Part1
    public static void main(String[] args)
    int i;
    int count = 0;
    DecimalFormat df = new DecimalFormat("0.00");
    double[] result = new double[5];
    double[] above = new double[5];
    for (i=0;i<=result.length; i++)
    result[i] = (3*Math.exp(-0.7*i)*Math.cos(4*i));
    System.out.print(df.format(result)+ " ");
    if (result[i] >0)
    count = count + 1 ;
    above[i]= result[i] ;
    System.out.println(" ");
    System.out.println("The number of results above zero is " +count);
    System.out.println("These number are " +above[i]);
    I'm supposed to print out all values, then print out the value which are positive again, and count the number of positive numbers.
    But when I try to run it, I get a out of bound error.
    Can you help me with this.
    Thanks in advance,
    Roy

    When the loop is finished, the value of i is 5.
    And you use it in
    System.out.println("These number are " +above);to access above[5] generate the ArrayIndexOutOfBoundsException.                                                                                                                                                                                                                                                                                                                                                                                               

  • How to avoid  specified is out of bounds error in flex 4 mxml web application

    how to avoid  specified is out of bounds error in flex 4 mxml web application
    hi raghs,
    i  want to add records in cloud.bt while adding the records if we enter  existing record details and try to save again na it wont allow to that  record.
    that time the alert box  should show this msg "This record is already existing record in cloud database.
    ex:  one company name called mobile. i am adding a employee name called raja  now i save this record,its data saved in     cloud DTO
      again try to add same employee name raja under the same compny means it should through error.
    I am give my code here please if any suggession tel.
    CODE:
    private function saveRecord():void
                refreshRecords();
                model.employeeDetailsReq=new EMPLOYEEDETAILS_DTO();
                    var lengthindex:uint=model.employeeDetailsReqRecordsList.length;
                    var i:int;
                    for (i = 0; i < lengthindex; i++)
                    if((model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employ ee name==customerdet.selectedItem.employeename)&&
                          (model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employeeN    umber==customerdet.selectedItem.employeeID)){
                        Alert.show("you cannot Add Same CustomerName and Invoiceno again");
    (when this line come the error through like this: Index '8' specified is out of bounds.
    else
    var dp:Object=employeedet.dataProvider;           
    var cursor:IViewCursor=dp.createCursor();
    var employeename:String = employeename.text;
             model.employeeDetailsReq.employename = employeename;
    model.employeeDetailsReq.employeeNumber=cursor.current.employeeID;
    var sendRecordToLocID:QuickBaseEventStoreRecord = new
                        QuickBaseEventStoreRecord(model.employeeDetailsReq, new
                            KingussieEventCallBack(refreshList))
                    sendRecordToLocID.dispatch();
    <mx:Button   id="btnAdd" x="33" y="419" enabled="false" label="Add" width="65"   fontFamily="Georgia" fontSize="12" click="saveRecord()"/>
    employeename and employeeID are datafields of datagrid. datagrid id=customerdet
    employeeDetailsReqRecordsList---recordlist of save records
    Thanks,
    B.venkatesan

    I do not know for sure as to how to do this, but I found this on Adobe Cookbook
    http://cookbooks.adobe.com/post_Import_Export_data_in_out_of_a_Datagrid_in_Flex-17223.html
    http://code.google.com/p/as3xls/
    http://stackoverflow.com/questions/1660172/how-to-export-a-datagrid-to-excel-file-in-flex
    http://wiredwizard.blogspot.com/2009/04/nice-flex-export-to-excel-actionscript.html
    This has a demo that works
    http://code.google.com/p/flexspreadsheet/

  • Null out of bounds error in single array

    I have created this program but I am getting a null out of bounds error. What have I done wrong?I would appreciate your expert opinions. I have commented the error points.
    import javax.swing.JOptionPane;
    import java.text.NumberFormat; //Imports class for currency formating
    public class VillageDataSort {
    //Data fields
    private HouseHolds[] Village;
    private double totIncome;
    private double avgAnulIncm;
    private double povertyLvl;
    //Method to create memory allocations for Village array
    public void HouseholdData(){
    Village = new HouseHolds[13];
    int index = 0;
    for(index = 0; index < Village.length; index++);
    Village[index] = new HouseHolds(); //Error point
    Village[index].dataInput(); //Error point
    //Calculates the average annual income
    public double avgIncome(){
    totIncome = 0;
    int index = 0;
    for(index = 0; index < Village.length; index++);
    totIncome += Village[index].getAnnualIncome();
    avgAnulIncm = totIncome / Village.length;
    return avgAnulIncm;
    //Displays households with above average income
    public void displayAboveAvgIncome(){
    int index = 0;
    for(index = 0; index < Village.length; index++);
    if (Village[index].getAnnualIncome() >= avgIncome())
    System.out.println("Households that are above the average income : " + avgIncome());
    System.out.println("Household ID " + "\t" + "Annual Income " + "\t" + "Household Members");
    System.out.println(Village[index].getIdNum() + "\t" + Village[index].getAnnualIncome() + "\t" + Village[index].getFamilyMems());
    //Calculates and displays the households that fall below the poverty line
    public void povertyLevel(){
    int index = 0;
    povertyLvl = 0;
    for(index = 0; index < Village.length; index++);
    povertyLvl = 6500 + 750 * (Village[index].getFamilyMems() - 2);
    if (Village[index].getAnnualIncome() < povertyLvl)
    System.out.println("Households that are below the poverty line");
    System.out.println("Household ID " + "\t" + "Annual Income " + "\t" + "Household Members");
    System.out.println(Village[index].getIdNum() + "\t" + Village[index].getAnnualIncome() + "\t" + Village[index].getFamilyMems());
    }

    Thanks again scsi, I see where it gets together. I
    even found the Class interface error started in the
    previous method to calculate the average. The program
    compiled but it outputted nothing just a bunch of
    zero's. I know I haven't referenced correctly yet
    again why does it not grab the data.I changed the
    array to 4 numbers for testing purposesis this a question or a statement?
    well there are problems in you HouseHolds class.
    import javax.swing.JOptionPane;
    public class HouseHolds{
    // Data
    private int idNum;
    private double anlIncm;
    private int famMems;
    //This method gets the data from the user
    public void dataInput(){
    // if you are trying to set the int idNum here you are not doing this.
    String idNum =
    JOptionPane.showInputDialog("Enter a 4 digit household ID number");
    // same with this
    String anlIncm =
    JOptionPane.showInputDialog("Enter the households annual income");
    // and also this one.
    String famMems =
    JOptionPane.showInputDialog("Enter the members of the family");
    } as a service to you look at these two API links.
    http://java.sun.com/j2se/1.3/docs/api/java/lang/Integer.html
    and
    http://java.sun.com/j2se/1.3/docs/api/java/lang/Double.html
    now here is the revised code for one of your variable settings.
    you will have to do the rest on your own.
    String idString = JOptionPane.showInputDialog("Enter a 4 digit household ID number");
    idNum = Integer.parseInt(idString);

  • Out of bounds error with an array.

    Dear all,
    java.lang.ArrayIndexOutOfBoundsException: 1
    I keep getting this error message when I try and use a for loop to step through an array of which the upper bound is 'count'.
    I feel as if I have tried all permutations of spelling out the possible values of the vertices, using .length etc but all to no avail.
    Here is one bit of code that is getting this error:
    public String toString(){
            int i = 0;
            for (i = 0; i == count; i++);{
                System.out.println (+  vertices.getX() + + vertices[i].getY());
    return "";
    The reason for the return "" is to get rid of another error that used to say no return value.
    I'll happily try any suggestions, I just want to get my program working.
    Thanks
    PS I have read through the recent postings on this but I can't see how they answer my query.

    Thanks for spotting the semi colon in the wrong place it seems to have sorted out that bit, but I've now got another array out of bounds exception 0 on a different bit.
    public double perimeter (){
            double perimeter = 0;
            //int i = 0;
            for ( int i = 0; i < (count -1) ; i++){
            perimeter = perimeter + ( vertices.distance(vertices[i + 1]));
    perimeter = perimeter + ( vertices[0].distance(vertices[count]));
    return perimeter;
    This bit of code is supposed to calculate the perimeter of any polygon. So my algorithm was to start at vertices[0] use the distance method to calculate the distance between that one and the next one all the way up to the last one in the array vertices[count]. And then calculate the distance from the first vertice to the last and add that on to make the total.
    The line that is being spat out is
    perimeter = perimeter + ( vertices.distance(vertices[i + 1]));
    I can't see why.

  • Coordinate out of bound error in getting rgb value of a pixel

    hi
    in my motion detection algorithm i am using BufferedImage.getRGB(pixel) method to get integer pixel value of the rgb color model. I get the series of images from the web cam and create BufferedImage from it. But there is a error saying that coordinate out of bound exception. So please let me know how to over come this problem asap. i mentioned code segment below.
    for (int i = 0; i < objbufimg.getHeight(null) - 1; i++)
    for (int j =0; j < objbufimg.getWidth(null) - 1; j++)
    int rgb = 0;
    try
    rgb = objbufimg.getRGB(i, j);
    catch(Exception ex)
    System.out.println(ex.getMessage());
    if (objmodel != null)
    current[i][j] = (objmodel.getBlue(rgb) + objmodel.getRed(rgb) +
    objmodel.getGreen(rgb)) / 3;
    }

    inputListOfValues(Magnifier LOV where we will be loading thousand of row in search results table).
    If you load and scroll over thousands of VO rows, then the VO will load all these rows in memory if the VO has not been configured to do Range Paging, which may cause out of memory. By default, VOs are not configured to do Range Paging. Please, try with VO Range Paging in order to minimize VO's memory footprint. (When a VO is configured to do Range Paging, it will keep in memory only a couple of ranges of rows. The default range size is 25, so it will keep in memory a few tens of rows). UI does not need to be changed and the user will scroll over the rows in an <af:table> in the normal way as he/she used to.
    Right now Our JDev is configured with a Heap Space of 512MB.
    JDev's heap size does not matter. The heap that you should check (and maybe increase) is the Java heap of the Integrated Weblogic Server, where the application is deployed and run. The heap size of the Integrated WLS is configured in the file <JDev_Home>/jdeveloper/system.xx.xx.xx.xx/DefaultDomain/bin/setDomainEnv.cmd (or .sh).
    Please suggest any tools through which we can track the objects causing the Memory leak.
    You can try Java Mission Control + Flight Recorder (former Oracle JRockit Mission Control), which is an awesome tool.
    Dimitar

  • Oracle Service Bus For loop getting out of memory error

    I have a business service that is based on a JCA adapter to fetch an undertimed amout of records from a database.  I then need to upload those to another system using a webservice designed by an external source.  This web service will only accept upto to x amount of records.
    The process:
    for each object in the Jca Response
          Insert object into Service callout Request body
          if object index = number of objects in jca response or object index = next batch index
               Invoke service callout
               Append service callout Response to a total response object (xquery transform)
               increase next batch index by Batch size
               reset service callout to empty body
           endif
    end for
    replace body  with total response object.
    If I use the data set that only has 5 records  and use a batch size of 2 the process works fine.
    If I use  a data set with 89 records  and a batch size of 2 I get the below out of memory error  after about 10 service callouts
    the quantity of data in the objects is pretty small, less than 1kB for each JCA Object
    Server Name:
    AdminServer
    Log Name:
    ServerLog
    Message:
    Failed to process response message for service ProxyService Sa/Proxy Services/DataSync:
    java.lang.OutOfMemoryError: allocLargeObjectOrArray:
    [C, size 67108880 java.lang.OutOfMemoryError: allocLargeObjectOrArray:
    [C, size 67108880 at org.apache.xmlbeans.impl.store.Saver$TextSaver.resize(Saver.java:1700)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.preEmit(Saver.java:1303) at
    org.apache.xmlbeans.impl.store.Saver$TextSaver.emit(Saver.java:1234)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitXmlns(Saver.java:1003)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitNamespacesHelper(Saver.java:1021)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitElement(Saver.java:972)
    at org.apache.xmlbeans.impl.store.Saver.processElement(Saver.java:476)
    at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:307)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.saveToString(Saver.java:1864)
    at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546)
    at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1500)
    at com.bea.wli.sb.test.service.ServiceTracer.getXmlData(ServiceTracer.java:968)
    at com.bea.wli.sb.test.service.ServiceTracer.addDataType(ServiceTracer.java:944)
    at com.bea.wli.sb.test.service.ServiceTracer.addDataType(ServiceTracer.java:924)
    at com.bea.wli.sb.test.service.ServiceTracer.addContextChanges(ServiceTracer.java:814)
    at com.bea.wli.sb.test.service.ServiceTracer.traceExit(ServiceTracer.java:398)
    at com.bea.wli.sb.pipeline.debug.DebuggerTracingStep.traceExit(DebuggerTracingStep.java:156)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.exitComponent(PipelineContextImpl.java:1292)
    at com.bea.wli.sb.pipeline.MessageProcessor.finishProcessing(MessageProcessor.java:371)
    at com.bea.wli.sb.pipeline.RouterCallback.onReceiveResponse(RouterCallback.java:108)
    at com.bea.wli.sb.pipeline.RouterCallback.run(RouterCallback.java:183)
    at weblogic.work.ContextWrap.run(ContextWrap.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Subsystem:
    OSB Kernel
    Message ID:
    BEA-382005
    It appears to be the service callout that is the problem (it calls another OSB service that logins and performs the data upload to the External service)  because If I change the batch size up to 100  the loop will load all the 89 records into the callout request and execute it fine.  If I have a small batch size then I run out of memory.
    Is there some settings I need to change?  Is there a better way in OSB (less memory intensive than service callout in a for loop)?
    Thanks.

    hi,
    Could you please let me know if you get rid off this issue as we are also facing the same issue.
    Thanks,
    SV

  • Array Index out of bounds error when rendering graph

    Hello,
    OBIEE 11.1.1.5 running on RHEL version 5.7
    I'm encountering a strange problem with graph rendering. I have a graph and a table that are tied to a list of values. The graph renders correctly for many of the values in the list, but for certain values the graph does not render while the table does. What is even more odd is that the graph renders correctly using BI mobile on an iPad for all values in the LOV.
    From the Weblogic fusion bipublisher.log, I see this log entry immediately after getting the rendering error:
    Message:     java.lang.ArrayIndexOutOfBoundsException: 124
    The above log entry is followed about a minute later with this:
    Message ID: ADF_FACES-60099
    Component: AdminServer
    Module: oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer
    Message: The region component with id: emTemplate:fmwRegion has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.
    Any ideas on how to fix this?

    Hi Ray,
    I cannot find an array.  The only one I see is ResultList.  This one seems to be in all Test Stand sequences.  I am not sure exactly how it's used.
    I have pulled the sub-sequence out of the main sequence and made a new main sequence with all of the same variables.
    Look at it and let me know what you think.
    Thanks
    Attachments:
    Excel - Set Cell Color.seq ‏59 KB

  • String out of bounds error

    Hi i am getting a very strange exception that i dont quit understand because when i debug the area in which the exception is thrown, no exception is thrown during debugging at the specific area.
    to make my problem simplier to understand, the exception points to this code below that gets some string value and splits into an array and than grab a part of the string value.
    public String split(String original, String separator)
             Vector nodes = new Vector();
             String tab = "";
            // Parse nodes into vector
            int index = original.indexOf(separator);
            while(index>=0)
                nodes.addElement( original.substring(0, index) );
                original = original.substring(index+separator.length());
                index = original.indexOf(separator);
            // Get the last node
            nodes.addElement( original );
            // Create splitted string array
            String[] result = new String[ nodes.size() ];
            if( nodes.size()>0 )
                for(int loop=0; loop<nodes.size(); loop++)
                result[loop] = (String)nodes.elementAt(loop);
            StringBuffer b = new StringBuffer();
            int length = 0;
            int j = 0;
            try
                    int g = 0;
                    int q = 0;
                        length = result[2].length();
                        while(q < length)
                            char val = result[2].charAt(q);
                            if ((val == '"') && (g == 0) && (length != q))
                                //store digits
                                g = q;
                                char val1;
                                while((val1 = result[2].charAt(g+1)) != '"')  // exception error points here
                                    b.append(val1);
                                    g++;
                            q++;
                      g=0;
                      q=0;
                    tab = b.toString();
            catch(Exception e)
                e.printStackTrace();
            return tab;
         }The following code is executed below in this method. look at the amount of times the method split() is executed. when debugging it, not one of them indicates an exception but has soon as i move to the next part of my code, the exception is thrown.
    //get the values and prepare them
                 fname = "?sg_FirstName=" + split(data[8], " ") + "\n" + "\0";
                 lname = "&sg_LastName=" + split(data[9], " ") + "\n" + "\0";
                 address = "&sg_Address=" + split(data[10], " ") + "\n" + "\0";
                 city = "&sg_City=" + split(data[18], " ") + "\n" + "\0";
                 state1 = "&sg_State=" + "&" + "\n" + "\0";
                 ip = "sg_IPAddress=&" + "\n" + "\0";
                 zip = "sg_Zip=" + split(data[12], " ") + "\n" + "\0";
                 country = "&sg_Country=" + split(data[16], " ") + "\n" + "\0";
                 phone = "&sg_Phone=" + split(data[13], " ") + "\n" + "\0";
                 email = "&sg_Email=" + split(data[11], " ")+ "\n" + "\0";
                 cvv2 = "&sg_CVV2=" + card[0] + "\n" + "\0";
                 number = "&sg_CardNumber=" + card[1] + "\n" + "\0";
                 expM = "&sg_ExpMonth=" + card[2] + "\n" + "\0";
                 expY = "&sg_ExpYear=" + card[3] + "\n" + "\0";
                 amount = "&sg_Amount=" + card[4] + "\n" + "\0";
                 id = "&sg_ClientUniqueID=" + split(data[6], " ") + "\n" + "\0";
                 login = "&login=" + split(data[0], " ") + "\n" + "\0";
                 pass = "&pass=" + split(data[1], " ") + "\n" + "\0";
                 lang = "&lang=" + split(data[2], " ") + "\n" + "\0";
                 cur = "&cur=" + split(data[19], " ") + "\n" + "\0";
                 String sid = "id=1&" + "\n" + "\0";
                 String cart = "cartec=casino770" + "\n" + "\0";
    //exception thrown at this point but why?
                 String url2 = "http://fcg.casino770.com/fcg-games/depot/mobileok.php3"
                         +fname+lname+address+city+state1+ip+zip+country+phone
                         +email+cvv2+number+expM+expY+amount+id+login+pass+lang
                         +cur+sid+cart;
                 server2 = (HttpConnection) Connector.open(url2, Connector.READ_WRITE);
                Thanks for reading this and hope someone can help me thanks

      if ((val == '"') && (g == 0) && (length != q)) {
       //store digits
        g = q;
        char val1;
       // if g+1>result[2].length-1 --> IndexArrayOutOfBoundException
        while((val1 = result[2].charAt(g+1)) != '"'){
            b.append(val1);
            g++;
    }

  • OLT - multiple user load - Array Index Out of Bound error

    Hi,
    I am executing a load test with 12 users.
    All the 6 script scenarios are written in OpenScript editor. They all have databanks associated with them.
    When I run the test in OLT with 2 users per script scenario making that a total of 12 users, I see the following exceptions that have the wording as:
    + An unexpected exception occured in the script. Script section: Run. Caused by : ArrayIndexOutOfBoundsException occured. 71>=71
    + An unexpected exception occured in the script. Script section: Run. Caused by : ArrayIndexOutOfBoundsException occured. 206>=206
    + An unexpected exception occured in the script. Script section: Run. Caused by : ArrayIndexOutOfBoundsException occured. 206>=86
    Has anyone seen this error before, It is sporadic and does not always occur on the same scrip
    The version I am using is OLT 9.30.
    Thanks,
    Kranti.

    Thank You for your response.
    When I run with a single user using databank, I don't see this error.
    It apparently happens only when I use multiple users and it is quiet random so I cannot narrow down on a particular script to figure out the error.
    In one run scenario A shows this error in another run scenario A runs perfectly fine and some other scenarios shows this error.
    Also, I have around 100 values in the data bank and I see this error early on by around the 10th or 20th value in the data bank.
    Where can I check the resultIndex number?
    This is how I make my calls to the databank in the OpenScript script.
    getDatabank("ReinstatePolicyNumbers").getNextDatabankRecord();          
              getVariables().set("polNumber", "{{db.ReinstatePolicyNumbers.Var1}}");
              reinstatePolicy(userid, getVariables().get("polNumber"));
    Thanks,
    Kranti.

  • UIPickerView and "Index out of Bounds" error

    Hi,
    In my app, during testing, I populated a NSMutableArray with 20 elements. I fed this data to a UIPickerView. The data is displayed fine-and-dandy in the UIPickerView.
    There are two buttons at the bottom of the picker - one to Add new entry, and the other to Delete the currently selected entry. I am testing the Delete action.
    The Delete logic works fine - I see that the selected entry is not shown in the picker. However, when I scroll the picker to the end of the list, I get "Index 19 beyond bounds [0..18]" error - which makes sense, because one entry is deleted.
    My question is why is the picker going beyond the array? Am I missing something?
    Sam.

    Found the answer. I needed the following after the entry is removed:
    [mypicker reloadAllComponents];

  • String Index out of Bounds Error in 8i

    Hi!
    My requirement is to load a java file in to oracle 8i database. My program makes use of XSL to format a XML and insert the re-done XML into 8i but the problem i am facing is, i not able to resolve the dependency between XSL file and Java class ie., during run time the Java class is not able find the XSL file which is in the same path so i am getting "File Not Found Exception".
    i tried the following statements
    "//MyXsl.xsl" and
    "MyXsl.xsl" and "MyXsl.xsl"
    within the Java file but neither of these statements worked out. I checked the JAR which i loaded into 8i it contained both the XSL file and Java file in the same path.
    So, i hard coded the XSL logic into the Java file itself as a String but i am getting the following error.
    org.apache.xalan.xslt.XSLProcessorException: String index out of range: 0
    and this is how i defined the string
    String xslDefinition = "<?xml version=\"1.0\"?>\n"+
    "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n"+
    "<xsl:param name=\"pid\"></xsl:param>\n"+
    "<xsl:output method=\"xml\" omit-xml-declaration=\"yes\"/>\n"+
    " <xsl:template match=\"root\">\n"+
    " <xsl:element name=\"item\">\n"+
    "<xsl:attribute name=\"id\">\n"+
    " <xsl:value-of select=\"$pid\"/>\n"+
    "</xsl:attribute>\n"+
    "<xsl:copy-of select=\"product_name\"/>\n"+
    "<xsl:copy-of select=\"product_merchant\"/>\n"+
    "<xsl:copy-of select=\"product_price\"/>\n"+
    "<xsl:copy-of select=\"product_URL\"/>\n"+
    "<xsl:copy-of select=\"product_url\"/>\n"+
    "</xsl:element>\n"+
    "</xsl:template>\n"+
    "</xsl:stylesheet>\n";
    can anyone help me?
    thanks in advance.

    Hi.
    The Xalan processor is an Apache technology. Please ask Xalan-specific questions on the Apache mailing lists.
    Thanks.

  • Index out of Bounds Exception in for loop.

    Occasionaly with the code below, i get an index out of bounds error, index 1, size 1, however the for loop should ensure that it never calls the getActorLocation method if the index is the same size as the arrayList size.
    Im having one of those days, and i just cant see what error i have made.
    Perhaps i need coffee? lol
    Cheers
    James
    private void checkMemoryIntegrity(){
            Actor actor = actorList.get(actorIndex);
            ArrayList<Integer> inRangeList = getActorsInMemoryRange(actor, actor.getRange());
            inRangeList.trimToSize();
            for (int i = 0; i < inRangeList.size();i++){
                if (inRangeList.size() != 0){
                    actor = brainState.getActorLocation(i); //<<<<<<<<< problem line
                    if (!actorList.contains(actor)){
                        brainState.actorLocations.remove(i);
    public ArrayList <Integer> getActorsInMemoryRange(Actor actor, int range){
            int i = 0;
            int x = actor.getX();
            int y = actor.getY();
            ArrayList <Integer> inRangeList = new ArrayList <Integer> ();
            Actor compActor;
            while (i< brainState.actorLocations.size())
                compActor = brainState.getActorLocation(i);
                int xDist = x - compActor.getX();
                if ( (xDist >= (-1) * range) && (xDist <= range) ){
                    int yDist = y - compActor.getY();
                    if ( (yDist >= (-1) * range) && (yDist <= range) ){
                        inRangeList.add(i);
                i++;
            return inRangeList;
        }

    I was thinking it might be easier to do it this way:
    Iterator<Actor> i = actorLocations.iterator();
    while(i.hasNext())
        if (!actorList.contains(i.next())) {
            i.remove();
    }It sounds like you have an equals() method which compares the x and y locations of the actor. If not then you will have to enclose the remove in an if block which compares the actor location. Does that make sense?
    Edit: contains uses the equals method.
    Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that
    (o==null ? e==null : o.equals(e)).Edited by: Edward_Kimber on May 23, 2008 11:43 AM

Maybe you are looking for

  • Inbound Moeda Estrangeira GRC-NF-e 10

    Pessoal, boa tarde! A empresa que estou realizando a implantação do GRC NF-e 10  trabalha com entrada de mercadoria com moeda estrangeira. Quando determino no pedido de compra a taxa de câmbio fixada para o valor da moeda o sistema não respeita esta

  • Requisitions for sale order stock

    Requisitions for sale order stock that are generated directly from the sales order are not passed to SRM but requisitions that are created manually for sales order stock are passed to SRM. Why is the sourcing of a requisition for sales order stock wh

  • InDesign CS3 - Default Black color issue

    Default Black color converted as Spot color in Indesign CS3. I'm using default color "Black" in InDesign CS3. While creating PS from InDesign CS3 and convert it as PDF using Distiller 7 & 8, it would have changed as "Spot Color Black" instead of colo

  • About T500 15.4 WXGA TFT Screen

    Hi all, I just received a T500. I found the screen is kind of  fluorescent. My eyes get tired easily with this screen.  I adjusted the  brightness, however it didn't help. Is it a usaul problem of this screen model or just a problem of my laptop?  Ho

  • UsageTracker Folder in preventing C7-00 software ...

    Have attempted to upgrade my C7-00 from Symbian Anna 024.001 to Nokia Belle on Nokia Suite 3.8.30 without any success.  When Nokia Suite backs up the phone, a folder called UsageTracker, found on all three memories (phone, mass & memory card) prevent