断点

每天进步一点点!
posts - 174, comments - 56, trackbacks - 0, articles - 21

java.lang.NullPointerException

Posted on 2010-10-05 00:39 断点 阅读(683) 评论(0)  编辑  收藏 所属分类: Drools

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 );


只有注册用户登录后才能发表评论。


网站导航: