warpdriv
warpdriv

Reputation: 11

mule studio multiple projects running connection refused

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)
********************************************************************************`

Upvotes: 1

Views: 2136

Answers (1)

genjosanzo
genjosanzo

Reputation: 3264

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:

  1. Create a separate integration test project that depends on the two mule application and runs all the flows toghether either within a Functional testcase
  2. Use the org.mule.MuleServer main class passing to it all the config files you want to load

Upvotes: 1

Related Questions