0
votes

I have a little question about mule xml config file,while I try simple mule app that using logger and expression.The config file be like this :

<?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>

I have error on expression-filter and logger. The error shown like this : cvc-complex-type.2.4.a: Invalid content was found starting with element 'expression-filter'

The program can running but I don't feel right when the project still have error.I want to know how to fix this.

I check http://www.mulesoft.org/schema/mule/ but don't see expression-filter or logger.

my editor is STS 3.4.0 and mule version is 3.4 ,Thank you.

1

1 Answers

0
votes

I'd recommend changing your schema locations to name your explicit version, e.g.

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"

and also the xmlns statements, similarly. I've experienced this with mule 3.2.x, where certain XML attributes would fail to resolve in Mule IDE, although they compiled just fine. Changing from "current" to my specific version often corrected these resolution errors (although not always).

In general, it's usually safe to ignore these resolution failures if compilation and execution succeeds, but I agree with your general assertion that it's not a good feeling. Try being explicit with your schema definition, as I searched the core mule.xsd and both logger and expression-filter are properly defined in that file, so that should resolve your resolution errors.