Bug 735113 - Cannot load CSV decision table via changeset of KnowledgeAgent
Summary: Cannot load CSV decision table via changeset of KnowledgeAgent
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.2.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: BRMS 5.2.0.GA
Assignee: Geoffrey De Smet
QA Contact: Marek Baluch
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-01 14:18 UTC by Jiri Svitak
Modified: 2015-06-02 01:39 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---


Attachments (Terms of Use)
Files to reproduce (2.34 KB, application/zip)
2011-09-01 14:19 UTC, Jiri Svitak
no flags Details

Description Jiri Svitak 2011-09-01 14:18:00 UTC
Description of problem:
It is not possible to load CSV decision table via changeset of knowledge agent. It throws following exception from XLS parser, so it seems it ignores changeset field which specifies decision table type.


org.drools.template.parser.DecisionTableParseException: An error occurred opening the workbook. It is possible that the encoding of the document did not match the encoding of the reader.
	at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:90)
	at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:89)
	at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:68)
	at org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:38)
	at org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:21)
	at org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:18)
	at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:571)
	at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
	at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:712)
	at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1002)
	at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:785)
	at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:657)
	at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
	at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:169)
	at com.sample.LoadCSV.testSimpleCSVLoad(LoadCSV.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: jxl.read.biff.BiffException: Unable to recognize OLE stream
	at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)
	at jxl.read.biff.File.<init>(File.java:127)
	at jxl.Workbook.getWorkbook(Workbook.java:268)
	at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
	... 37 more




Version-Release number of selected component (if applicable):
BRMS 5.2.0 ER3

How reproducible:
Create knowledge agent and specify in changeset CSV decision table resource. You can use attached JUnit class and CSV file to reproduce bug.

Steps to Reproduce:
1. Extract attached archive.
2. Run as JUnit test.
  
Actual results:
CSV decision table does not load.

Expected results:
CSV decision table should load.

Additional info:
Another error found - XSD specification of changeset says, that worksheet name is optional parameter, but when you omit it then parser shows warning. This happens also with XLS resource.

Comment 1 Jiri Svitak 2011-09-01 14:19:23 UTC
Created attachment 521017 [details]
Files to reproduce

Comment 2 Geoffrey De Smet 2011-09-19 09:19:42 UTC
Rewriting the test to fit next to
  org.drools.decisiontable.ChangeSetTest#testIntegration
in 
  droolsjbpm/drools/drools-decisiontables/src/test/java/org/drools/decisiontable/ChangeSetTest.java

Comment 3 Geoffrey De Smet 2011-09-19 10:07:16 UTC
Partially caused by
  https://issues.jboss.org/browse/JBRULES-3005
org.drools.decisiontable.DecisionTableProviderImpl#compileStream:30

Comment 4 Geoffrey De Smet 2011-09-19 11:55:53 UTC
Fixed and testcase added
  https://github.com/droolsjbpm/drools/compare/b9d453c...4bec16d
and backported to 5.2.x.

Comment 5 Geoffrey De Smet 2011-09-19 11:59:51 UTC
Btw, thank you for the testcase attachment, it was very useful to replicate the problem.
Note: Although we are like testcase attachment, we prefer testcases as github pull request even more, as they are less likely to go stale:
  http://help.github.com/send-pull-requests/

Comment 6 Jiri Svitak 2011-09-20 11:20:10 UTC
Bug is still present in BRMS 5.2.0 ER4.

Comment 7 Lukáš Petrovický 2011-09-20 11:27:17 UTC
This was fixed after ER4 was released. I'm returning this to ON_QA to check it with ER5/CR1.

Comment 8 Jiri Svitak 2011-09-30 11:53:11 UTC
Bug is fixed in BRMS 5.2.0 ER5.


Note You need to log in before you can comment on or make changes to this bug.