Unable to read excel from classpath using jxl

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.

Assignee

Unassigned

Reporter

Ajay Singh

Labels

None

Time tracking

24h

Components

Affects versions

Priority

Major
Configure