Posted on 2010-10-05 00:22
断点 阅读(601)
评论(0) 编辑 收藏 所属分类:
Drools
WARNING: Wasn't able to correctly close stream for decision table. nulljava.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 org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:110)
at com.sample.DecisionTableTest.readDecisionTable(DecisionTableTest.java:57)
at com.sample.DecisionTableTest.main(DecisionTableTest.java:35)
在web项目中的原先的写法为:
final String drl = converter.compile( "rules\\Sample.xls", InputType.XLS );
参考了下别人的写法,改为下面的方式进行处理:
InputStream is = DecisionTableTest.class.getClassLoader().getResourceAsStream("rules\\Sample.xls");
final String drl = converter.compile( is, InputType.XLS );