尝试部署Mule项目时密钥库格式无效

尝试部署Mule项目时密钥库格式无效,mule,mule-studio,Mule,Mule Studio,我只是想学习一些Mulesoft教程,看看我能不能弄清楚它们是如何工作的。本教程演示了IMAP的用法以及如何使用IMAP从电子邮件中获取信息 我目前正在使用,效果很好。然后我做了一些改变,看看事情是如何运作的。我有一个简单的流程,如下所示: <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:emai

我只是想学习一些Mulesoft教程,看看我能不能弄清楚它们是如何工作的。本教程演示了IMAP的用法以及如何使用IMAP从电子邮件中获取信息

我目前正在使用,效果很好。然后我做了一些改变,看看事情是如何运作的。我有一个简单的流程,如下所示:

 <?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:email="http://www.mulesoft.org/schema/mule/email" version="EE-3.6.0" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:context="http://www.springframework.org/schema/context" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:imap="http://www.mulesoft.org/schema/mule/imap" xmlns:imaps="http://www.mulesoft.org/schema/mule/imaps" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
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/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/imap http://www.mulesoft.org/schema/mule/imap/current/mule-imap.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd
http://www.mulesoft.org/schema/mule/imaps http://www.mulesoft.org/schema/mule/imaps/current/mule-imaps.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/email http://www.mulesoft.org/schema/mule/email/current/mule-email.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd">


    <imaps:connector checkFrequency="100" doc:name="IMAP" name="imapsConnector" validateConnections="true">
        <imaps:tls-client path="" storePassword=""/>
        <imaps:tls-trust-store path="" storePassword=""/>        
    </imaps:connector>


    <flow name="imap-to-csvFlow1">
        <imaps:inbound-endpoint connector-ref="imapsConnector" doc:name="Poll emails" host="imap.gmail.com" password="samplepass" port="993" responseTimeout="10000" user="sampleuser%40gmail.com"/>
        <email:email-to-string-transformer doc:name="Email to String"/>
        <logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
    </flow>
</mule>
IMAP->向字符串发送电子邮件->记录器

XML如下所示:

 <?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:email="http://www.mulesoft.org/schema/mule/email" version="EE-3.6.0" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:context="http://www.springframework.org/schema/context" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:imap="http://www.mulesoft.org/schema/mule/imap" xmlns:imaps="http://www.mulesoft.org/schema/mule/imaps" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
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/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/imap http://www.mulesoft.org/schema/mule/imap/current/mule-imap.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd
http://www.mulesoft.org/schema/mule/imaps http://www.mulesoft.org/schema/mule/imaps/current/mule-imaps.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/email http://www.mulesoft.org/schema/mule/email/current/mule-email.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd">


    <imaps:connector checkFrequency="100" doc:name="IMAP" name="imapsConnector" validateConnections="true">
        <imaps:tls-client path="" storePassword=""/>
        <imaps:tls-trust-store path="" storePassword=""/>        
    </imaps:connector>


    <flow name="imap-to-csvFlow1">
        <imaps:inbound-endpoint connector-ref="imapsConnector" doc:name="Poll emails" host="imap.gmail.com" password="samplepass" port="993" responseTimeout="10000" user="sampleuser%40gmail.com"/>
        <email:email-to-string-transformer doc:name="Email to String"/>
        <logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
    </flow>
</mule>
完整的控制台日志显然更广泛一些,但这是出现的第一个错误。

如果使用IMAP(与IMAP相反),则需要为TLS客户端和信任存储提供有效值

例如:

<imaps:tls-client path="clientKeystore" storePassword="mulepassword" /> 
<imaps:tls-trust-store path="greenmail-truststore" storePassword="password" />

电子邮件传输集成测试具有现成的密钥库,您可以使用这些密钥库:


参考:

如果我删除IMAPS支持,我会收到一个错误,说明:“元素:tls信任存储不允许是元素IMAP的子级”正确,IMAP不需要tls。