Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

When run two instance of tomcat application which is running one of them instance could not start

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use apache-tomcat-7.0.47 with two instance for my application. I clone my directory and changed the port numbers in server.xml file. I can start the first tomcat instance and my application successfully run, the second instance can start normally but my application can not run normally, It's trace log is here;

Caused by: java.io.IOException: Failed to bind to server socket: tcp://localhost:61616 due to: java.net.BindException: Address already in use: JVM_Bind
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33).....

I searched error on internet some body said that it is about activeMQ but I do not know what it is. how can I handle wtih this problem?
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you change the ports being used? If you want to run multiple Tomcat instances, they need to use different ports.

Why do you want to run multiple instances instead of one instance having multiple Hosts or multiple Engines?
 
Bartender
Posts: 20841
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Teoman!

It is an architectural constraint in TCP/IP that no more than one and only one process can open a specific TCP/IP port for listening purposes. If a second process attempts to open the same port, that attempt will fail. In the case of Tomcat, Tomcat itself will continue to run, but the second copy of Tomcat won't be receiving incoming traffic for that port. The Tomcat system will be executing, but not the part of Tomcat that listens to that port.

This constraint applies at the OS level, not in Java or Tomcat, so even if a non-java program is listening in on port, no other application can do so until the first application stops listening.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!