[jboss-jira] [JBoss JIRA] (DROOLS-466) Reading Rules packaged inside jar
Ashish Nayyar (JIRA)
issues at jboss.org
Thu May 8 20:11:56 EDT 2014
[ https://issues.jboss.org/browse/DROOLS-466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966620#comment-12966620 ]
Ashish Nayyar commented on DROOLS-466:
--------------------------------------
I have tried this solution but my Spring context fails to load. This is my configuration and error logs:
knowledge-services.xml
<kie:kmodule id="kie-spring">
<kie:kbase name="kie-base" includes="rules1Package" packages="au.org.nps.dsaas.rules" >
<kie:ksession name="ksession1" type="stateless" >
<kie:consoleLogger />
</kie:ksession>
</kie:kbase>
</kie:kmodule>
<bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>
kmodule.xml
<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="rules1Package" packages="au.org.nps.dsaas.rules1" >
<ksession name="ksession2" type="stateless" />
</kbase>
</kmodule>
My KIE modules are discovered and I can see following in the logs
09:59:36,642 DEBUG [org.drools.compiler.kie.builder.impl.ClasspathKieProject] (ServerService Thread Pool -- 91) Found and used pom.properties META-INF/maven/au.org.nps.dsaas/rules-repository/pom.properties
09:59:36,645 DEBUG [org.drools.compiler.kie.builder.impl.ClasspathKieProject] (ServerService Thread Pool -- 91) Discovered classpath module au.org.nps.dsaas:rules-repository:0.0.1-SNAPSHOT
But Spring context fails to load and I get the following errors:
09:59:39,547 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (ServerService Thread Pool -- 91) Unable to build KieBase, could not find include: rules1Package
> Reading Rules packaged inside jar
> ---------------------------------
>
> Key: DROOLS-466
> URL: https://issues.jboss.org/browse/DROOLS-466
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.1.Final
> Reporter: Ashish Nayyar
> Assignee: Mario Fusco
> Labels: drools, drools-compiler
>
> I am working on DROOLS 6.0.1 application. I have my rule files (*.drl) packaged inside a separate project which is included as a jar file as a maven dependency. When I deploy my project, KIEModule is not able to find the rules files (which are packaged inside the jar above). I am not getting an error though but rules are not getting fired.
> If I manually place the rules files under classpath say WEB-INF/rules/*.drl they are detected and rules are executed.
> I was under impression that KIEmodules are auto discovered from anywhere in classpath.
> Any pointers are appreciated. This is general question hence I have not included the comprehensive code files. Everything start working once I place the *.drl files in the classpath (take them outside of jar).
> On Further invstigation by looking into the code, I found that
> addFiles(assets, kBaseModel, kModule);
> Call from "AbstractKieModule" fails and its not able to find the rules packaged inside the JAR file placed under WEB-INF\lib folder. I get this warning message on the console
> 08:40:02,113 WARN [org.drools.compiler.kie.builder.impl.AbstractKieModule] (ServerService Thread Pool -- 55) No files found for KieBase kie-base-old, searching folder \Apps\jboss-eap-6.1\standalone\deployments\Application.war
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
More information about the jboss-jira
mailing list