Details
-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Not A Bug
-
Affects Version/s: 3.6.8
-
Fix Version/s: None
-
Component/s: Core
-
Labels:None
-
Environment:Windows 7, Java 1.6, JBehave 3.6.8, JXL 2.6.12
-
Number of attachments :
Description
I am unable to read excel using jxl from classpath however the same code is working fine with standalone code.
Excel is placed in src/main/resources/test.xls
Workbook workbook = null; InputStream stream =this.getClass().getClassLoader().getResourceAsStream("test.xls"); workbook = Workbook.getWorkbook(stream); Sheet sheet = workbook.getSheet(0); Cell a1 = sheet.getCell(0,0);
However if I use the file system path as
workbook = Workbook.getWorkbook(new File("src/main/resources/test.xls "));
I am able to read in jbehave.
Is this an issue with Jbehave since standalone code works in both the ways.
Activity
Ajay Singh
made changes -
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Not A Bug [ 6 ] |
Ajay - please use the mailing lists prior to logging a bug.
My guess is that this is not a bug.
If the file is in src/main/resources, then it is not on your classpath unless resources are copied over.
Is it in target/classes? That is where your classpath is looking.
If you are still having problems, then please attach a small project that duplicates the issue.