在spring中配置drools,一直提示的都是规则文件找不到

潘嘚 发布于 2016/07/13 15:47
阅读 665
收藏 0

Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: 'spring/Ccar.drl' cannot be opened because it does not exist我的spring-drools的配置是

<?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:drools="http://drools.org/schema/drools-spring"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd  
                           http://drools.org/schema/drools-spring http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd
                           http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

  <drools:kbase id="kbase1">
     <drools:resources>
         <drools:resource type="DRL" source="classpath:drl/Ccar.drl"/>
     </drools:resources>
  </drools:kbase>

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

  <drools:ksession id="ksession2" type="stateful"  kbase="kbase1"/>

 


    
</beans>

spring-context 的配置是

<?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:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans  
           http://www.springframework.org/schema/beans/spring-beans-4.2.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-4.2.xsd  
           http://www.springframework.org/schema/tx  
           http://www.springframework.org/schema/tx/spring-tx-4.2.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-4.2.xsd"
    default-autowire="byName" default-lazy-init="false">

    <!-- 采用注释的方式配置bean -->  
    <context:annotation-config />
    
    <!-- 配置要扫描的包 -->
    <context:component-scan base-package="com.pcloud"/>
    
    <!-- 读入配置属性文件 -->
    <context:property-placeholder location="classpath:public_system.properties,classpath:db.properties"/>
    <!-- <context:property-placeholder location="classpath:public_system_shichunshan.properties,classpath:db_shichunshan.properties"/>-->
        

    
    <import resource="classpath:spring/spring-mybatis.xml" />
    <import resource="classpath:spring/spring-dubbo-provider.xml" />
     <import resource="classpath:spring/spring-drools.xml"/>
</beans>

加载中
返回顶部
顶部