I am using Aspose.Cells (trial version) to parse a .xls (Excel) file for Java. But when I try to load the file, it throws the exception given below:
SEVERE: java.lang.IllegalStateException: XML Stream Exception: XMLStreamException: com.ctc.wstx.sr.ValidatingStreamReader cannot be cast to com.ctc.wstx.sr.ValidatingStreamReader
Here is my code
Workbook workbook = new Workbook();
try {
workbook.open(path+fileName);
} catch (Exception e) {
e.printStackTrace();
}
Worksheet worksheet = workbook.getWorksheets().get(0);
This exception is coming at workbook.open(path+fileName);
this line.I am quiet sure that this is not due to wrong path because when I give wrong path then aspose throws FileNotFoundException
.So now I am stuck here and unable to find why this is happening?
Note: In search of this problem, I found this answer on aspose forum but it is not helpful and feasible(to check all the classes present in jars placed in lib).