【问题标题】:Configure drools with spring. xsd errors用弹簧配置口水。 xsd 错误
【发布时间】:2012-07-14 19:24:47
【问题描述】:

我正在尝试使用 Drools 创建 spring roo 应用程序。但我在 applicationContext.xml 中遇到了错误。

错误:

在这一行找到多个注释: - 无法为模式命名空间“http://drools.org/schema/”的元素“drools:execution-node”找到 Spring NamespaceHandler 流口水-弹簧' - cvc-complex-type.2.4.c:匹配的通配符是严格的,但找不到元素'drools:execution-node'的声明。

这是一段applicationContext.xml:

<beans  xmlns="http://www.springframework.org/schema/beans" 
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:drools="http://drools.org/schema/drools-spring"
    xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd         
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd         
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd         
      http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd         
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd       
      http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring.xsd">

在连接流口水时,我查看了以下来源: http://www.packtpub.com/article/drools-integration-modules-spring-framework-apache-camel http://blog.mersoft.com/2011/09/07/getting-started-with-drools-5-2 http://docs.jboss.org/drools/release/5.4.0.Final/droolsjbpm-integration-docs/html_single/index.html#d0e666

也许他们会帮助某人。

听到的是流口水豆

 <drools:execution-node id="node1" />

  <drools:resources>

     <drools:resource  type="XSD" source="classpath:model.xsd"/>

     <drools:resource  type="DRL" source="classpath:test.drl"/>

  </drools:resources>

请帮我配置名称空间。并给我更多关于 Drools spring 集成和 xml 命名空间的链接。

【问题讨论】:

  • 你能把你的 pom.xml 的 sn-p 粘贴到你包含 drools 库的地方吗?

标签: spring-roo drools applicationcontext


【解决方案1】:

您收到错误的原因是因为http://drools.org/schema/drools-spring.xsd 没有服务。如果你找到了一个正确服务它的 URI,你的错误应该会消失。我发现的一个示例 URI 是 http://grepcode.com/file_/repository.jboss.org/nexus/content/repositories/releases/org.drools/drools-spring/5.6.0.Final/org/drools/container/spring/drools-spring.xsd/?v=source

我试图通过以下堆栈溢出问题找到更可靠的参考:Location of drools-spring.xsd on git hub

【讨论】:

    【解决方案2】:

    我怀疑问题在于您使用的是 Spring 3.1,但使用了 drools-spring XML 配置,该配置加载了一些非常旧且过时的 Spring 依赖项。

    我建议避免使用 drools-spring XML 配置。只需配置一个 Spring bean 来包含您的知识库并充当它的接口。

    【讨论】:

      猜你喜欢
      • 2010-09-20
      • 2012-07-05
      • 1970-01-01
      • 2011-09-11
      • 2019-09-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多