2012-11-06 5 views
0

HTTP POST를 통해 연결하려고하는 두 개의 뮬 흐름이 있습니다. 실행하면 잘못된 하위 유형 오류가 발생합니다. 요청 및 웹 서비스 코드를 아래에 포함 시켰습니다. 나는 또한 주어진 오류를 포함시켰다. 내가 뭘 잘못하고 있는거야?HTTP POST 잘못된 서브 유형 오류 수신

요청

<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) 
******************************************************************************** 

답변

1

당신이 HTTP에서 mimeType를 = "텍스트/XML"제거하는 경우 : 아웃 바운드. 오류를 중지합니다. 그러나 Content-Type이 설정되어 있지 않다고 경고합니다. Conent-Type을 추가해야한다면, 지금 당장은 그 속성을 얻기 위해 set-property를 추가 할 것입니다.

<set-property propertyName="Content-Type" value="text/xml" doc:name="Property" />  

JIRA는 이미 그것의 모양에 의해 작동하지 ContentType을 위해 열려 있습니다 : http://www.mulesoft.org/jira/browse/MULE-6487

그러나 mimeType를 잘 다른 버그 가치가보고 될 수있는 콘텐츠 유형에 영향을.

+0

이렇게했습니다. 감사! –