Bug 1195634

Summary: Switchyard rules component cannot build a decision table from CSV format on JBoss FUSE
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Tomas Turek <tturek>
Component: SwitchYardAssignee: Aileen <aileenc>
Status: CLOSED UPSTREAM QA Contact: Matej Melko <mmelko>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: aileenc, kejohnso, mfusco, soa-p-jira, tsykora
Target Milestone: ER6   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1199256 (view as bug list) Environment:
Last Closed: 2025-02-10 03:44:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1199256    
Attachments:
Description Flags
Reproducer
none
error log
none
Reproducer-2.0.1-ER1
none
Patch for Reproducer-2.0.1-ER1 none

Description Tomas Turek 2015-02-24 08:33:52 UTC
Created attachment 994622 [details]
Reproducer

Description of problem:
There is a problem when I want create Switchyard rules component from Decision Table which is in CSV format. Builder thinks that file's format is XLS and try it parses. The consequence is thrown exception:

java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
  at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:75)[368:org.apache.servicemix.bundles.poi:3.9.0.2]
  at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:82)[369:org.drools.decisiontables:6.1.0.20140801-1612]
  ...

Version-Release number of selected component (if applicable):
JBoss Fuse 6.1.0.redhat-379 + Switchyard 2.0.0.Aplha3 (community version)

How reproducible:
Attached maven project with a reproducer (100%).

Steps to Reproduce:
Build attached maven project by command: mvn clean install.
Deploy the reproducer on JBoss Fuse:
1. features:addurl mvn:com.example.switchyard/switchyard-dtables/0.0.1-SNAPSHOT/xml/features
2. features:install switchyard-dtables
3. log:display

Actual results:
Unable to start switchyard for bundle com.example.switchyard.switchyard-dtables. 
Full error log is enclosed.

Expected results:
Switchyard application is successfully deployed.

Additional info:
Expected problem is in function compileStream of class DecisionTableProviderImpl which passed parameter DecisionTableConfiguration configuration is null instead of a correct configuration with input type CSV.

Comment 1 Tomas Turek 2015-02-24 08:35:14 UTC
Created attachment 994625 [details]
error log

Comment 2 David Virgil 2015-03-03 19:22:14 UTC
I tested this example in the switchyard 2.0.1-ER1 version and it was working.

YOu can take a look to my comment, and to the code i used here:

https://issues.jboss.org/browse/SWITCHYARD-2583

Comment 3 Tomas Turek 2015-03-04 12:27:24 UTC
Created attachment 997826 [details]
Reproducer-2.0.1-ER1

Comment 4 Tomas Turek 2015-03-04 12:29:50 UTC
I looked at it and I found that this problem exists also in SW 2.0.1-ER1. Example does not throw an error because it is waiting for the CSA component, which I forgot to add to features.xml. I modified the example to make it correctly working. See the attachments.

Steps to reproduce:
1. mvn clean install
2. Deploy in karaf:
	a. features:addurl mvn:com.example.switchyard/switchyard-dtables/0.0.1-SNAPSHOT/xml/features
	b. features:install switchyard-dtables
3. mvn exec:java

Comment 5 David Virgil 2015-03-04 13:56:30 UTC
I got it now. 

It seems that It is an error in drools. I am checking with one of the drools developers.

It is getting throw when it is called:


_runtimeEnvironment.addAsset(asset, type);

The asset is a Resource that points to the csv file and the type is DecisionTable.

Comment 6 Mario Fusco 2015-03-04 15:41:33 UTC
The problem is in how jbpm adds a csv resource to the drools knowldge builder.

I sent a pull request to the jbpm project that should fix this problem: https://github.com/droolsjbpm/jbpm/pull/238

Comment 9 Martin Basovník 2015-12-16 09:14:20 UTC
I have verified that issue id fixed for:

switchyard version = 2.0.1.redhat-621084
Integration pack version = 1.3.0.redhat-002

I had to apply a small patch (patch.diff) on reproducer "Reproducer-2.0.1-ER1". I will attach it.

Comment 10 Martin Basovník 2015-12-16 09:15:17 UTC
Created attachment 1106338 [details]
Patch for Reproducer-2.0.1-ER1

Comment 12 Red Hat Bugzilla 2025-02-10 03:44:09 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.