ERROR: transport error 202: bind failed when starting Tomcat 7 in debug mode
Asked Answered
S

9

24

I have installed tomcat 7.0.68 on windows7-64bit machine.

If I run catalina.bat jpda start , it just opens and closes and no logs are generated.

If I run catalina.bat jpda run I get below error

Using CATALINA_BASE:   "C:\apache-tomcat-7.0.68"
Using CATALINA_HOME:   "C:\apache-tomcat-7.0.68"
Using CATALINA_TMPDIR: "C:\apache-tomcat-7.0.68\temp"
Using JRE_HOME:        "C:\Java\jre7"
Using CLASSPATH:       "C:\apache-tomcat-7.0.68\bin\bootstrap.jar;C:\apache- 
                         tomcat-7.0.68\bin\tomcat-juli.jar"
Picked up _JAVA_OPTIONS: -Xmx512M
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
       JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports  
        initialized [../../../src/share/back/debugInit.c:750]
FATAL ERROR in native method: JDWP No transports initialized,
                       jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Summerville answered 11/3, 2016 at 15:3 Comment(2)
Just to explain what acctually happened- you are trying to connect debugger to the port which is already taken by other process. That is why changing port to the different value helpsGodewyn
Possible duplicate of Tomcat failed to shutdownBehest
S
8

I changed the port , set JPDA_ADDRESS to 1043 and it worked for me.

Summerville answered 13/3, 2016 at 3:53 Comment(4)
Cool... What was it earlier? Did you check if it was in use by some other process ?Bistro
I checked using netstat -an , but then it din show me as the port being used. But yes changing the port solved the issue,so relievedSummerville
For me the previous value was the default one, which is 8000Cucurbit
Thank you.. I had the same issue. I resolved it by changing JPDA_ADDRESS.Geographical
T
25

Try killing the processes with a single line command -

pkill -9 -f tomcat
Trypanosome answered 12/4, 2019 at 4:23 Comment(2)
you might need to sudo it.Trypanosome
Did not work, still getting the same error :')Nanette
B
18

Some other application is using the ports being trying to open by tomcat. By default, it uses 8080, 8443, 8005, 8009 etc., grep for tomcat specific ports already being in use by using the below command.

netstat -an

identify the process already acquired the conflicting ports and terminate/free up so that tomcat can use it. One more thing, tomcat debug mode tries to use additional port for debug purpose (i.e., 8000). See if that port is already in use by some other process

Bistro answered 11/3, 2016 at 16:4 Comment(3)
Its most like that you executed statup.bat first and forgot to stop it. This would have already bind the ports and didn't release it. Please check in this angle. In the worst case (not recomended though), try rebooting. Execute debug before any other process.Bistro
One more thing, tomcat debug mode tries to use additional port for debug purpose (i.e., 8000). See if that port is already in use by some other processBistro
It's not that I forgot to stop. I rebooted and had executed debug as first thing on my system. It wasn't working so had posted this question.Summerville
S
8

I changed the port , set JPDA_ADDRESS to 1043 and it worked for me.

Summerville answered 13/3, 2016 at 3:53 Comment(4)
Cool... What was it earlier? Did you check if it was in use by some other process ?Bistro
I checked using netstat -an , but then it din show me as the port being used. But yes changing the port solved the issue,so relievedSummerville
For me the previous value was the default one, which is 8000Cucurbit
Thank you.. I had the same issue. I resolved it by changing JPDA_ADDRESS.Geographical
W
4

Windows answer

1.Detect PID

netstat -ano

find port you need and corresponding PID

2.Kill process

taskkill /F /PID 1234

replace 1234 with your PID

Wadai answered 13/5, 2020 at 16:59 Comment(0)
B
2

This question seems to be duplicated. And, I think using CATALINA_OPTS is more simple and suitable.

Tomcat failed to shutdown

The answer above said below.

Looking into catalina.sh, one can see CATALINA_OPTS is only used by the "start" and "start-security" commands, whereas JAVA_OPTS is also used by the "stop" command (at least with Tomcat 6.0.33 on openSUSE 12.1).

Behest answered 7/11, 2017 at 1:47 Comment(0)
N
1

I also got the same issue while the hybris server start.

When I started the hybris (which runs on the tomcat server) in debug mode using "hybrisserver.bat debug", a similar error I got.

So run the server without debug mode (i.e "hybrisserver.bat").

Hope this is helpful for hybris developers!

Noble answered 2/6, 2021 at 16:9 Comment(0)
B
0

In my case i have several tomcat running,In two tomcat I have given same jpda address,so one of tomcat was not able to start because address was already in use.

Beshore answered 11/4, 2019 at 14:37 Comment(0)
F
0

Kill existing process (kill -8 {PID}) and re-start. The above mentioned error should eliminate

Fard answered 17/9, 2019 at 10:44 Comment(0)
W
0

if you have many tomcat instance running on your machine, the way you can kill the specific tomcat process is by running bellow command with the JDWP port:

kill -9 $(lsof -t -i:1043)

which 1043 is my jdwp port which has been set in catalina.sh CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=1043,server=y,suspend=n"

Wrestle answered 26/9, 2023 at 11:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.