Showing posts with label TOMCAT. Show all posts
Showing posts with label TOMCAT. Show all posts

Friday, September 12, 2014

How to Resolve java.net.BindException: Address already in use: JVM_Bind

I have encountered this issue when I was starting my tomcat.

Actual Exception Trace:

SEVERE: StandardServer.await: create[8005]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)

Reason:

The port 8005 is already binding by some other application and that is why we are not able to use it.

Solution:

Change the port number 8005 in tomcat server's server.xml file as below:
<Server port="8005" shutdown="SHUTDOWN"> into <Server port="8006" shutdown="SHUTDOWN">

Saturday, September 6, 2014

How to Configure Multiple Tomcat Server in Same Machine

INTRODUCTION

This post will help to us to configure multiple tomcat server into the same machine/server.

Sometimes there is a need for setting up multiple tomcat to debug the application.

I came across this situation I wanted to debug two different version of my application at same time and check the value for an object.

Following are the steps to achieve it.

Step 1

Install tomcat with two different names as below
  1. C:\Tomcat6.0-1 (with http port 8080)
  2. C:\Tomcat6.0-2 (with http port 8090)

Step 2

Open the C:\Tomcat 6.0-2\conf\server.xml and modify the below lines.
  1. Change  port="8006" on <Server port="8005" shutdown="SHUTDOWN">
  2. Change  port="8010" on <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Step 3

Don't do any change on C:\Tomcat6.0-1. By default settings can be used.
  <Server port="8005" shutdown="SHUTDOWN">
  <Connector port="8080" protocol="HTTP/1.1" >
  <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Now you can able to connect the application as below.
Now Tomcat-1 can be connected using URL: http://localhost:8080/<your-application>
and Tomcat-2 can be connected using URL: http://localhost:8090/<your-application>