title: Mule / Maven Error: Invalid content was found starting with element 'dw:transform-message'
body: <p>I'm trying to run a project with Maven, using a simple test class, however the test is erroring out (not failing!) with the message:</p>
  
  <blockquote>
    <h2>Test set: com.mycompany.myproject.testApiResponseNotNullTestCase</h2>
    
    <p>Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.423 sec &lt;&lt;&lt; FAILURE! - in com.mycompany.myproject.testApiResponseNotNullTestCase
    clientTestCase(com.mycompany.myproject.testApiResponseNotNullTestCase)  Time elapsed: 3.084 sec  &lt;&lt;&lt; ERROR!
     org.mule.api.config.ConfigurationException: Line 34 in XML document from URL [file:/C:/Users/myuser/Documents/.../dev/Mule%20Workspaces/myproject/myproject/target/test-classes/myproject.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 111; cvc-complex-type.2.4.a: Invalid content was found starting with element 'dw:transform-message'. One of '{"<a href="http://www.mulesoft.org/schema/mule/core" rel="nofollow noreferrer">http://www.mulesoft.org/schema/mule/core</a>":abstract-message-processor, "<a href="http://www.mulesoft.org/schema/mule/core" rel="nofollow noreferrer">http://www.mulesoft.org/schema/mule/core</a>":abstract-outbound-endpoint, "<a href="http://www.mulesoft.org/schema/mule/core" rel="nofollow noreferrer">http://www.mulesoft.org/schema/mule/core</a>":abstract-mixed-content-message-processor, "<a href="http://www.mulesoft.org/schema/mule/core" rel="nofollow noreferrer">http://www.mulesoft.org/schema/mule/core</a>":response, "<a href="http://www.mulesoft.org/schema/mule/core" rel="nofollow noreferrer">http://www.mulesoft.org/schema/mule/core</a>":legacy-abstract-exception-strategy, "<a href="http://www.mulesoft.org/schema/mule/core" rel="nofollow noreferrer">http://www.mulesoft.org/schema/mule/core</a>":abstract-message-info-mapping}' is expected. (org.mule.api.lifecycle.InitialisationException)
    Caused by: org.mule.api.lifecycle.InitialisationException: Line 34 in XML document from URL [file:/C:/Users/myuser/Documents/.../dev/Mule%20Workspaces/myproject/myproject/target/test-classes/myproject.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 111; cvc-complex-type.2.4.a: Invalid content was found starting with element 'dw:transform-message'.</p>
  </blockquote>
  
  <p>I have already tried to fix this by adding the following to my pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
     &lt;groupId&gt;com.mulesoft.weave&lt;/groupId&gt;
     &lt;artifactId&gt;mule-plugin-weave&lt;/artifactId&gt;
     &lt;version&gt;4.0.0-M4&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>It seems odd (or maybe exactly as expected!?) that all the other items mentioned after "expected" appear in the schema and <code>dw:transform-message</code> doesn't... but this is the XML generated by Anypoint Studio AFAIK.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" 
   xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:context="http://www.springframework.org/schema/context" 
   xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" 
   xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns="http://www.mulesoft.org/schema/mule/core" 
   xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
   xmlns:spring="http://www.springframework.org/schema/beans" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
  http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
  http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
  http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
  http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
  http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd
  http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd"&gt;
      &lt;db:generic-config name="LocalDev_SqlServerConfig" url="jdbc:sqlserver://${mssql.server}:${mssql.port};databaseName=${mssql.database};user=${mssql.user};password=${mssql.password}" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" doc:name="Generic Database Configuration"/&gt;
  
      &lt;http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="${http.port}" basePath="/api" doc:name="HTTP Listener Configuration"/&gt;
      &lt;db:generic-config name="GenericMsSqlDbConnection" url="jdbc:sqlserver://${db.server}:${db.port};databaseName=${db.database};user=${db.user};password=${db.password}" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" doc:name="Generic Database Configuration"/&gt;
      &lt;context:property-placeholder location="main-${env}.properties"/&gt;
      &lt;flow name="mainFlow"&gt;
          &lt;http:listener config-ref="HTTP_Listener_Configuration" path="/test" allowedMethods="GET" doc:name="HTTP"&gt;
              &lt;http:response-builder statusCode="200" reasonPhrase="OK"/&gt;
              &lt;http:error-response-builder statusCode="500" reasonPhrase="Internal server error"/&gt;
          &lt;/http:listener&gt;
          &lt;set-property propertyName="currentDate" value="#[server.dateTime.getDayOfMonth() +&amp;quot;/&amp;quot;+ server.dateTime.getMonth() +&amp;quot;/&amp;quot; +server.dateTime.getYear()]" doc:name="Set Date Property"/&gt;
          &lt;set-property propertyName="hostname" value="#[server.host]" doc:name="Set Server Property"/&gt;
          &lt;logger message="Set property &amp;quot;currentDate&amp;quot; to #[message.outboundProperties.currentDate]" level="INFO" doc:name="Logger"/&gt;
          &lt;db:select config-ref="GenericMsSqlDbConnection" doc:name="Database"&gt;
              &lt;db:parameterized-query&gt;&lt;![CDATA[SELECT COUNT(*) AS OpportunityCount FROM vwOppsAnon1]]&gt;&lt;/db:parameterized-query&gt;
          &lt;/db:select&gt;
          &lt;dw:transform-message metadata:id="480debf4-819f-4927-90ae-382a17489221" doc:name="Transform Message"&gt;
              &lt;dw:set-payload&gt;&lt;![CDATA[%dw 1.0
  %output application/json
  ---
  payload map ((payload01 , indexOfPayload01) -&gt; {
   opportunityCount: payload01.OpportunityCount,
   date: outboundProperties.currentDate as :string,
   server: outboundProperties.hostname
  })]]&gt;&lt;/dw:set-payload&gt;
          &lt;/dw:transform-message&gt;
      &lt;/flow&gt;
  &lt;/mule&gt;</code></pre>
  </div>
  </div>
  </p>