I'm doing some development in Mule studio. I have 2 REST services in 2 different projects and would like to run both of them on my environment. When I run them independently they run ok.
Service A on port 8081 is calling service B (Account) on port 8083.
I Run As a Mule application for service A on port 8081 and then do the same for service B on port 8083.
When the flow goes to callout to service B I get the below error.
Thank you for your help.
`ERROR 2013-02-13 16:03:05,213 [[OpportunityAccountByOpportunityId].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=http://`localhost`:8083/Account/1_0/AccountReadById?id=0013000000HQY30AAH, connector=HttpConnector
{
name=connector.http.mule.default
lifecycle=start
this=6c22e349
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}
, name='endpoint.http.`localhost`.8083.Account.1.0.AccountReadById.id.0013000000HQY30AAH', mep=REQUEST_RESPONSE, properties={id=0013000000HQY30AAH, http.method=GET}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: GetMethod
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
java.net.PlainSocketImpl:-2 (null)
2. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=http://`localhost`:8083/Account/1_0/AccountReadById?id=0013000000HQY30AAH, connector=HttpConnector
{
name=connector.http.mule.default
lifecycle=start
this=6c22e349
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}
, name='endpoint.http.`localhost`.8083.Account.1.0.AccountReadById.id.0013000000HQY30AAH', mep=REQUEST_RESPONSE, properties={id=0013000000HQY30AAH, http.method=GET}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: GetMethod (org.mule.api.transport.DispatchException)
org.mule.transport.http.HttpClientMessageDispatcher:155 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************`
Currently it is not possible to run multiple application at the same time as you can see from this jira.
To overcome this problem you have 2 options:
Create a separate integration test project that depends on the two mule application and runs all the flows toghether either within a Functional testcase
Use the org.mule.MuleServer main class passing to it all the config files you want to load
Related
While making a Service call from Mule 3.2.2 to Mule 3.7.1, i get the following exception.
Though the serialver of org.mule.transformer.types.SimpleDataType class is different on both the runtimes, i'm not sure why this is an issue. Because the Object is anyway serialized to SOAP request.
Any help is appreciated!
Client code in Mule 3.2.2 runtime:
<cxf:jaxws-client serviceClass="org.test" doc:name="SOAP" >
<cxf:ws-security>
<cxf:ws-config>
<cxf:property key="action" value="UsernameToken"/>
<cxf:property key="user" value="test"/>
<cxf:property key="passwordCallbackRef" value-ref="passwordCallbackHandler" />
<cxf:property key="passwordType" value="PasswordText" />
</cxf:ws-config>
</cxf:ws-security>
Exception:
Message : Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=https://testlb:17105/service/1.0/, connector=HttpsConnector
{
name=connector.https.mule.default
lifecycle=start
this=60de93b4
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[https]
serviceOverrides=<none>
}
, name='endpoint.https.testlb.17105.service.1.0', mep=REQUEST_RESPONSE, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=60000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: PostMethod
Code : MULE_ERROR-42999
--------------------------------------------------------------------------------
Exception stack is:
1. org.mule.transformer.types.SimpleDataType; local class incompatible: stream classdesc serialVersionUID = 734974842501135657, local class serialVersionUID = 6394740184248968880 (java.io.InvalidClassException)
java.io.ObjectStreamClass:617 (null)
2. java.io.InvalidClassException: org.mule.transformer.types.SimpleDataType; local class incompatible: stream classdesc serialVersionUID = 734974842501135657, local class serialVersionUID = 6394740184248968880 (org.apache.commons.lang.SerializationException)
org.mule.util.SerializationUtils:89 (null)
3. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=https://testlb:17105/service/1.0/, connector=HttpsConnector
{
name=connector.https.mule.default
lifecycle=start
this=60de93b4
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[https]
serviceOverrides=<none>
}
, name='endpoint.https.testlb.17105.service.1.0', mep=REQUEST_RESPONSE, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=60000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: PostMethod (org.mule.api.transport.DispatchException)
org.mule.transport.AbstractMessageDispatcher:109 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.InvalidClassException: org.mule.transformer.types.SimpleDataType; local class incompatible: stream classdesc serialVersionUID = 734974842501135657, local class serialVersionUID = 6394740184248968880
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:617)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
You are absolutely right. It should not be a problem at all. However Java has best practices for serialization - to not mix incompatible classes which look exactly the same serialVersionUID attribute is added to class. Usually developers do not pay attention for it but when they do it means that classes are really different.
It actually means that you cannot use serialization to pass the data. Your case is very good example.
To fix the issue you have to get rid of serialization - this class is different in these two versions of the Mule.
Another option is to substitute class with something more stable. Even create your own SimpleDataType.
Or you can open ticket with Mule support for version incompatibility. However I doubt they will fix it for the same reason - classes are different and it was good reason why they are.
This issue is fixed!
As stated in Mule documentation, session variable from 3.7.1 runtime was wrapped on to SimpleDataType.class and this serialized Base64 encoded string was passed on to the other Runtime as MULE_SESSION header. When the other Runtime deserializes this header, as the class version is different, it throws error.
It's fixed by passing this NullSessionHandler to the HTTP Connector, as we didn't care about that header.
<service-overrides sessionHandler="org.mule.session.NullSessionHandler"/>
I am trying to use a mule requester component for SFTP. How do I give the file name as part of the request argument? This is my flow:
<flow name="Move_Doc_To_Temp_Location" doc:name="Move_Doc_To_Temp_Location">
<jdbc-ee:inbound-endpoint queryKey="Select_Document" queryTimeout="-1" pollingFrequency="30000" connector-ref="LoanApp_Database" doc:name="Select_Doc_To_be_moved"/>
<set-variable variableName="OriginalPayload" value="#[payload]" doc:name="OriginalPayload"/>
<logger message="#[payload['DocID']] - #[payload['Location']]" level="INFO" category="Document to be moved" doc:name="Logger"/>
<!-- <mulerequester:request config-ref="Mule_Requester" resource="file:///#[payload['Location']]" doc:name="Mule Requester"/> -->
<mulerequester:request config-ref="Mule_Requester" resource="sftp://user:Pwd#Hostname#[payload['Location']]" doc:name="Mule Requester"/>
<file:outbound-endpoint path="C:\Users\jvas\Desktop\testfiles" outputPattern="#[header:originalFilename]" responseTimeout="10000" doc:name="File"/>
</flow>
The location value resolves to /opt/Documents/test.txt. When I specify the filename like this, it throws me an error:
ERROR 2014-07-24 05:51:12,358
[[loanapp_document_flow].Move_Doc_To_Temp_Location.stage1.02]
org.mule.exception.DefaultMessagingExceptionStrategy:
******************************************************************************** Message : Failed to receive event over:
DefaultInboundEndpoint{endpointUri=sftp://muledev:#nylicvmmuledev/opt/Documents/test.txt,
connector=SftpConnector { name=SFTP1 lifecycle=start this=aa033b
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true connected=true
supportedProtocols=[sftp] serviceOverrides= } ,
name='endpoint.sftp.nylicvmmuledev.opt.Documents.test.txt',
mep=ONE_WAY, properties={},
transactionConfig=Transaction{factory=null, action=INDIFFERENT,
timeout=0}, deleteUnacceptedMessages=false, initialState=started,
responseTimeout=10000, endpointEncoding=UTF-8,
disableTransportTransformer=false} (timeout=1000) Code
: MULE_ERROR-92
-------------------------------------------------------------------------------- Exception stack is:
Error 'No such file' occurred when trying to CDW to '/opt/Documents/test.txt'. (java.io.IOException)
org.mule.transport.sftp.SftpClient:102 (null)
Failed to receive event over: DefaultInboundEndpoint{endpointUri=sftp://muledev:#nylicvmmuledev/opt/Documents/test.txt,
connector=SftpConnector { name=SFTP1 lifecycle=start this=aa033b
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true connected=true
supportedProtocols=[sftp] serviceOverrides= } ,
name='endpoint.sftp.nylicvmmuledev.opt.Documents.test.txt',
mep=ONE_WAY, properties={},
transactionConfig=Transaction{factory=null, action=INDIFFERENT,
timeout=0}, deleteUnacceptedMessages=false, initialState=started,
responseTimeout=10000, endpointEncoding=UTF-8,
disableTransportTransformer=false} (timeout=1000)
(org.mule.api.transport.ReceiveException)
org.mule.transport.AbstractMessageRequester:132
(http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/ReceiveException.html)
-------------------------------------------------------------------------------- Root Exception stack trace: java.io.IOException: Error 'No such file'
occurred when trying to CDW to '/opt/Documents/test.txt'. at
org.mule.transport.sftp.SftpClient.changeWorkingDirectory(SftpClient.java:102)
at
org.mule.transport.sftp.SftpConnector.createSftpClient(SftpConnector.java:196)
at
org.mule.transport.sftp.SftpConnector.createSftpClient(SftpConnector.java:174)
3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
Now I tried removing the file name from the location, and the SFTP was successful, but it has randomly chosen a file. The file has all permissions for SFTP and I am able to do the SFTP via command line successfully. I have referred to the documentation for the SFTP URL and this is what it provides for resolving the file name from the URL : https://datatracker.ietf.org/doc/html/draft-ietf-secsh-scp-sftp-ssh-uri-04#section-4.1
Retrieve file.txt from the user's home directory on the host at
host.example.com using SFTP using username user. This example
assumes that the implementation supports the indication of a path
relative to the home directory using a leading tilde.
sftp://user#host.example.com/~/file.txt
Retrieve file.txt from the absolute path /dir/path on the host at
host.example.com using SFTP using username user.
sftp://user#host.example.com/dir/path/file.txt
The Mule SFTP connector can not take the filename in the address. Instead you need to use a filename filter. However, unfortunately I think the requestor module ignores the filters configured on the endpoint as mentioned here: http://forum.mulesoft.org/mulesoft/topics/mule_module_requester_add_support_for_filenamefilter
You could however use a script to read a file over sftp mid flow. Something like:
<scripting:transformer>
<scripting:script engine="Groovy">
<scripting:text>
def endpointBuilder = muleContext.endpointFactory.getEndpointBuilder(
"sftp://${sftp.username}#${sftp.host}:${sftp.port}/${sftp.path}?identityFile=${app.home}/${sftp.keyPath}&passphrase=${sftp.passphrase}&connector=sftp-csv")
endpointBuilder.addMessageProcessor(new org.mule.routing.MessageFilter(new org.mule.transport.file.filters.FilenameWildcardFilter(sessionVars.expectedFilename)))
def inboundEndpoint = endpointBuilder.buildInboundEndpoint()
inboundEndpoint.request(30000L)
</scripting:text>
</scripting:script>
</scripting:transformer>
I have a synchronized Mule flow which reads messages from a sonic topic and publish to a Rabbit exchange.
I am loosing messages when the Rabbit is brought up/down.
Rabbit exchange is publishing to HA queues.
How can I make sure Mule is not consuming the message until proper "Ack" is received from Rabbit Broker?
Here is the flow.
<jms:connector name="sonicMQConnectorSub" validateConnections="true" connectionFactory-ref="factorySub" doc:name="JMS" clientId="testClient" durable="true" maxRedelivery="-1" >
<reconnect-forever frequency="30000"/>
</jms:connector>
<spring:beans>
<spring:bean id="soniqMQConnectionFactoryBeanSub" name="factorySub" class="progress.message.jclient.ConnectionFactory">
<spring:property name="connectionURLs" value="tcp://server1:7800" />
<spring:property name="defaultUser" value="user" />
<spring:property name="defaultPassword" value="pass" />
</spring:bean>
</spring:beans>
<amqp:connector name="AMQP" validateConnections="true" host="server2" fallbackAddresses="server3" doc:name="AMQP Connector" port="5672" mandatory="true" activeDeclarationsOnly="true">
<reconnect-forever frequency="30000"/>
</amqp:connector>
<flow name="rabbitFlow1" doc:name="rabbitFlow1" processingStrategy="synchronous">
<jms:inbound-endpoint doc:name="JMS" connector-ref="sonicMQConnectorSub" topic="testtopic"/>
<logger message="Message: #[message.payload]" level="INFO" doc:name="Logger"/>
<amqp:outbound-endpoint exchangeName="rabbitExchange" exchangeDurable="true" responseTimeout="10000" connector-ref="AMQP" doc:name="AMQP" exchangeType="fanout"/>
</flow>
Updated 04/22
Here is the exception trace when Mule is connecting to the 2nd broker. This is when I loose a message.
2014-04-22 09:49:29,453 - org.mule.exception.DefaultSystemExceptionStrategy - ERROR -
********************************************************************************
Message : Connection shutdown detected for: AMQP
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Software caused connection abort: recv failed (java.net.SocketException)
java.net.SocketInputStream:-2 (null)
2. connection error; reason: java.net.SocketException: Software caused connection abort: recv failed (com.rabbitmq.client.ShutdownSignalException)
com.rabbitmq.client.impl.AMQConnection:715 (null)
3. Connection shutdown detected for: AMQP (org.mule.transport.ConnectException)
org.mule.transport.amqp.AmqpConnector$1:502 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
2014-04-22 09:49:29,453 - org.mule.exception.DefaultSystemExceptionStrategy - INFO - Exception caught is a ConnectException, attempting to reconnect...
2014-04-22 09:49:29,454 - org.mule.lifecycle.AbstractLifecycleManager - INFO - Stopping connector: AMQP
2014-04-22 09:49:29,454 - org.mule.lifecycle.AbstractLifecycleManager - INFO - Stopping: 'AMQP.dispatcher.1064499250'. Object is: AmqpMessageDispatcher
2014-04-22 09:49:29,454 - org.mule.lifecycle.AbstractLifecycleManager - INFO - Disposing: 'AMQP.dispatcher.1064499250'. Object is: AmqpMessageDispatcher
2014-04-22 09:49:29,455 - org.mule.transport.amqp.AmqpConnector - ERROR - clean connection shutdown; reason: Attempt to use closed connection
2014-04-22 09:49:29,461 - org.mule.transport.amqp.AmqpConnector - INFO - Connected: AmqpConnector
{
name=AMQP
lifecycle=stop
this=33c5919e
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[amqp]
serviceOverrides=<none>
}
2014-04-22 09:49:29,461 - org.mule.transport.amqp.AmqpConnector - INFO - Starting: AmqpConnector
{
name=AMQP
lifecycle=stop
this=33c5919e
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[amqp]
serviceOverrides=<none>
}
2014-04-22 09:49:29,461 - org.mule.lifecycle.AbstractLifecycleManager - INFO - Starting connector: AMQP
Updated 04/23 with the Exception received when JMS Transaction is added to AMQP outbound Endpoint:
Message : No active AMQP transaction found for endpoint: DefaultOutboundEndpoint{endpointUri=amqp://rabbitExchange, connector=AmqpConnector
{
name=AMQP
lifecycle=start
this=25ec1ff7
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[amqp]
serviceOverrides=<none>
}
, name='endpoint.amqp.rabbitExchange', mep=ONE_WAY, properties={exchangeDurable=true, exchangeType=fanout}, transactionConfig=Transaction {factory=org.mule.transport.jms.JmsTransactionFactory#6491b172, action=ALWAYS_JOIN, timeout=30000}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.transaction.IllegalTransactionStateException: No active AMQP transaction found for endpoint: DefaultOutboundEndpoint{endpointUri=amqp://rabbitExchange, connector=AmqpConnector
{
name=AMQP
lifecycle=start
this=25ec1ff7
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[amqp]
serviceOverrides=<none>
}
, name='endpoint.amqp.rabbitExchange', mep=ONE_WAY, properties= {exchangeDurable=true, exchangeType=fanout}, transactionConfig=Transaction {factory=org.mule.transport.jms.JmsTransactionFactory#6491b172, action=ALWAYS_JOIN, timeout=30000}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}
at org.mule.transport.amqp.AmqpMessageDispatcher.getEventChannel(AmqpMessageDispatcher.java:298)
at org.mule.transport.amqp.AmqpMessageDispatcher.doOutboundAction(AmqpMessageDispatcher.java:152)
at org.mule.transport.amqp.AmqpMessageDispatcher.doDispatch(AmqpMessageDispatcher.java:127)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
2014-04-23 10:52:03,178 - org.mule.transport.jms.JmsTransaction - WARN - Transaction rollback attempted, but no resource bound to org.mule.transport.jms.JmsTransaction#d4ac3d8f-caf6-11e3-bf9a-8b266a026dee [status=STATUS_MARKED_ROLLBACK, key=null, resource=null]
I see two options:
Make the JMS client a durable one and consume testtopic transactionally so if amqp:outbound-endpoint fails, the message will be redelivered.
Wrap the amqp:outbound-endpoint with until-successful to retry the outbound dispatches until the AMQP connector reconnects to RabbitMQ.
Using Mule Studio
Version: 3.5.0
Build Id: 201402101410
I have a very simple flow. I need to pick up a file from one ftp server and transfer it to another ftp server. When the file is written to the target, the filename looks like some kind of UUId rather than the original file name. How do I get the file name to carry through? I have tried #[header:originalFilename] but that throws an error so I assume that maybe it is only for file connectors. Here is my flow:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp" 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" xmlns:context="http://www.springframework.org/schema/context" version="CE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="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
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/current/mule-ftp.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
<context:property-placeholder location="environment.properties"/>
<flow name="sli-ftpFlow1" doc:name="sli-ftpFlow1">
<ftp:inbound-endpoint host="${local.ftp.host}" port="${local.ftp.port}" path="${local.ftp.path}" user="${local.ftp.user}" password="${local.ftp.pass}" responseTimeout="10000" doc:name="FTP" pollingFrequency="${local.ftp.pollingFreq}" binary="true" passive="false"/>
<logger message="Transferring file:" level="INFO" doc:name="Logger"/>
<ftp:outbound-endpoint host="${sli.ftp.host}" port="${sli.ftp.port}" path="${sli.ftp.path}" user="${sli.ftp.user}" password="${sli.ftp.pass}" responseTimeout="10000" doc:name="FTP" outputPattern="#[header:originalFilename]"/>
</flow>
</mule>
Stack Trace:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'sli-ftp' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2014-03-19 22:10:38,058 [[sli-ftp].sli-ftpFlow1.stage1.02] INFO org.mule.api.processor.LoggerMessageProcessor - Transferring file:
2014-03-19 22:10:38,071 [[sli-ftp].connector.ftp.mule.default.dispatcher.01] INFO org.mule.lifecycle.AbstractLifecycleManager - Initialising: 'connector.ftp.mule.default.dispatcher.1035665885'. Object is: FtpMessageDispatcher
2014-03-19 22:10:38,071 [[sli-ftp].connector.ftp.mule.default.dispatcher.01] INFO org.mule.lifecycle.AbstractLifecycleManager - Starting: 'connector.ftp.mule.default.dispatcher.1035665885'. Object is: FtpMessageDispatcher
2014-03-19 22:10:38,078 [[sli-ftp].connector.ftp.mule.default.dispatcher.01] ERROR org.mule.exception.DefaultMessagingExceptionStrategy -
********************************************************************************
Message : Streaming failed. Could not get output stream. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=ftp://esbuser%40newpig.com:<password>#webuatint/SLI-Mock, connector=FtpConnector
{
name=connector.ftp.mule.default
lifecycle=start
this=a40c648
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[ftp]
serviceOverrides=<none>
}
, name='endpoint.ftp.webuatint.21.SLI.Mock', mep=ONE_WAY, properties={outputPattern=#[header:originalFilename]}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: byte[]
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Expression Evaluator "header" with expression "outbound:originalFilename" returned null but a value was required. (org.mule.api.expression.RequiredValueException)
org.mule.expression.ExpressionUtils:239 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/RequiredValueException.html)
2. Streaming failed. Could not get output stream. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=ftp://esbuser%40newpig.com:<password>#webuatint/SLI-Mock, connector=FtpConnector
{
name=connector.ftp.mule.default
lifecycle=start
this=a40c648
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[ftp]
serviceOverrides=<none>
}
, name='endpoint.ftp.webuatint.21.SLI.Mock', mep=ONE_WAY, properties={outputPattern=#[header:originalFilename]}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: byte[] (org.mule.api.transport.DispatchException)
org.mule.transport.ftp.FtpConnector:602 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.expression.RequiredValueException: Expression Evaluator "header" with expression "outbound:originalFilename" returned null but a value was required.
at org.mule.expression.ExpressionUtils.getPropertyInternal(ExpressionUtils.java:239)
at org.mule.expression.ExpressionUtils.getPropertyWithScope(ExpressionUtils.java:67)
at org.mule.expression.ExpressionUtils.getPropertyWithScope(ExpressionUtils.java:50)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
Stack Trace with #[header:originalFilename] in Logger:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'sli-ftp' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2014-03-20 08:15:35,918 [[sli-ftp].sli-ftpFlow1.stage1.02] ERROR org.mule.exception.DefaultMessagingExceptionStrategy -
********************************************************************************
Message : Expression Evaluator "header" with expression "outbound:originalFilename" returned null but a value was required. (org.mule.api.expression.RequiredValueException). Message payload is of type: byte[]
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Expression Evaluator "header" with expression "outbound:originalFilename" returned null but a value was required. (org.mule.api.expression.RequiredValueException)
org.mule.expression.ExpressionUtils:239 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/RequiredValueException.html)
2. Expression Evaluator "header" with expression "outbound:originalFilename" returned null but a value was required. (org.mule.api.expression.RequiredValueException). Message payload is of type: byte[] (org.mule.api.MessagingException)
org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:35 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.expression.RequiredValueException: Expression Evaluator "header" with expression "outbound:originalFilename" returned null but a value was required.
at org.mule.expression.ExpressionUtils.getPropertyInternal(ExpressionUtils.java:239)
at org.mule.expression.ExpressionUtils.getPropertyWithScope(ExpressionUtils.java:67)
at org.mule.expression.ExpressionUtils.getPropertyWithScope(ExpressionUtils.java:50)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
Use MEL: #[message.inboundProperties.originalFilename].
I think the scope is the issue.
This was changed in 3.4 -http://www.mulesoft.org/documentation/display/current/Mule+ESB+3.4.0+Release+Notes
Mule 3.4+ originalFilename is in the inbound scope. So use: #[message.inboundProperties.originalFilename]
Mule < 3.4 originalFilename is in the outbound scope. So use: #[message.outboundProperties.originalFilename]
Issue is documented here: https://www.mulesoft.org/jira/browse/MULE-6743
In my mule application i'm trying to send message (xml) to Rabbit MQ exchange.
In my application i defined:
<scripting:component doc:name="CreateXML">
<scripting:script engine="Groovy"><![
def xml = "" //previously created xml
return xml]]></scripting:script>
</scripting:component>
<amqp:outbound-endpoint
exchangeName="test-exchange.srv"
routingKey="auc.guest1.test"
connector-ref="AMQPRabbitConnector" />
And my connector to Rabbit MQ looks like:
<amqp:connector
name="AMQPRabbitConnector"
virtualHost="dev"
username="guest"
password="guest"
activeDeclarationsOnly="false"/>
when I run my application I'm an getting exception after some time I sent messages:
ERROR 2013-07-05 10:53:34,020 [[fis-bps-pgm-mule].AMQPRabbitConnector.dispatcher.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=amqp://test-exchange.srv, connector=AmqpConnector
{
name=AMQPRabbitConnector
lifecycle=start
this=2bfec68b
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[amqp]
serviceOverrides=<none>
}
}
, name='endpoint.amqp.test-exchange.srv', mep=ONE_WAY, properties={routingKey=auc.guest1.test}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: AmqpMessage
Type : org.mule.api.transport.DispatchException
Code : MULE_ERROR--2
Payload : org.mule.transport.amqp.AmqpMessage#68e64543[consumerTag=<null>,envelope=com.rabbitmq.client.Envelope#7b2fc059,body={60,63,120,109,108,32,118,101,114,115,105,111,110,61,39,49,46,48,39,63,62,10,60,99,114,101,9
I resoloved problem.
In prevous element of the flow, I'm setting outbound properties, without that connector working fine.