org.xml.sax.SAXParseException,Mule 4.3,Anypoint Studio 7.8

问题描述

我是 Mulesoft 的新手(使用 Mule 4.3ee 和 Anypoint Studio 7.8)。我添加一个数据库选择工具。我配置了Oracle数据库。测试连接成功并且成功获取记录。后来我在同一个项目中添加一个新的配置文件以进行删除。我添加数据库删除工具,在尝试运行该项目时,出现 org.xml.sax.SAXParseException 我尝试创建新的数据库配置文件并尝试运行。我仍然遇到同样的错误。如果我创建一个新的 Mule 项目并重新创建流程,它工作正常。我厌倦了 Stackoverflow 中提出的许多解决方案,例如添加新的依赖项、添加 mule 引用(如 mule-dbserver.xsd)以及重新启动工具实例。没有任何效果。请帮我解决这个问题。

在我收到的错误信息下方找到:

    Caused by: org.mule.runtime.api.exception.MuleRuntimeException: There were '7' errors while parsing the given file 'emp-sapi2.xml'.
Full list:
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 321; cvc-complex-type.3.2.2: Attribute 'responseStreamingMode' is not allowed to appear in element 'http:listener-config'.
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 321; cvc-complex-type.3.2.2: Attribute 'outputMimeType' is not allowed to appear in element 'http:listener-config'.
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 321; cvc-complex-type.3.2.2: Attribute 'primaryNodeOnly' is not allowed to appear in element 'http:listener-config'.
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 321; cvc-complex-type.3.2.2: Attribute 'path' is not allowed to appear in element 'http:listener-config'.
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 321; cvc-complex-type.3.2.2: Attribute 'outputEncoding' is not allowed to appear in element 'http:listener-config'.
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 321; cvc-complex-type.3.2.2: Attribute 'config-ref' is not allowed to appear in element 'http:listener-config'.
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 321; cvc-complex-type.3.2.2: Attribute 'allowedMethods' is not allowed to appear in element 'http:listener-config'.

enter image description here

enter image description here

解决方法

该错误与数据库连接器无关。它说 XML 解析器无法理解 HTTP 侦听器配置的某些属性。如果它之前工作,则可能在编辑数据库命名空间时您不小心遗漏了 http 命名空间。这很奇怪,因为它只抱怨属性,而不是命名空间本身。也许您将 http 命名空间指向了错误的架构?

通常,如果您使用图形视图,Studio 会为您处理命名空间。