java.lang.NullPointerException

java.lang.NullPointerException
 at jxl.read.biff.File.<init>(File.java:77)
 at jxl.Workbook.getWorkbook(Workbook.java:250)
 at jxl.Workbook.getWorkbook(Workbook.java:235)
 at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:76)
 at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:89)
 at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:68)
 at com.sample.DecisionTableTest.readDecisionTable(DecisionTableTest.java:59)
 at com.sample.DecisionTableTest.main(DecisionTableTest.java:36)

Drools调用readDecisionTable()方法里面一处为:
InputStream is = DecisionTableTest.class.getResourceAsStream("rules\\Sample.xls");
final String drl = converter.compile( is, InputType.XLS );  
     
需改为如下,取的class即错误解决。
InputStream is = DecisionTableTest.class.getClassLoader().getResourceAsStream("rules\\Sample.xls");
final String drl = converter.compile( is, InputType.XLS );

你可能感兴趣的:(java.lang.NullPointerException)