Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-4888

spring boot and drools integration occur path error and cannot load rule

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 7.30.0.Final
    • docs, integration
    • None
    • 2020 Week 01-03 (from Dec 30)
    • Documentation (Ref Guide, User Guide, etc.), Interactive Demo/Tutorial
    • NEW
    • NEW

    Description

      I'm trying to run drools 7.30.0.Final with Spring Boot 2.2.2.RELEASE.I configured drools as the documentation says. My drools-config.xml configuration file is where I keep the drools beans and looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:kie="http://drools.org/schema/kie-spring"
             xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://drools.org/schema/kie-spring http://drools.org/schema/kie-spring.xsd">
          <kie:kmodule id="sample_module">
              <kie:kbase name="testRules" packages="rules" declarativeAgenda="true">
                  <kie:ksession name="ksession1" type="stateless"/>
                  <kie:ksession name="ksession2" scope="prototype">
                      <kie:ruleRuntimeEventListener ref="mockRuleRuntimeEventListener" />
                      <kie:consoleLogger />
                  </kie:ksession>
              </kie:kbase>
          </kie:kmodule>
      
          <!-- https://docs.jboss.org/drools/release/7.30.0.Final/drools-docs/html_single/index.html#_important_note -->
          <!-- <bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/> -->
          <bean class="org.kie.spring.annotations.KModuleAnnotationPostProcessor"/>
      </beans>
      

      occur a warn looks:

      2019-12-19 14:44:25.231 WARN 9916 — [ main] o.d.c.kie.builder.impl.KieProject : No files found for KieBase testRules

      when i try debug org.kie.spring.KModuleBeanFactoryPostProcessor. Trace to ZipKieModule at line 133. cannot uncompress,get variable urlPath value is "/BOOT-INF/classes" jarFile values is "\Users\user\Desktop\springdrools\target\spring-drools-1.0.jar!\BOOT-INF\classes". lead to cannot load resource.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            546168949 韩 济蓬 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: