0
votes

I'm trying to implement mule publish-subscribe module. I got following error:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'pubsub:config'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":description, "http://www.springframework.org/schema/beans":beans, "http://www.springframework.org/schema/beans":bean, "http://www.springframework.org/schema/context":property-placeholder, "http://www.springframework.org/schema/beans":ref, "http://www.mulesoft.org/schema/mule/core":global-property, "http://www.mulesoft.org/schema/mule/core":configuration, "http://www.mulesoft.org/schema/mule/core":notifications, "http://www.mulesoft.org/schema/mule/core":abstract-extension, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-extension, "http://www.mulesoft.org/schema/mule/core":abstract-agent, "http://www.mulesoft.org/schema/mule/core":abstract-security-manager, "http://www.mulesoft.org/schema/mule/core":abstract-transaction-manager, "http://www.mulesoft.org/schema/mule/core":abstract-connector, "http://www.mulesoft.org/schema/mule/core":abstract-global-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-exception-strategy, "http://www.mulesoft.org/schema/mule/core":abstract-flow-construct, "http://www.mulesoft.org/schema/mule/core":flow, "http://www.mulesoft.org/schema/mule/core":sub-flow, "http://www.mulesoft.org/schema/mule/core":abstract-model, "http://www.mulesoft.org/schema/mule/core":abstract-interceptor-stack, "http://www.mulesoft.org/schema/mule/core":abstract-filter, "http://www.mulesoft.org/schema/mule/core":abstract-transformer, "http://www.mulesoft.org/schema/mule/core":processor-chain, "http://www.mulesoft.org/schema/mule/core":custom-processor, "http://www.mulesoft.org/schema/mule/core":invoke, "http://www.mulesoft.org/schema/mule/core":abstract-global-intercepting-message-processor, "http://www.mulesoft.org/schema/mule/core":custom-queue-store, "http://www.mulesoft.org/schema/mule/core":abstract-processing-strategy}' is expected.

Looks like, it's complaining about element

My Code:

    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="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:vm="http://www.mulesoft.org/schema/mule/vm"
    xmlns:pubsub="http://www.mulesoft.org/schema/mule/pubsub"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
    http://www.mulesoft.org/schema/mule/pubsub http://www.mulesoft.org/schema/mule/pubsub/current/mule-pubsub.xsd">
    <pubsub:config name="my-config"/>
    <flow name="testListenerTopicA">
    <pubsub:listener config-ref="my-config" topic="topic-A"/>
    <logger level="INFO" message="Received an event for topic A with payload #[payload]"/>
    </flow>
    <flow name="testListenerTopicB">
    <logger level="INFO" message="Received an event for topic B with payload #[payload]"/>
    </flow>
    <flow name="testPublisherTopicA">
    <pubsub:publish config-ref="my-config" topic="topic-A"/>
    </flow>
    <flow name="testPublisherTopicB">
    <pubsub:publish config-ref="my-config" topic="topic-B"/>
    </flow>
    <flow name="testSubscribeTopicB">
    <pubsub:subscribe config-ref="my-config" topic="topic-B" subscriberId="123" flow-ref="testListenerTopicB"/>
    </flow>
    <flow name="testUnsubscribeTopicB">
    <pubsub:unsubscribe config-ref="my-config" topic="topic-B" subscriberId="123"/>
    </flow>
    </mule>

I would appreciate any help.

1
Where is the schema-definition section of your mule-config.xml?user1760178
I didn't add it earlier. Now I've updated post with schema definition.Neel

1 Answers

0
votes

Probably you didn't add the module to the project. It doesn't get add to the build and then Mule can not find the definitions for the elements.