[rules-dev] drools-decisiontables and poi-ooxml-3.9.jar

Cristiano Gavião cvgaviao at gmail.com
Tue Mar 26 06:01:56 EDT 2013


Ok, thanks Christian and Michael.

I will have to think in a workaround to be able to use 
drools-decisiontables at OSGi.

regards,

Cristiano

On 25/03/13 19:17, Michael Anstis wrote:
> Hello,
>
> org.apache.poi.openxml4j.exceptions.InvalidFormatException is a 
> checked exception from WorkbookFactory.create(inStream).
>
> I don't see how we can remove it without removing use of the checked 
> exception... which I guess would mean forking POI.
>
> With kind regards,
>
> Mike
>
> On 23 March 2013 13:19, Cristiano Gavião <cvgaviao at gmail.com 
> <mailto:cvgaviao at gmail.com>> wrote:
>
>     Hi,
>
>     I'm getting a problem with the org.apache.poi.openxml4j.exceptions
>     package in my osgi things. I could not find a bundle that exports
>     such package.
>
>     Investigating a bit, the unique class that I could find using this
>     api is org.drools.decisiontable.parser.xls.ExcelParser, but only
>     org.apache.poi.openxml4j.exceptions.InvalidFormatException class.
>
>     is this api really needed?
>
>>         public void parseFile(InputStream inStream) {
>>             try {
>>                 Workbook workbook = WorkbookFactory.create(inStream);
>>
>>                 if ( _useFirstSheet ) {
>>                     Sheet sheet = workbook.getSheetAt( 0 );
>>                     processSheet( sheet, _listeners.get(
>>     DEFAULT_RULESHEET_NAME ) );
>>                 } else {
>>                     for ( String sheetName : _listeners.keySet() ) {
>>                         Sheet sheet = workbook.getSheet( sheetName );
>>                         if (sheet == null) {
>>                             throw new IllegalStateException("Could
>>     not find the sheetName (" + sheetName
>>                                                             + ") in
>>     the workbook sheetNames.");
>>                         }
>>                         processSheet( sheet,
>>                                       _listeners.get( sheetName ) );
>>
>>                     }
>>                 }
>>             } catch ( *InvalidFormatException* e ) {
>>                 throw new DecisionTableParseException( "An error
>>     occurred opening the workbook. It is possible that the encoding
>>     of the document did not match the encoding of the reader.",
>>                                                        e );
>>
>>             } catch ( IOException e ) {
>>                 throw new DecisionTableParseException( "Failed to
>>     open Excel stream, " + "please check that the content is xls97
>>     format.",
>>                                                        e );
>>             }
>>
>>         }
>
>
>     all other behavior is being supported by
>     org/apache/poi/poi/3.9/poi-3.9.jar
>
>
>     regards,
>
>     Cristiano
>
>     _______________________________________________
>     rules-dev mailing list
>     rules-dev at lists.jboss.org <mailto:rules-dev at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20130326/b37907dd/attachment-0001.html 


More information about the rules-dev mailing list