我有两个试图通过 HTTP POST 连接的 Mule 流。运行时,我收到无效的子类型错误。我在下面包含了请求和 Web 服务的代码。我还包括了给出的错误。知道我做错了什么吗?
要求
<http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" contentType="text/xml" doc:name="HTTP" mimeType="text/xml" path="***some path removed***" method="POST"/>
网络服务
<mule xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey" 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:spring="http://www.springframework.org/schema/beans" version="EE-3.3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.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 ">
<spring:beans>
<spring:bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<spring:property name="ignoreResourceNotFound" value="true"/>
<spring:property name="locations">
<spring:list>
<spring:value>classpath:local_valueDate.properties</spring:value>
<spring:value>classpath:valueDate.properties</spring:value>
</spring:list>
</spring:property>
</spring:bean>
<spring:bean id="staticDataLoader" name="staticDataLoader" class="StaticDalaLoader"
scope="singleton" init-method="initialize" />
<spring:bean id="valueDateService" name="valueDateService" class="ValueDateService">
<spring:property name="staticDataLoader" ref="staticDataLoader" />
</spring:bean>
</spring:beans>
<flow name="paymentHubServicesFlow1" doc:name="paymentHubServicesFlow1">
<inbound-endpoint exchange-pattern="request-response" responseTimeout="10000" address="${valueDate.host.url}"/>
<jersey:resources doc:name="REST">
<component doc:name="Value Date Service">
<spring-object bean="valueDateService"/>
</component>
</jersey:resources>
</flow>
</mule>
错误
********************************************************************************
Message : Failed to invoke JerseyResourcesComponent{paymentHubServicesFlow1.component.28420486}. Component that caused exception is: JerseyResourcesComponent{paymentHubServicesFlow1.component.28420486}. Message payload is of type: ContentLengthInputStream
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Sub type is invalid. (javax.activation.MimeTypeParseException)
javax.activation.MimeType:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/activation/MimeTypeParseException.html)
2. javax.activation.MimeTypeParseException: Sub type is invalid. (org.mule.api.MuleRuntimeException)
org.mule.transformer.types.SimpleDataType:53 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MuleRuntimeException.html)
3. Failed to invoke JerseyResourcesComponent{paymentHubServicesFlow1.component.28420486}. Component that caused exception is: JerseyResourcesComponent{paymentHubServicesFlow1.component.28420486}. Message payload is of type: ContentLengthInputStream (org.mule.component.ComponentException)
org.mule.component.AbstractComponent:148 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/component/ComponentException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
javax.activation.MimeTypeParseException: Sub type is invalid.
at javax.activation.MimeType.parse(Unknown Source)
at javax.activation.MimeType.<init>(Unknown Source)
at org.mule.transformer.types.SimpleDataType.<init>(SimpleDataType.java:43)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************