使用Drupal Connector的Mule错误“找不到变压器”

时间:2013-08-03 20:52:05

标签: mule mule-studio

我想尝试使用来自http://www.mulesoft.org/connectors/drupal-connector的Drupal Cloud Connector的示例。

但是当我去

http://localhost:8081/drupal/node/create?title=test 

创建一篇新文章,这是浏览器中的响应:

Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}".. Message payload is of type: String

来自MuleStudio控制台的输出:

ERROR 2013-08-03 22:40:54,555 [[drupal-esb].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}".
Code                  : MULE_ERROR-236
--------------------------------------------------------------------------------
Exception stack is:
1. Could not find a transformer to transform "SimpleDataType{type=java.lang.String,  mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object,  mimeType='*/*'}". (org.mule.api.transformer.TransformerException)
  org.mule.registry.MuleRegistryHelper:252     (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}".
at org.mule.registry.MuleRegistryHelper.lookupTransformer(MuleRegistryHelper.java:252)
at org.mule.modules.drupal.processors.AbstractExpressionEvaluator.transform(AbstractExpressionEvaluator.java:329)
at org.mule.modules.drupal.processors.AbstractExpressionEvaluator.evaluateAndTransform(AbstractExpressionEvaluator.java:202)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

WARN  2013-08-03 22:40:54,819 [[drupal-esb].http.request.dispatch.8081.02]   org.mule.transport.http.HttpConnector: No receiver found with secondary lookup on   connector: connector.http.mule.default with URI key: http://localhost:8081/favicon.ico
WARN  2013-08-03 22:40:54,819 [[drupal-esb].http.request.dispatch.8081.02] org.mule.transport.http.HttpConnector: Receivers on connector are: {
http://localhost:8081/drupal/node/create=HttpMessageReceiver{this=1ea6cbb2,   receiverKey=http://localhost:8081/drupal/node/create,    endpoint=http://localhost:8081/drupal/node/create}

}

在我的配置XML中:

<?xml version="1.0" encoding="UTF-8"?>
<mule ....>
<drupal:config name="Drupal" username="dba" password="****" server="locahost"   apiUrl="/service/rest"    taxonomyTermEndpoint="taxonomy-term" taxonomyVocabularyEndpoint="taxonomy-vocabulary" doc:name="Drupal" >
    <drupal:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
</drupal:config>
<flow name="drupal-esbFlow1" doc:name="drupal-esbFlow1">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP" path="drupal/node/create"/>
    <drupal:create-node config-ref="Drupal"  doc:name="Drupal" password="****" username="dba">
        <drupal:node   title="#[message.inboundProperties['title']]" type="article">
            <drupal:body>
                <drupal:und ref="#[payload]"/>
            </drupal:body>
        </drupal:node>
    </drupal:create-node>
    <json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>

1 个答案:

答案 0 :(得分:0)

如果我从配置中删除此部分

<drupal:body>
    <drupal:und ref="#[payload]"/>
</drupal:body>

它有效。但这有点棘手,因为mule会自动将这部分添加到配置中。

编辑:只有当我不为REST服务器使用身份验证,并且我给匿名用户添加节点的权限时,它才有效。这是Drupal Connector中的Bug吗?