Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:56:05+00:00 2026-06-12T14:56:05+00:00

I use Mule 3.x I have a code that tests MuleClient connectivity. This test

  • 0

I use Mule 3.x

I have a code that tests MuleClient connectivity.

This test is ok and works proper way:

public void testHello() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage result = client.send("http://127.0.0.1:8080/hello", "some data", null);
        assertNotNull(result);
        assertNull(result.getExceptionPayload());
        assertFalse(result.getPayload() instanceof NullPayload);

        //TODO Assert the correct data has been received
        assertEquals("hello", result.getPayloadAsString());
    }

But this tes is not ok – it fail with an connection exceptions:

public void testHello_with_Spring() throws Exception {

    MuleClient client = new MuleClient("mule-config-test.xml");
    client.getMuleContext().start();

    //it fails here
    MuleMessage result = client.send("http://127.0.0.1:8080/hello", "some data", null);
    assertNotNull(result);

    assertNull(result.getExceptionPayload());
    assertFalse(result.getPayload() instanceof NullPayload);

    //TODO Assert the correct data has been received
    assertEquals("hello", result.getPayloadAsString());
}

The ‘mule-config-test.xml’ is used in both tests, the path for this file is ok, i checked.

This is error message I have in the end:

Exception stack is:
1. Address already in use (java.net.BindException) java.net.PlainSocketImpl:-2 (null)
2. Failed to bind to uri “http://127.0.0.1:8080/hello” (org.mule.transport.ConnectException)
org.mule.transport.tcp.TcpMessageReceiver:81
(http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectException.html)
——————————————————————————– Root Exception stack trace: java.net.BindException: Address already in
use at java.net.PlainSocketImpl.socketBind(Native Method) at
java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383) at
java.net.ServerSocket.bind(ServerSocket.java:328)
+ 3 more (set debug level logging or ‘-Dmule.verbose.exceptions=true’ for everything)


[10-05 16:33:37] ERROR HttpConnector [main]:
org.mule.transport.ConnectException: Failed to bind to uri
“http://127.0.0.1:8080/hello” [10-05 16:33:37] ERROR ConnectNotifier
[main]: Failed to connect/reconnect: HttpConnector {
name=connector.http.mule.default lifecycle=stop this=7578a7d9
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true connected=false
supportedProtocols=[http] serviceOverrides= } . Root Exception
was: Address already in use. Type: class java.net.BindException [10-05
16:33:37] ERROR DefaultSystemExceptionStrategy [main]: Failed to bind
to uri “http://127.0.0.1:8080/hello”

org.mule.api.lifecycle.LifecycleException: Cannot process event as
“connector.http.mule.default” is stopped

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:56:06+00:00Added an answer on June 12, 2026 at 2:56 pm

    I think the problem is in what you’re not showing: testHello_with_Spring() is probably executing while Mule is already running. The second Mule you’re starting in it then port-conflicts with the other one.

    Are testHello() and testHello_with_Spring() in the same test suite? If yes, seeing that testHello() relies on an already running Mule, I’d say that would be the cause of port conflict for testHello_with_Spring().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code I need to write a test for that connects to
I have the following use case in Mule ESB - Expose a SOAP endpoint
I have tried to use the lastest version of magento connector on mule 3.2.
Use case: I find a piece of code that I do not understand at
I need to make performance test of Mule ESB. I have an access to
We are using org.mule.tck.FunctionalTestCase for test cases. Its an abstract JUnit test case. This
use strict; use warnings; use Time::HiRes qw(sleep); use Test::WWW::Selenium; use Test::More no_plan; use Test::Exception;
I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB
I have a Mule 3.3.0 flow which splits a file into records. I need
I am new to mule. Are there any way to call CXF based web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.