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

  • 相关阅读:
    git ssh keys
    git 修改 email
    git 撤销commit
    企微调试模式
    ORACLE 根据某个字段固定值进行分区
    Apache FtpClient login失败
    Oracle序列
    Oracle merage into
    Oracle all_tables 以及常用sql
    性能优化-使用高性能的库fastutil
  • 原文地址:https://www.cnblogs.com/scarlettxu/p/3412428.html
Copyright © 2011-2022 走看看