Mule
  1. Mule
  2. MULE-5587

file:outbound-endpoint produces trash content

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 3.1.1
    • Fix Version/s: None
    • Component/s: Modules: (other)
    • Labels:
      None
    • Environment:

      MacOS 10.6
      Java(TM) SE Runtime Environment (build 1.6.0_24-b07-345)

    • User impact:
      Medium
    • Configuration:
      Hide

      <?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:mongodb="http://www.mulesoft.org/schema/mule/mongodb"
      xmlns:git="http://www.mulesoft.org/schema/mule/git"
      xmlns:maven="http://www.mulesoft.org/schema/mule/maven"
      xmlns:freemarker="http://www.mulesoft.org/schema/mule/freemarker"
      xmlns:json="http://www.mulesoft.org/schema/mule/json"
      xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty"
      xmlns:file="http://www.mulesoft.org/schema/mule/file"
      xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
      xsi:schemaLocation="
      http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
      http://www.mulesoft.org/schema/mule/mongodb http://www.mulesoft.org/schema/mule/mongodb/3.1/mule-mongodb.xsd
      http://www.mulesoft.org/schema/mule/git http://www.mulesoft.org/schema/mule/git/1.2/mule-git.xsd
      http://www.mulesoft.org/schema/mule/maven http://www.mulesoft.org/schema/mule/maven/1.0/mule-maven.xsd
      http://www.mulesoft.org/schema/mule/freemarker http://www.mulesoft.org/schema/mule/freemarker/1.0/mule-freemarker.xsd
      http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/3.1/mule-json.xsd
      http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
      http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd
      http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/3.1/mule-jetty.xsd">

      <description>
      JavaDoc as a Service
      </description>

      <git:config directory="/tmp"/>
      <maven:config directory="/tmp"/>

      <mongodb:connector name="mongohq"
      database="jaas"
      username="jaas"
      password="jaas"
      hostname="flame.mongohq.com:27081"
      pollingFrequency="600000"/>

      <jetty:connector name="fileServer" configFile="jetty-config.xml"/>

      <file:connector name="output" outputAppend="false"/>

      <flow name="updateRepositories">
      <mongodb:inbound-endpoint collection="repositories"/>
      <splitter evaluator="json" expression=""/>
      <flow-ref name="generateDocForRepository"/>
      <collection-aggregator/>
      <logger level="INFO" message="#[payload]"/>
      <object-to-string-transformer/>
      <json:json-to-object-transformer returnClass="org.mule.tools.jaas.Repository[]"/>
      <flow-ref name="generateIndex"/>
      </flow>

      <flow name="generateIndex">
      <logger message="Generating home page" level="INFO"/>
      <freemarker:transformer template-file="index.ftl"/>
      <logger level="INFO"/>
      <logger level="INFO" message="#[payload]"/>
      <file:outbound-endpoint connector-ref="output" path="/tmp/documentation"
      outputPattern="index.html"/>
      <!--
      <scripting:component>
      <scripting:script engine="groovy">
      def index = new File("/tmp/documentation/index.html")
      index.write(payload)
      index.close
      </scripting:script>
      </scripting:component>
      -->
      </flow>

      <flow name="generateDocForRepository">
      <logger message="Processing #[json:name] repository" level="INFO"/>
      <message-properties-transformer>
      <add-message-property key="directory" value="#[string:#[string:/tmp/repositories/]#[json:name]]"/>
      <add-message-property key="docDir" value="#[string:#[string:/tmp/documentation/]#[json:name]]"/>
      </message-properties-transformer>
      <choice>
      <when expression='(new File(message.getProperty("directory"))).exists()' evaluator="groovy">
      <logger message="Pulling master into #[header:directory]" level="INFO"/>
      <git:fetch overrideDirectory="#[header:directory]"/>
      </when>
      <otherwise>
      <logger message="Cloning #[json:uri] into #[header:directory]" level="INFO"/>
      <git:clone overrideDirectory="#[header:directory]" uri="#[json:uri]"/>
      </otherwise>
      </choice>
      <logger message="Generating documentation for #[json:name]" level="INFO"/>
      <maven:execute-goal goal="javadoc:javadoc" overrideDirectory="#[header:directory]">
      <maven:properties>
      <maven:property key="reportOutputDirectory" value="#[header:docDir]"/>
      </maven:properties>
      </maven:execute-goal>
      </flow>
      </mule>

      Show
      <?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:mongodb="http://www.mulesoft.org/schema/mule/mongodb" xmlns:git="http://www.mulesoft.org/schema/mule/git" xmlns:maven="http://www.mulesoft.org/schema/mule/maven" xmlns:freemarker="http://www.mulesoft.org/schema/mule/freemarker" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd http://www.mulesoft.org/schema/mule/mongodb http://www.mulesoft.org/schema/mule/mongodb/3.1/mule-mongodb.xsd http://www.mulesoft.org/schema/mule/git http://www.mulesoft.org/schema/mule/git/1.2/mule-git.xsd http://www.mulesoft.org/schema/mule/maven http://www.mulesoft.org/schema/mule/maven/1.0/mule-maven.xsd http://www.mulesoft.org/schema/mule/freemarker http://www.mulesoft.org/schema/mule/freemarker/1.0/mule-freemarker.xsd http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/3.1/mule-json.xsd http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/3.1/mule-jetty.xsd "> <description> JavaDoc as a Service </description> <git:config directory="/tmp"/> <maven:config directory="/tmp"/> <mongodb:connector name="mongohq" database="jaas" username="jaas" password="jaas" hostname="flame.mongohq.com:27081" pollingFrequency="600000"/> <jetty:connector name="fileServer" configFile="jetty-config.xml"/> < file:connector name="output" outputAppend="false"/> <flow name="updateRepositories"> <mongodb:inbound-endpoint collection="repositories"/> <splitter evaluator="json" expression=""/> <flow-ref name="generateDocForRepository"/> <collection-aggregator/> <logger level="INFO" message="# [payload] "/> <object-to-string-transformer/> <json:json-to-object-transformer returnClass="org.mule.tools.jaas.Repository[]"/> <flow-ref name="generateIndex"/> </flow> <flow name="generateIndex"> <logger message="Generating home page" level="INFO"/> <freemarker:transformer template-file="index.ftl"/> <logger level="INFO"/> <logger level="INFO" message="# [payload] "/> < file:outbound-endpoint connector-ref="output" path="/tmp/documentation" outputPattern="index.html"/> <!-- <scripting:component> <scripting:script engine="groovy"> def index = new File("/tmp/documentation/index.html") index.write(payload) index.close </scripting:script> </scripting:component> --> </flow> <flow name="generateDocForRepository"> <logger message="Processing # [json:name] repository" level="INFO"/> <message-properties-transformer> <add-message-property key="directory" value="#[string:# [string:/tmp/repositories/] # [json:name] ]"/> <add-message-property key="docDir" value="#[string:# [string:/tmp/documentation/] # [json:name] ]"/> </message-properties-transformer> <choice> <when expression='(new File(message.getProperty("directory"))).exists()' evaluator="groovy"> <logger message="Pulling master into # [header:directory] " level="INFO"/> <git:fetch overrideDirectory="# [header:directory] "/> </when> <otherwise> <logger message="Cloning # [json:uri] into # [header:directory] " level="INFO"/> <git:clone overrideDirectory="# [header:directory] " uri="# [json:uri] "/> </otherwise> </choice> <logger message="Generating documentation for # [json:name] " level="INFO"/> <maven:execute-goal goal="javadoc:javadoc" overrideDirectory="# [header:directory] "> <maven:properties> <maven:property key="reportOutputDirectory" value="# [header:docDir] "/> </maven:properties> </maven:execute-goal> </flow> </mule>
    • Log Output:
      Hide
      INFO 2011-05-26 15:08:35,348 [[mule-jaas-1.0-SNAPSHOT].flow.updateRepositories.1] org.mule.api.processor.LoggerMessageProcessor: Generating home page
      INFO 2011-05-26 15:08:35,372 [[mule-jaas-1.0-SNAPSHOT].flow.updateRepositories.1] org.mule.api.processor.LoggerMessageProcessor:
      org.mule.DefaultMessageCollection
      {
        id=2c55fc77-87c3-11e0-8a5d-9d0eb4874d8e
        payload=java.lang.String
        correlationId=1dd389ea-87c3-11e0-8a5d-9d0eb4874d8e
        correlationGroup=-1
        correlationSeq=-1
        encoding=UTF-8
        exceptionPayload=<not set>

      Message properties:
        INVOCATION scoped properties:
        INBOUND scoped properties:
        OUTBOUND scoped properties:
          Content-Type=text/plain;charset=UTF-8
          MULE_CORRELATION_ID=1dd389ea-87c3-11e0-8a5d-9d0eb4874d8e
        SESSION scoped properties:
      }
      INFO 2011-05-26 15:08:35,372 [[mule-jaas-1.0-SNAPSHOT].flow.updateRepositories.1] org.mule.api.processor.LoggerMessageProcessor: <html>
          <body>
              <ul>
                              <li><a href="/s3-connector/apidocs">s3-connector</a></li>
                  <li><a href="/pubnub-connector/apidocs">pubnub-connector</a></li>
                  <li><a href="/git-connector/apidocs">git-connector</a></li>
                  <li><a href="/maven-connector/apidocs">maven-connector</a></li>
                  <li><a href="/salesforce-connector/apidocs">salesforce-connector</a></li>
                  <li><a href="/hostip-connector/apidocs">hostip-connector</a></li>
              </ul>
          </body>
      </html>
      INFO 2011-05-26 15:08:35,391 [[mule-jaas-1.0-SNAPSHOT].output.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'output.dispatcher.187514477'. Object is: FileMessageDispatcher
      INFO 2011-05-26 15:08:35,392 [[mule-jaas-1.0-SNAPSHOT].output.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'output.dispatcher.187514477'. Object is: FileMessageDispatcher
      INFO 2011-05-26 15:08:35,394 [[mule-jaas-1.0-SNAPSHOT].output.dispatcher.1] org.mule.transport.file.FileConnector: Writing file to: /private/tmp/documentation/index.html
      Show
      INFO 2011-05-26 15:08:35,348 [[mule-jaas-1.0-SNAPSHOT].flow.updateRepositories.1] org.mule.api.processor.LoggerMessageProcessor: Generating home page INFO 2011-05-26 15:08:35,372 [[mule-jaas-1.0-SNAPSHOT].flow.updateRepositories.1] org.mule.api.processor.LoggerMessageProcessor: org.mule.DefaultMessageCollection {   id=2c55fc77-87c3-11e0-8a5d-9d0eb4874d8e   payload=java.lang.String   correlationId=1dd389ea-87c3-11e0-8a5d-9d0eb4874d8e   correlationGroup=-1   correlationSeq=-1   encoding=UTF-8   exceptionPayload=<not set> Message properties:   INVOCATION scoped properties:   INBOUND scoped properties:   OUTBOUND scoped properties:     Content-Type=text/plain;charset=UTF-8     MULE_CORRELATION_ID=1dd389ea-87c3-11e0-8a5d-9d0eb4874d8e   SESSION scoped properties: } INFO 2011-05-26 15:08:35,372 [[mule-jaas-1.0-SNAPSHOT].flow.updateRepositories.1] org.mule.api.processor.LoggerMessageProcessor: <html>     <body>         <ul>                         <li><a href="/s3-connector/apidocs">s3-connector</a></li>             <li><a href="/pubnub-connector/apidocs">pubnub-connector</a></li>             <li><a href="/git-connector/apidocs">git-connector</a></li>             <li><a href="/maven-connector/apidocs">maven-connector</a></li>             <li><a href="/salesforce-connector/apidocs">salesforce-connector</a></li>             <li><a href="/hostip-connector/apidocs">hostip-connector</a></li>         </ul>     </body> </html> INFO 2011-05-26 15:08:35,391 [[mule-jaas-1.0-SNAPSHOT].output.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'output.dispatcher.187514477'. Object is: FileMessageDispatcher INFO 2011-05-26 15:08:35,392 [[mule-jaas-1.0-SNAPSHOT].output.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'output.dispatcher.187514477'. Object is: FileMessageDispatcher INFO 2011-05-26 15:08:35,394 [[mule-jaas-1.0-SNAPSHOT].output.dispatcher.1] org.mule.transport.file.FileConnector: Writing file to: /private/tmp/documentation/index.html
    • Similar Issues:
      MULE-1161Regression in Content-Type of Axis SOAP messages
      MULE-7197Producer interface should not be tied to List<T>
      MULE-176Caching of Jms consumers and producers should be configurable
      MULE-5798Incorrect mail parsing with nested multipart
      MULE-4585Exception handling - file routing
      MULE-6617First successful not working when used with inputstream based transports
      MULE-5523Using dynamic endpoint produce error when using async response
      MULE-5606Mule 3: Multicasting router with File outbound end-point no exchange-pattern flag
      MULE-6236Unable to set content-type on RestServiceWrapper
      MULE-210geronimo-spec-j2ee.jar produces conflict on Tomcat 5.x

      Description

      Under some weird circumstance file:outbound-endpoint writes trash content to files.

      Please find attached the example configuration as mule-config.xml, also a full ZIP containing the Mule application and all of its dependencies in mule-app.zip.

      Also I added too the output file as index.html.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Emiliano Lesende
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development