【问题标题】:Mule config schema don't have loggerMule 配置模式没有记录器
【发布时间】:2014-02-27 13:25:39
【问题描述】:

我有一个关于 mule xml 配置文件的小问题,而我尝试使用记录器和表达式的简单 mule 应用程序。配置文件是这样的:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
http://www.mulesoft.org/schema/mule/core 
http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/http  
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> 

<flow name="basic_tutorialFlow1" doc:name="basic_tutorialFlow1">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8084" doc:name="HTTP"/>
    <expression-filter expression="#[message.payload != '/favicon.ico']" doc:name="Expression"></expression-filter>
    <logger level="INFO" doc:name="Logger" message="Current payload is #[message.payload]"/>
    <set-payload doc:name="Set Payload" value="#['Hello, ' + message.payload + '. Today is ' + server.dateTime.format('dd/MM/yy') + '.' ]"/>
</flow>

我在表达式过滤器和记录器上有错误。显示的错误如下: cvc-complex-type.2.4.a:发现以元素“表达式过滤器”开头的无效内容

程序可以运行,但是当项目仍然有错误时我感觉不对。我想知道如何解决这个问题。

我检查了http://www.mulesoft.org/schema/mule/,但没有看到表达式过滤器或记录器。

我的编辑器是STS 3.4.0,mule版本是3.4,谢谢。

【问题讨论】:

    标签: mule


    【解决方案1】:

    我建议更改您的架构位置以命名您的显式版本,例如

    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
    http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
    http://www.mulesoft.org/schema/mule/http
    http://www.mulesoft.org/schema/mule/http/3.4/mule-http.xsd"
    

    还有xmlns 语句,类似地。我在 mule 3.2.x 中遇到过这种情况,其中某些 XML 属性在 Mule IDE 中无法解析,尽管它们编译得很好。从“当前”更改为我的特定版本通常会纠正这些分辨率错误(尽管并非总是如此)。

    一般来说,如果编译和执行成功,忽略这些解析失败通常是安全的,但我同意你的一般断言,即这不是一种好的感觉。尝试明确您的架构定义,因为我搜索了核心 mule.xsd 并且在该文件中正确定义了记录器和表达式过滤器,因此应该可以解决您的解析错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-19
      • 2014-05-21
      • 1970-01-01
      • 2023-02-14
      • 1970-01-01
      • 2010-12-29
      • 2020-06-18
      相关资源
      最近更新 更多