2015-02-25 7 views
7

sto già trasformando ad array di byte, ma ho sempre ottenere questo errore:Come risolvere payload messaggio è di tipo: BufferInputStream delle eccezioni in Mule

ERROR 2015-02-25 11:12:30,517 [[ESR].HTTP_Request_Listener.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy: 
******************************************************************************** 
Message    : Response code 400 mapped as failure. Message payload is of type: BufferInputStream 
Code     : MULE_ERROR--2 
-------------------------------------------------------------------------------- 
Exception stack is: 
1. Response code 400 mapped as failure. Message payload is of type: BufferInputStream (org.mule.module.http.internal.request.ResponseValidatorException) 
    org.mule.module.http.internal.request.SuccessStatusCodeValidator:37 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/module/http/internal/request/ResponseValidatorException.html) 
-------------------------------------------------------------------------------- 
Root Exception stack trace: 
org.mule.module.http.internal.request.ResponseValidatorException: Response code 400 mapped as failure. Message payload is of type: BufferInputStream 
    at org.mule.module.http.internal.request.SuccessStatusCodeValidator.validate(SuccessStatusCodeValidator.java:37) 
    at org.mule.module.http.internal.request.DefaultHttpRequester.innerProcess(DefaultHttpRequester.java:202) 
    at org.mule.module.http.internal.request.DefaultHttpRequester.process(DefaultHttpRequester.java:166) 
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) 
******************************************************************************** 

e questo è il mio flusso:

<sub-flow name="requestBeanCreate"> 
    <object-to-byte-array-transformer /> 
    <set-payload value="#[app.registry.messageBean.createServiceRequest(message.inboundProperties['http.uri.params']['name'],payload)]"/> 
</sub-flow> 

<flow name = "RequestsEntryFlow" > 
    <http:listener allowedMethods="POST" parseRequest="false" config-ref="HTTP_Request_Listener" path="/{name}" doc:name="HTTP Entry Flow" /> 
    <flow-ref name="requestBeanCreate" /> 
    <choice doc:name="Choice"> 
     <when expression="#[app.registry.messageBean.isEMCRequired(payload)]"> 
      <jms:outbound-endpoint connector-ref="jms-connector" ref="EMCRequiredRequestsQueue" /> 
     </when> 
     <otherwise>    
      <flow-ref name="req" /> 
     </otherwise> 
    </choice> 
</flow> 

<http:request-config parseResponse="false" name="HTTP_Request_Configuration" /> 

<sub-flow name = "req">  
    <set-variable variableName="id" value="#[payload]" doc:name="Variable" /> 
    <set-variable variableName="destination" value="#[app.registry.routerBean.getDestination(app.registry.messageBean.getReceiverID(payload))]" doc:name="Variable" /> 
    <set-payload value="#[app.registry.messageBean.sendRequestToDestination(payload)]" />    
    <processor-chain> 
    <http:request parseResponse="false" config-ref="HTTP_Request_Configuration" host="#[flowVars.destination]" port="80" path="/" method="POST" /> 
     <object-to-byte-array-transformer /> 
     <expression-component> 
      app.registry.messageBean.sendResponseToSender(flowVars.id); 
      app.registry.messageBean.messageProcessedSuccessfully(flowVars.id); 
     </expression-component> 
    </processor-chain> 
</sub-flow> 

risposta

7

Sembra che stai ricevendo un codice di stato 400 dalla richiesta HTTP che sta causando un'eccezione prima di raggiungere anche il trasformatore. Prova ad aggiungere un successo-status-code-validatore che copre tutti i casi (si può scegliere quelli da prendere in considerazione più avanti):

<http:request parseResponse="false" config-ref="HTTP_Request_Configuration" host="#[flowVars.destination]" port="80" path="/" method="POST"> 
     <http:success-status-code-validator values="0..599"/> 
    </http:request> 
+1

Il problema è il motivo per cui ottieni 400, ma questo dovrebbe aiutarti a vedere cosa sta realmente accadendo. – afelisatti

+0

che in realtà sta aiutando. il server risponde a questo messaggio "È stato rilevato un valore Request.Path potenzialmente pericoloso dal client – MoienGK

0

Inoltre ho ottenuto questo errore quando la pubblicazione di un aggiornamento di stato utilizzando l'adattatore MuleSoft Twitter, anche se dopo un po 'di googlare la prova &, ho capito che l'errore non è con l'adattatore, è con la stringa del payload passata alla scheda.

Nel SetPayload provare questa espressione nel campo del valore: # [ 'RT @' + message.payload [0] .user.screenName + ':' + message.payload [0] .text]

e l'adattatore Twitter provare questi valori:

Operation: Aggiorna stato stato: # [payload]

Se ancora si ottiene un errore, ci possono essere alcuni caratteri speciali nel "message.payload [0] .text "che è l'ultimo tweet dello screenName, prova a mettere un logger senza l'adattatore dello stato di aggiornamento e controlla se riesci a registrarlo correttamente.

-1

Grazie Madajee. Ho avuto lo stesso problema e la tua risposta mi ha aiutato a risolverlo. Inoltre, per aggiungere a questo, ci sono problemi con l'accesso a Twitter che devono essere esaminati in congiunzione per assicurarsi di avere una soluzione funzionante. Soprattutto nel cambiare il permesso di DT (Direct Tweet) e rigenerare l'Access Key e reinserirlo nella configurazione del connettore di Twitter.

Problemi correlati