【发布时间】:2020-11-19 15:00:24
【问题描述】:
我正在尝试将 JSON 转换为 pdf 文件,但是当我尝试打开文件时,mule 4(运行时 4.2.1)中出现“加载 PDF 文档失败”错误。 我该如何解决这个问题?
代码:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
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://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="79ef9cde-39c4-449a-8cac-9aeb3be30c27" >
<http:listener-connection host="0.0.0.0" port="8084" />
</http:listener-config>
<file:config name="File_Config" doc:name="File Config" doc:id="d67cbdb7-3bc8-4f04-8d7f-862c539f5f3f" >
<file:connection workingDir="D:\Devendra\workspace_dev\mule4\pdf\src\main\resources\pdf" />
</file:config>
<flow name="pdfFlow" doc:id="eaef4b93-c6f1-4e01-9df3-93e2ba2dcba4" >
<http:listener doc:name="Listener" doc:id="1407afe8-dbea-4f67-8514-29b8039c5638" config-ref="HTTP_Listener_config" path="/pdf"/>
<set-payload value="#[payload]" doc:name="Set Payload" doc:id="a250f9a4-c633-4ce1-a75d-8668d2dede10" mimeType="application/json"/>
<file:write doc:name="Write" doc:id="ca2c47a2-924d-445a-8ca1-7de6197cd583" path="test.pdf" config-ref="File_Config"/>
<logger level="INFO" doc:name="Logger" doc:id="0c629051-500e-4bc0-82b4-74b6c79ec567" message="#[payload]"/>
</flow>
</mule>
【问题讨论】:
-
该错误似乎并不完整,或者可能不是 Mule 的错误?请将日志中的完整错误消息添加到问题中。
标签: mule mule-studio mulesoft mule-esb mule4