zoukankan      html  css  js  c++  java
  • drools spring config的问题

    在开发中经常会用到spring, 现在的各种框架于spring的结合也非常好。

    但是并没有注意configure的时候一些格式问题,今天就碰到了格式带来的困扰。

    <drools:kagent id="kagent1" kbase="kbase1" new-instance="false">
        <drools:resources>                
            <drools:resource type="DRL" source="classpath:Sample.drl" />
        </drools:resources>
    </drools:kagent>

    <drools:kagent id="kagent1" kbase="kbase1" new-instance="false">
        <drools:resources>
            <drools:resource type="DRL" source="classpath:Sample.drl" />
        </drools:resources>
    </drools:kagent>

    上面的两个configure看上去一模一样,但是用第一个的时候就会有错误

    org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 17 in XML document from class path resource [drools-services.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.3: Element 'drools:resources' cannot have character [children], because the type's content type is element-only.

    后来跟官方的configure文件对比,发现<drools:resources>后面有一些空格,就是我用红色标出的部分。去掉这些空格之后就没有问题了。这些是从word里面copy出来的。可能带有一些word的格式信息,被xds检查的时候报的错误。如果是直接用space加的空格是不会有问题的。

    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                               http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring-1.3.0.xsd

  • 相关阅读:
    python 内存泄漏——使用pymssql模块的讨论 free(): corrupted unsorted chunks
    Python的gc模块
    使用多线程——线程池
    sqlserver 数据库连接池
    drf response——简单封装
    邮箱找回密码实现
    阿里云 oss 服务 —— 上传图片,获取url
    dajngo-apscheduler 实现定时任务
    kubernetes基础概念
    Path must be a string.
  • 原文地址:https://www.cnblogs.com/scarlettxu/p/3412428.html
Copyright © 2011-2022 走看看