在src / main / resources中写入文件时,Mule4文件写入连接器问题

时间:2019-04-22 11:34:50

标签: file mule4

尝试使用mule4写入文件连接器将json负载写入``src / main / resources''文件夹,如果我将工作目录命名为``src / main / resources'',文件名命名为``file.json'',则试图写进 D:\Deployment\anypoint-7\AnypointStudio\plugins\org.mule.tooling.server.4.1.5.ee_7.3.1.201903081734\mule\bin\

文件应该写在src / main / resources项目文件夹中,而不是plugin \ runtime \ bin。

请指导

2 个答案:

答案 0 :(得分:0)

它应该包含整个路径。

  

C:\“您的工作空间” \“项目名称” \ src \ main \ resources \ file.json

最好在connector-config中使用地址,而在路径中只使用文件名。尽管不是强制性的,但连接器配置需要避免以下警告。

  

WARN [[MuleRuntime] .io.04:   [multiplelookup] .io @ org.mule.runtime.module.extension.internal.runtime.config.LifecycleAwareConfigurationInstance.testConnectivity:186   @ 23d7d97e] [事件:]   org.mule.extension.file.internal.LocalFileConnectionProvider:文件   连接器“ config”未指定workingDir属性。   默认为“ C:\ Users \ yourUser”

答案 1 :(得分:0)

您的运行时是一个单独的Java实例,该实例在您环境中的D:\ Deployment \ anypoint-7 \ AnypointStudio \ plugins \ org.mule.tooling.server.4.1.5.ee_7.3.1.201903081734 \ mule中运行。 / p>

Runttime不了解Studio工作区。您必须指定需要写入文件的位置的真实路径。

https://simpleflatservice.com/mule4/FileNamesAndLocations.html