48

Can you explain what this error is (and secondly why I am getting it)?

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

P.S. It may be related to Known Tomcat 6.0 and JDK 1.7.0_02 issues?, as I only started getting it after upgrading from JDK 1.7.0 to 1.7.0 update 2, with no other upgrades to other software.

I am running:

  • Eclipse Indigo 3.7
  • JDK 1.7.0_0u2 (JDK 7 update 2)
  • Tomcat 6.0
  • Windows 7
  • Apache HTTP Server (although not using it yet)

When I start Tomcat I started getting this error, but not all the time. Rebooting just now fixed it. Some mornings I come to work without a reboot and it fixes it even though it failed the day before. It's sporadic. To debug this I need to understand. Can you help explain it?

EDIT : I have two Tomcat servers, for two different projects, on the same port. The other (first) server is "stopped" but remains "synchronized", in case this matters. I've quickly tried changing all the ports up one (8080 to 8081) and the error reproduces. This may not be a proper test of changing ports, however.

EDIT 2: I just had this problem, and rebooting "fixed" the issue. The workstation was on all weekend and Tomcat worked on Friday and Eclipse was shutdown at the end of the day. I will keep taking notes like this as I run into it to remove guesswork.

EDIT 3: Today it gave me this error from an unrebooted system that worked yesterday, programs shut down yesterday and restarted today. I rebooted, and the error is gone. Most notably is that the error always occurs at 23% compilation. It hits 23%, waits a bit and this is when I know it won't succeed, and then popups a window. I'll capture what the window says next time. Then it gives the above error to the Console.

EDIT 4: I am running Windows 7 and Apache HTTP Server (although not using it yet). I'll add these to the list above.

EDIT 5: The popup window mentioned in edit #3 is (and note my Tomcat is named Server Tomcat v6.0 Server at localhost):

Problem Occurred

'Server Tomcat v6.0 Server at localhost' has encountered a problem.

Server Tomcat v6.0 Server at localhost  failed to start.

OK << Details

Server Tomcat v6.0 Server at localhost  failed to start.

EDIT 6: I just got a new problem, which is Cannot connect to VM com.sun.jdi.connect.TransportTimeoutException popup window error and the same main error that this question asks about in the Console window.

EDIT 7: Just restarting Eclipse, not rebooting the whole computer, solved the error this morning.

2
  • Have you looked in the log files for Tomcat server? Feb 8, 2012 at 19:11
  • 1
    I am also getting the same error ! But only when i start my apache in debug mode, the start mode is working fine.My configurations is exactly same : indigo, apache 6.0, win 7,JDK 1.7.0_51
    – Vivek
    Jan 29, 2014 at 15:50

15 Answers 15

28

This error typically comes up when the necessary port is taken by another program.

You said that you have changed the HTTP connector port from 8080 to 8081 so the two Tomcats do not clash, but have you also changed the <Server port="..." in tomcat/conf/server.xml to be different between your Tomcats?

Are there any other connectors ports which may possibly clash?

9
  • I am going to look into this soon. The question though is why none of this was necessary with JDK 1.7.0 (as opposed to needed for 1.7.0_02)?
    – Xonatron
    Feb 9, 2012 at 13:29
  • JDK1.7.0 could just be a red herring or the startup/shutdown of Tomcat works differently.
    – mindas
    Feb 9, 2012 at 14:21
  • this is for the Tomcast admin port, not the HTTP or AJP ports, correct? Do each of these ports have to be different for each of my Tomcats?
    – Xonatron
    Feb 17, 2012 at 17:51
  • I should just step in an add that this is not the problem as I never run both Tomcat's at the same time. Unless running one doesn't let go of the ports it was using? Also, the server.xml file appears only to be setup for one of my Tomcat's, not both. The only difference in these three ports for my two Tomcat's is that they use a different AJP port (8009 and 8019), and 8009 is the one that is in server.xml, and 8019 is on the Tomcat giving me the problem mention in my question!
    – Xonatron
    Feb 17, 2012 at 17:56
  • I have tried swapping the AJP ports, so that the Tomcat in question has 8009, and the problem still occurs.
    – Xonatron
    Feb 17, 2012 at 18:05
