断点

每天进步一点点!
posts - 174, comments - 56, trackbacks - 0, articles - 21
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 );

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


网站导航: