ERROR 2020-04-30 16:08:04,036 [WrapperListener_start_runner] org.mule.runtime.module.deployment.internal.DefaultArchiveDeployer: Failed to deploy artifact [testcustom]
org.mule.runtime.deployment.model.api.DeploymentException: Failed to deploy artifact [testcustom]
Caused by: org.mule.runtime.api.exception.MuleRuntimeException: org.mule.runtime.deployment.model.api.DeploymentInitException: MuleRuntimeException: There was '1' error while parsing the given file 'testcustom.xml'.
Full list:
org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 108; cvc-complex-type.2.4.a: Invalid content was found starting with element 'basic:sayHi'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-exception-strategy}' is expected.
Caused by: org.mule.runtime.deployment.model.api.DeploymentInitException: MuleRuntimeException: There was '1' error while parsing the given file 'testcustom.xml'.
Full list:
org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 108; cvc-complex-type.2.4.a: Invalid content was found starting with element 'basic:sayHi'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-exception-strategy}' is expected.
Caused by: org.mule.runtime.core.api.config.ConfigurationException: There was '1' error while parsing the given file 'testcustom.xml'.
Full list:
org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 108; cvc-complex-type.2.4.a: Invalid content was found starting with element 'basic:sayHi'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-exception-strategy}' is expected.
Caused by: org.mule.runtime.api.exception.MuleRuntimeException: There was '1' error while parsing the given file 'testcustom.xml'.
Full list:
org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 108; cvc-complex-type.2.4.a: Invalid content was found starting with element 'basic:sayHi'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-exception-strategy}' is expected.
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd"></mule>To
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="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"> <http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="fdb33276-fd19-4862-b557-6608b0c9f9dd" > <http:listener-connection host="0.0.0.0" port="8081" /> </http:listener-config> </mule>Note: the HTTP namespace and corresponding schemaLocation are added automatically.
<dependency> <groupId>org.mule.connectors</groupId> <artifactId>mule-http-connector</artifactId> <version>1.5.11</version> <classifier>mule-plugin</classifier> </dependency>
Occasionally, the pom file may get corrupted due to manual editing.
Step 3: Check deployed Mule application
When we export a Mule Application as a deployable jar, the dependencies will be added into a generated jar file which will contain the repository directory with all the dependencies added in the pom file.
When deploying aMule application to Mule runtime, the jar file is unzipped and the application structure can be checked.
Sample of unzipped deployable Mule Application repository directory
repository
├── com...
└── org
└── mule
├── connectors
... ├── mule-http-connector
│ └── 1.5.11
│ ├── classloader-model.json
│ └── mule-http-connector-1.5.11-mule-plugin.jar
└── mule-sockets-connector
└── 1.1.5
├── classloader-model.json
└── mule-sockets-connector-1.1.5-mule-plugin.jar
If the corresponding module jar file (mule-http-connector-1.5.11-mule-plugin.jar) is missing from the repository folder, the deployment will fail.When above steps seem good we need to further check the underlying module content to find out the root cause.
Mule Runtime loads the module via the Extension API and uses the XML file called "{module}-extension-model.xml" which resides in the module META-INF folder to generate the corresponding schema file used in the Mule configuration file.
"Invalid content was found starting with element" error can be seen when we upgrade a module version (i.e. http connector 1.5.11 to 1.6.0) without changing the Mule configuration XML or using a custom module with incorrect extension module generated.
With http:listener-config example defined at step 1, if the HTTP Connector Listener configuration was changed to http:listener-configuration accidentally as below:
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="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"> <http:listener-configuration name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="fdb33276-fd19-4862-b557-6608b0c9f9dd" > <http:listener-connection host="0.0.0.0" port="8081" /> </http:listener-configuration>
Unzip the HTTP Connector jar file confirmed at step 3 will have the following directory structure. We only need to check http-extension-descriptions.xml
├── META-INF
│ ├── http-extension-descriptions.xml
│ ├── maven
│ │ └── org.mule.connectors
│ │ └── mule-http-connector
│ │ └── pom.xml
│ ├── mime.types
│ ├── mule-artifact
│ │ ├── icon.svg
│ │ └── mule-artifact.json
│ └── org
│ └── mule
│ └── runtime
│ └── core
| *classes files
└── org
└── mule
└── extension
└── http
├── api
└── internal
Opening http-extension-descriptions.xml shows the following XML snippet under <extension-documentation>-<configs>
<config name="listenerConfig">
<description><![CDATA[Configuration element for a HttpListener.]]></description>
<parameters>
<parameter name="basePath">
<description><![CDATA[Base path to use for all requests that reference this config.]]></description>
</parameter>
<parameter name="listenerInterceptors">
<description><![CDATA[Listener interceptors that will apply on request and on response events.]]></description>
</parameter>
</parameters>
</config>
We find that the configuration name is defined as listenerConfig in the extension model. As Mule configuration XML uses lower case with hyphen style rather than CamelCase style naming convention so the correct name in Mule configuration should be listener-config. But cross checking the mule configuration XML, it shows http:listener-configuration, this is incorrect as there is no definition for listener-configuration in the http-extension-descriptions.xml. Correct it to listener-config and the deployment error will be fixed.
In reality, this last issue may happen due to an updated HTTP Connector XML declaration. For example, if the http listener configuration extension model changes from listenerConfig to listenerConfiguration. It could happen in both ways, manual editing of the Mule Configuration, or edit of the extension model.
This step can be used for addressing typical module updates issues such as Application fails to deploy with an "Invalid content was found starting with element 'reconnect'" error.
Mule Module Structure
FOR MULE 3 - Getting "org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'xxxxx'"
001117206

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.