23
+25

Does your HOSTS file have an entry for localhost? Some other situations this error is seen in seem to have this as a problem resolution.

Make sure you have 127.0.0.1 localhost set in it...

(from this and this)

6
  • I am not at work but I will check into this Monday! Thanks so much for the lead.
    – Xonatron
    Feb 11, 2012 at 17:29
  • 127.0.0.1 localhost alone did not work for me. I get the same error. I'm trying to follow some other suggestions in those leads you sent me though. It's tough to debug as a restart fixes the glitch somehow (anyway) so if I restart I won't be testing this solution until the next day. For whatever reason, a reboot fixes this until the next day, probably something to do with shutting down Eclipse at the end of each day.
    – Xonatron
    Feb 13, 2012 at 14:34
  • 127.0.0.1 localhost has not solved the problem, unfortunately. Should I use ::1 localhost.localdomain localhost? Can you explain it for me?
    – Xonatron
    Feb 15, 2012 at 13:59
  • 1
    Take a look at this: en.wikipedia.org/wiki/Hosts_(file) - ::1 is for IPv6 in particular. localhost.localdomain is mentioned here.
    – Adam Rofer
    Feb 15, 2012 at 22:44
  • I actually knew this... but forgot in the moment somehow. Thank you.
    – Xonatron
    Feb 16, 2012 at 13:38
19

Encountered this. all I did was to kill all the java process(Task Manager) and run again. It worked!

0
10

Check whether your config string is okay:

Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999

I just had this issue today, and in my case it was because there was an invisible character in the jpda config parameter.

To be precise, I had dos line endings in my setenv.sh file on tomcat, causing a carriage-return character right after 'dt_socket'

5

EDIT these lines in host file and it should work.

Host file usually located in C:\Windows\System32\drivers\etc\hosts

::1             localhost.localdomain localhost
127.0.0.1       localhost
3

I had the same problem because I set the following in Catalina.sh of my tomcat:

JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999" 

After removing it, my tomcat worked well.

Hope help you.

2

Encountered this issue and changing the debug port helped. For some reason, the debug port had to be greater than the app port.

2
  • 2
    This fixed my issue, debug port was overloaded
    – Stephan
    Aug 11, 2014 at 23:36
  • 1
    And how to change the debug port
    – sakura
    Feb 24, 2020 at 8:38
1

Change control panel Java's option about proxy to "direct", change window's internet option to not use proxy and reboot. It worked for me.

1

This error mostly comes when we forcefully kill the weblogic server ("kill -9 process id"), so before restart kindly check all the ports status which weblogic using e.g. http port , DEBUG_PORT etc by using this command to see which whether this port is active or not.

netstat –an | grep (Admin: 7001 or something, Managed server- 7002, 7003 etc) eg: netstat –an | grep 7001

If it returns value then, option 1: wait for some time, so that background process can release the port option 2: execute stopweblogic.sh Option 3: Bounce the server/host or restart the system.

My issue was resolved by option 2.

1

if your JVM Cli is: -agentlib:jdwp=transport=dt_socket,address=60000,server=n,suspend=n and JDK version is 7, change "server=n" to "server=y" will be OK.

0

In my project I had the same error, I restarted Tomcat and it worked, withtout killing the java process.

0

I set 127.0.0.1 localhost, and solve this problem.

0

I had the same problem in Catalina.sh of my tomcat for JPDA Options:

JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"

After removing JPDA option from my command to start the Tomcat server, I was able to start the server on local environment.

0

I was getting the same error when i switched to STS version 3.8.3 And imported my entire workspace to the new STS.

Apparently the "Boot Spring App" instance was defective. (i run from STS)

If this is your problem, Simply create the Boot run configuration again.

0

In case you are working with environments or docker images you can really change /etc/host I recommend just changing the binding from star to 0.0.0.0.

So (basing on my case for instance) instead of:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"

You would define it as:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.