Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    54
    Rep Power
    0

    Default strange Error message

    hey, and it is me again...

    i found out how to read in stuff from an excel sheet, i am preety proud about it, but althought it is working, i am getting a really strange error message

    Warning: Property storage name for 5 is empty - setting to Root Entry
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
    at jxl.read.biff.SheetImpl.getCell(SheetImpl.java:354 )
    at Excel.main(Excel.java:23)


    and my code is:

    import java.io.File;
    import java.io.IOException;
    import java.util.Date;
    import jxl.*;
    import jxl.read.biff.BiffException;


    public class Excel
    {


    public static void main(String[] args) throws BiffException, IOException
    {
    Workbook workbook = Workbook.getWorkbook(new File("//Volumes//ws.xls"));

    Sheet sheet = workbook.getSheet(0);


    int x;

    for(int a = 0; a < 11 ; a++)
    {
    Cell a1 = sheet.getCell(0,a);

    String stringa1 = a1.getContents();

    x = Integer.parseInt(stringa1);

    System.out.println(x);

    }



    }
    }


    does anyone know how to handle it...

    little:polarbear

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,546
    Rep Power
    23

    Default

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
    The message says that the index 10 is past the end of the array.
    The following code trys to get a cell with that index:
    sheet.getCell(0,a);

    Why do you think that there is a cell at index 10? You have the value 11 hardcoded in your program in the for loop. The loop goes from a=0 to 10 - that's 11 cells.
    Is there a method you can call to get the correct number of cells?

  3. #3
    Join Date
    Jun 2008
    Posts
    54
    Rep Power
    0

    Default

    ok, i changed it and i am not getting this message anymore :-) ur brilliant, i just don't know what to do with the other error message

    Warning: Property storage name for 5 is empty - setting to Root Entry

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,546
    Rep Power
    23

    Default

    That doesn't look like a java error message. It must be from the package you are using. You'll have to read its docs.

  5. #5
    Join Date
    Jun 2008
    Posts
    54
    Rep Power
    0

Similar Threads

  1. Can't solve error message while looping
    By BHCluster in forum New To Java
    Replies: 15
    Last Post: 04-22-2008, 10:51 AM
  2. System.in.read(); strange error!
    By kantze in forum New To Java
    Replies: 2
    Last Post: 03-19-2008, 01:44 PM
  3. java error message
    By baileyr in forum New To Java
    Replies: 2
    Last Post: 01-23-2008, 03:47 AM
  4. Strange error message "Source not found"
    By ppayal in forum Eclipse
    Replies: 0
    Last Post: 11-25-2007, 06:19 PM
  5. error message on jsp
    By sandor in forum Web Frameworks
    Replies: 1
    Last Post: 04-11-2007, 02:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •