If you place the xls file inside src/main/resources it should be picked up
for both, the test and the spring configuration


On Wed, Apr 17, 2013 at 7:13 PM, Mauricio Salatino <salaboy@gmail.com> wrote:
Great! Good luck!


On Wed, Apr 17, 2013 at 6:53 PM, Charles Moulliard <ch007m@gmail.com> wrote:
Know the reason. Maven when it copy it to the target directory modifies it. Will investigate why.


On Wed, Apr 17, 2013 at 11:46 PM, Charles Moulliard <ch007m@gmail.com> wrote:
if i change the name (file tobe loaded) then it fails

Caused by: java.io.FileNotFoundException: 'data/IntegrationExampleTesti.xls' cannot be opened because it does not exist
at org.drools.core.io.impl.ClassPathResource.getURL(ClassPathResource.java:168)
at org.drools.core.io.impl.ClassPathResource.getLastModified(ClassPathResource.java:180)


On Wed, Apr 17, 2013 at 11:44 PM, Mauricio Salatino <salaboy@gmail.com> wrote:
Can you try pointing to a non existing location? to see if you get the same error? 



On Wed, Apr 17, 2013 at 6:30 PM, Charles Moulliard <ch007m@gmail.com> wrote:
As the file exists under target/classes directory, that should be the case

..../target/classes/data/IntegrationExampleTest.xls


On Wed, Apr 17, 2013 at 11:11 PM, Mauricio Salatino <salaboy@gmail.com> wrote:
It could be related with the location of the file: classpath:data/IntegrationExampleTest.xls

Are you sure that the file is being picked up? 



On Wed, Apr 17, 2013 at 6:05 PM, Charles Moulliard <ch007m@gmail.com> wrote:
Hi,

When I try to instantiate an Excel Decision Table using Drools + Spring (kresource), I get this error :

REMARK: the file is the same as we have in Drools Unit Test (decision-table)

Error :

Caused by: 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)
at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:93)
at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:72)
at org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:37)
at org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:20)
at org.drools.compiler.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:15)
at org.drools.compiler.compiler.PackageBuilder.decisionTableToPackageDescr(PackageBuilder.java:460)
at org.drools.compiler.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:454)
at org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:684)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
at org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)

Config :

<?xml version="1.0" encoding="UTF-8"?>
       xmlns:drools="http://drools.org/schema/drools-spring"

    <drools:grid-node id="node1"/>

    <drools:kbase id="kbase1" node="node1">
        <drools:configuration>
            <drools:mbeans enabled="true"/>
        </drools:configuration>
        <drools:resources>
            <drools:resource type="DTABLE" source="classpath:data/IntegrationExampleTest.xls"/>
        </drools:resources>
    </drools:kbase>

    <drools:ksession id="ksession1"
                     type="stateless"
                     name="ksession1"
                     kbase="kbase1"
                     node="node1"/>

</beans>

Regards,

--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com




--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -