22

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)
user2359634
  • 1,275
  • 5
  • 14
  • 27
  • 1
    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 helps – Tinki Jan 31 '17 at 11:00
  • Possible duplicate of [Tomcat failed to shutdown](https://stackoverflow.com/questions/1096642/tomcat-failed-to-shutdown) – tabata Nov 15 '17 at 04:57

8 Answers8

23

Try killing the processes with a single line command -

pkill -9 -f tomcat
Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42
unknown_boundaries
  • 1,482
  • 3
  • 25
  • 47
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

Balaji Katika
  • 2,835
  • 2
  • 21
  • 19
  • 1
    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. – Balaji Katika Mar 13 '16 at 16:34
  • 1
    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 – Balaji Katika Mar 13 '16 at 16:35
  • 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. – user2359634 Mar 14 '16 at 04:30
7

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

user2359634
  • 1,275
  • 5
  • 14
  • 27
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

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
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).

tabata
  • 449
  • 6
  • 17
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!

VicXj
  • 165
  • 1
  • 6
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.

RAHUL KUMAR
  • 1,123
  • 11
  • 9
0

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

27P
  • 1,183
  • 16
  • 22