我在Red Hat Enterprise Linux上的Mule ESB 3.7.5上运行我的项目时遇到转换器异常,但在Windows上的Mule 3.7.5的Anypoint Studio中运行同一项目时却没有。使用此转换器时会发生此异常:
<dw:transform-message doc:name="Transform Message to MoodleCourse" metadata:id="d3a95670-da14-4d1c-b4df-9eb559593dfb">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
academicYear: payload.collegejaar,
category: payload.organisatieonderdeel,
fullName: payload.lange_naam_nl,
idNumber: payload.cursus,
shortName: payload.cursus,
summary: payload.doel,
teachers: payload.docenten map ((docenten , indexOfDocenten) -> {
userName: docenten.medewerker
}),
teachingCycles: payload.aanvangsblok_onderwijsvormen map ((aanvangsblokonderwijsvorman , indexOfAanvangsblokonderwijsvorman) -> {
name: aanvangsblokonderwijsvorman.aanvangsblok
})
} as :object {
class : "zuyd.MoodleCourse"
}]]></dw:set-payload>
</dw:transform-message>
,然后第一次发出http请求:
<http:request config-ref="Moodle_HTTP_Request_Configuration" path="${moodle.webservice.path}" method="POST" doc:name="HTTP get_users_by_field" metadata:id="d0589922-6eeb-4171-b4a8-a4a118a8cd78">
<http:request-builder>
<http:query-param paramName="wstoken" value="${moodle.webservice.wstoken}" />
<http:query-param paramName="wsfunction" value="core_user_get_users_by_field" />
<http:query-param paramName="field" value="username" />
<http:query-param paramName="values[0]" value="test" />
<http:query-param paramName="moodlewsrestformat" value="json" />
</http:request-builder>
</http:request>
记录器每次运行。在Linux上,发生以下异常。有效负载中的数据未被http-request使用。
2018-06-20 15:45:58,893 [[osiris-moodle-v0.0.17].httpListenerConfig.worker.01] INFO org.mule.api.processor.LoggerMessageProcessor - test1 testmule
2018-06-20 15:45:58,920 [[osiris-moodle-v0.0.17].httpListenerConfig.worker.01] ERROR org.mule.exception.DefaultMessagingExceptionStrategy -
********************************************************************************
Message : This transformer needs a valid endpoint (java.lang.IllegalStateException)
Code : MULE_ERROR-64999
--------------------------------------------------------------------------------
Exception stack is:
1. This transformer needs a valid endpoint (java.lang.IllegalStateException)
org.mule.transport.jms.transformers.AbstractJmsTransformer:203 (null)
2. This transformer needs a valid endpoint (java.lang.IllegalStateException) (org.mule.api.transformer.TransformerException)
org.mule.transport.jms.transformers.AbstractJmsTransformer:79 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalStateException: This transformer needs a valid endpoint
at org.mule.transport.jms.transformers.AbstractJmsTransformer.getSession(AbstractJmsTransformer.java:203)
at org.mule.transport.jms.transformers.AbstractJmsTransformer.transformToMessage(AbstractJmsTransformer.java:65)
at org.mule.transport.jms.transformers.ObjectToJMSMessage.transformMessage(ObjectToJMSMessage.java:54)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
2018-06-20 15:45:58,956 [[osiris-moodle-v0.0.17].httpListenerConfig.worker.01] DEBUG org.mule.module.http.internal.HttpMessageLogger - LISTENER
HTTP/1.1 500 This transformer needs a valid endpoint (java.lang.IllegalStateException) (org.mule.api.transformer.TransformerException) (org.mule.api.transformer.TransformerException) (org.mule.api.transformer.TransformerException). Message payload is of type: MoodleCourse
Content-Length: 259
MULE_ENCODING: UTF-8
Date: Wed, 20 Jun 2018 13:45:58 GMT
Connection: close
This transformer needs a valid endpoint (java.lang.IllegalStateException) (org.mule.api.transformer.TransformerException) (org.mule.api.transformer.TransformerException) (org.mule.api.transformer.TransformerException). Message payload is of type: MoodleCourse
现在有人会导致此异常吗?为什么我没有在Anypoint Studio中得到它?