Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JXL cant' find specified File

807580Jul 7 2010 — edited Jul 7 2010
I'm trying to read in an excel file and using JExcel. I've done it two ways... one works and the other give me the error. I need it to read from the place where it says it can't find the file.
File inputWorkbook = new File("c:/resin/webapps/patriotmem/RMA.xls");  // DOESNT WORK
//File inputWorkbook = new File("c:/resin/webapps/patriotmem/RMA.xls");  // WORKS!!!! ??????

     System.out.println("absolut path is " + inputWorkbook.getAbsolutePath());


     try {
      Workbook w = Workbook.getWorkbook(inputWorkbook);
      Sheet sheet = w.getSheet(0); 
      rows = sheet.getRows();

      ......./// more
The error says...

props are C:\resin
absolut path is c:\resin\webapps\patriotmem\RMA.xls
jxl.read.biff.BiffException: The input file was not found
at jxl.read.biff.File.<init>(File.java:124)
at jxl.Workbook.getWorkbook(Workbook.java:221)
at jxl.Workbook.getWorkbook(Workbook.java:198)
at com.patriotmem.util.CreateExcelForRMA.createExcel(CreateExcelForRMA.j
ava:82)

I actually put the file in both places, but it can't only find it at the root resin directory. What could be the problem?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2010
Added on Jul 7 2010
2 comments
1,677 views