org.xml.sax.SAXParseException:无法在mule-domain-config中读取模式文档mule-mongo.xsd

时间:2016-03-21 15:07:48

标签: java spring mongodb mule

我将资源从不同的Mule项目迁移到一个Mule域项目(应该由所有其他Mule项目使用)。除了mongodb的配置外,一切正常。如果我启动所有内容并且域开始初始化,则会出现以下错误:

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mule/mongo/current/mule-mongo.xsd'

请参阅相应的 mule-domain-config.xsd

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

    <!-- configure here resource to be shared within the domain -->

    <context:property-placeholder location="${mule.env}.properties "/>

    <mongo:config name="mongoconfig" host="${mongo.host}" port="${mongo.port}" database="${mongo.database}"   doc:name="Mongo DB" connectTimeout="5000" connectionsPerHost="1" autoConnectRetry="true" threadsAllowedToBlockForConnectionMultiplier="50" username="${mongo.username}"> 
        <mongo:connection-pooling-profile maxActive="150" initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW" maxIdle="50" ></mongo:connection-pooling-profile>  
        <mule:reconnect frequency="1000"></mule:reconnect>  
    </mongo:config>

    <http:listener-config name="HTTP_Listener_Configuration" host="${http.host}" port="${http.port}" doc:name="HTTP Listener Configuration"/>

</mule-domain>

我的第一个想法是,我需要将 mule-module-mongo 依赖项添加到pom.xml中。但这并没有改变任何事情。

在Mule项目中,具有相同模式声明的相同配置工作正常。我在这里想念一下吗?

1 个答案:

答案 0 :(得分:1)

问题是Mongo不支持作为共享资源,因此您无法在域级别定义它的配置。

您可以找到有关支持哪些连接器的更多信息here

HTH