oltoko
oltoko

Reputation: 25

org.xml.sax.SAXParseException: Failed to read schema document mule-mongo.xsd in mule-domain-config

I migrate resources from different Mule Projects to one Mule Domain Project (which should be used by all the other Mule Projects). Everything works fine except the configuration for the mongodb. If I start everything and the domain starts initialization I get the following error:

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

See the corresponding 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>

My first idea was, that I need to add the mule-module-mongo dependency to the pom.xml. But this didn't change anything.

In the Mule Projects the same configuration, with the same schema declaration work just fine. Do I miss something here?

Upvotes: 0

Views: 588

Answers (1)

afelisatti
afelisatti

Reputation: 2835

The problem is that Mongo is not supported as a shared resource so you cannot define it's config at the domain level.

You can find more information on what connectors are supported here.

HTH

Upvotes: 1

Related Questions