2013-08-03 45 views
0

我想用http://www.mulesoft.org/connectors/drupal-connector的Drupal雲連接器嘗試示例。使用Drupal Connector的Mule錯誤「找不到變壓器」

但是,當我去

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> 

回答

0

如果我從配置

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

它的工作原理去除這一部分。但這很棘手,因爲mule將這部分自動添加到配置中。

編輯:它只適用於我不使用REST服務器的身份驗證,以及如果我給匿名用戶添加節點的權利。這是Drupal Connector中的一個Bug嗎?

相關問題