首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mule SSL连接器中的协议

Mule SSL连接器中的协议
EN

Stack Overflow用户
提问于 2014-07-23 17:38:07
回答 1查看 523关注 0票数 0

我试图在Mule中使用带有SSL连接器的cutom协议。我指的是这个骡子文档骡子SSL引用。但是,当我试图在连接器中添加协议时,它会给出以下错误

代码语言:javascript
复制
   cvc-complex-type.2.4.a: Invalid content was found starting with element 'tcp:custom-protocol'. One of '{"http://www.mulesoft.org/schema/mule/ssl":protocol-handler}' is expected.

这是我的连接器配置

代码语言:javascript
复制
   <ssl:connector name="SSL__TLS_" validateConnections="false"
   sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0"
  clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0"
 doc:name="SSL (TLS)">
 <ssl:client path="C:\cert\client.cer" storePassword="password1" />
 <ssl:key-store path="C:\cert\keystore.jks" keyPassword="password1"
 storePassword="password1" />
 <ssl:server path="C:\cert\truststore.ts" storePassword="password1" />
 <tcp:custom-protocol rethrowExceptionOnRead="true"
 class="com.mycompany.protocols.CustomProtocol" />
</ssl:connector>

当我添加协议处理程序标记时,它仍然给了我一些错误。

代码语言:javascript
复制
    Invalid content was found starting with element 'tcp:custom-protocol'. No child element is expected at this point.

就我所读到的协议处理程序而言,我发现包含协议类的是包名。

有人能帮我吗。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-23 20:44:49

我认为问题在于连接器中元素的顺序,请尝试如下:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp"
    xmlns:ssl="http://www.mulesoft.org/schema/mule/ssl" xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:tls="http://www.mulesoft.org/schema/mule/tls" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
    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/ssl http://www.mulesoft.org/schema/mule/ssl/current/mule-ssl.xsd
http://www.mulesoft.org/schema/mule/tls http://www.mulesoft.org/schema/mule/tls/3.4/mule-tls.xsd
http://www.mulesoft.org/schema/mule/tcp http://www.mulesoft.org/schema/mule/tcp/current/mule-tcp.xsd">

    <ssl:connector name="SSL__TLS_" validateConnections="false"
        sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0"
        clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0"
        doc:name="SSL (TLS)">
        <tcp:custom-protocol rethrowExceptionOnRead="true"
            class="com.mycompany.protocols.CustomProtocol" />
        <ssl:client path="C:\cert\client.cer" storePassword="password1" />
        <ssl:key-store path="C:\cert\keystore.jks" keyPassword="password1"
            storePassword="password1" />
        <ssl:server path="C:\cert\truststore.ts" storePassword="password1" />
        <ssl:protocol-handler property="com.mycompany.protocols" />
    </ssl:connector>

    <flow name="mule-sslFlow1" doc:name="mule-sslFlow1">
        <ssl:inbound-endpoint host="localhost" port="80"
            responseTimeout="10000" doc:name="SSL (TLS)" exchange-pattern="request-response" />
        <logger level="INFO" doc:name="Logger" />
    </flow>
</mule>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24917241

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档