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 7806787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:38:39+00:00 2026-06-02T02:38:39+00:00

I have a small programme that listens to a port 30003. It is a

  • 0

I have a small programme that listens to a port 30003. It is a server class that processes bytestream data as follows:

sbsSocket = new Socket(sbsHost, sbsPort);
sbsReader = new BufferedReader(new InputStreamReader(sbsSocket.getInputStream()));

private void startSBSMessageReceiverThread() {
    new Thread(new Runnable() {
        public void run() {
            while(true) {
                try {
                    String message = sbsReader.readLine();
                    // System.out.println(message);
                    tracker.handleSBSMessage(message);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }).start();
}

This works fine – however I want to move towards using Spring Integration. Here is my tcp-context for something that is meant to achieve the same thing:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:int="http://www.springframework.org/schema/integration"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:ip="http://www.springframework.org/schema/integration/ip"
    xsi:schemaLocation="http://www.springframework.org/schema/integration 
http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/integration/ip
http://www.springframework.org/schema/integration/ip/spring-integration-ip-2.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">


<context:component-scan base-package="com.atlaschase.falcon.integration"></context:component-scan>

<int:channel id="heathrowChannel"></int:channel>

<ip:tcp-connection-factory id="heathrowConnectionFactory" type="server" host="127.0.0.1" port="30003"/>

<ip:tcp-inbound-channel-adapter id="heathrowInboundAdapter" channel="heathrowChannel" connection-factory="heathrowConnectionFactory"/>

<int:service-activator id="adsbHandler" input-channel="heathrowChannel" ref="sbsListener"/>

</beans>

When I start the programme using the Spring Integration approach, I get the following stack trace – telling me that the socket address is already in use.

SEVERE: Error on ServerSocket
java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
    at java.net.ServerSocket.bind(ServerSocket.java:328)
    at java.net.ServerSocket.<init>(ServerSocket.java:194)
    at java.net.ServerSocket.<init>(ServerSocket.java:150)
    at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:163)
    at org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory.run(TcpNetServerConnectionFactory.java:61)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

I don’t understand why when my standard socket programme works fine – why the integration approach falls over. There is a bit of software on my machine that makes data available on the 30003 port.

I hope you can help.

Thanks

  • 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-02T02:38:44+00:00Added an answer on June 2, 2026 at 2:38 am

    This is solved by clearing up confusion between server and clients. I could not generate a server socket as an application was already bound to that port number.

    To ‘listen’ to the port ‘30003’ I had to generate a connectionFactory of type ‘client’:

    <ip:tcp-connection-factory id="heathrowConnectionFactory" type="server" host="127.0.0.1" port="30003"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small program that reads in a file and processes the data
I have a program that listens on a port waiting for a small amount
I have a small programme which can send request and receive response. but1.setOnClickListener(new Button.OnClickListener()
I've developed a small program that listens to a serial port. My program is
I have a small program that's supposed to sample some value from a device
I have a small program that I'm trying to create to get ip addresses
I have a small java program that reads a file in, in eclipse i
I'm experimenting with file I/O. I have a small practice program that creates a
I have written a small makefile for a few simple C programs that compiles
I have a program that creates a small file in the Bin directory for

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.