我试图在Mule中使用带有SSL连接器的cutom协议。我指的是这个骡子文档骡子SSL引用。但是,当我试图在连接器中添加协议时,它会给出以下错误
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.这是我的连接器配置
<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>当我添加协议处理程序标记时,它仍然给了我一些错误。
Invalid content was found starting with element 'tcp:custom-protocol'. No child element is expected at this point.就我所读到的协议处理程序而言,我发现包含协议类的是包名。
有人能帮我吗。
发布于 2014-07-23 20:44:49
我认为问题在于连接器中元素的顺序,请尝试如下:
<?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>https://stackoverflow.com/questions/24917241
复制相似问题