Solved

remote debugging

Posted on 2006-06-29
27
749 Views
Last Modified: 2012-06-21
i m using tomcat 5.5.9 and eclipse 3.1 on windows platform
the source code and eclipse is installed on my macine which ip address is  10.6.1.41
 and tomcat running/listening  port is 8080
 my war file is deployed on linux ,the ip address of linux machine is 10.6.1.14 and the port on which the tomcat is running/listening is 8080
i set configuration parameters in eclipse  under "remote java application"
   as  :
       undet connect tab
           project=my active project name
           connection type=standard (socket attach)
           connection properties:
                      host=10.6.1.41(remote machine port on which war file is deployed)
                      port=8080(same as upper)
           and checked allow termination of remote virtual machine
       under source tab
          i attached the source code of my application

and when i click on debug there is an error


        "FAILED TYO CONNECT TO REMOTE VM.CONNECTION TIMED OUT"

should i need to do some additional setting for this ,i have heard about jpda sockets ???????????

PLEASE HELP ME
THANKS
0
Comment
Question by:riteinfotech
  • 9
  • 9
  • 3
  • +1
27 Comments
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17008222
You have to start the tomcat JVM in debug mode
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17008228
In the startup parameters add this:

-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n

This makes the JVM to run in debug mode and its listens at port 5005.
Now in eclipse, the connection part should be 5005.
0
 
LVL 3

Expert Comment

by:ss_p
ID: 17008235
i agree with ajay
0
 

Author Comment

by:riteinfotech
ID: 17008278
after doing            -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n      
        this the error is -
        '-Xdebug' is not recognized as an internal or external command,
        operable program or batch file.
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17008290
how are you doing this...
generally its set as env variable as
export JAVA_OPTS="-Dlog4j.configuratorClass=com.yahoo.hotjobs.util.HJConfigurator -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"
0
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 168 total points
ID: 17008293
sorry
its should be
export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 166 total points
ID: 17008295
Have a look here for a similar problem (and a possible solution) http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-12959.html
0
 

Author Comment

by:riteinfotech
ID: 17008439
AFTER DOING
      export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"

THERE IS A WINDOW OPEDEN
   HTML EXPORT SAMPLE APPLICATION
 I CLOSED THIS WINDOW  AND START DEBUG FROM ECLIPSE

now the error is


"FAILED TO CONNECT TO REMOTE VM.CONNECTION REFUSED"
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17008592
You should set these env parameters on the linux box where tomcat is running. After setting, restart the tomcat.
0
 

Author Comment

by:riteinfotech
ID: 17008780
what i have to set in env parameters on the linux box where tomcat is running and which env parameter plesse please always explain ur views and solutuons in details ??????????????????
0
 

Author Comment

by:riteinfotech
ID: 17008805
what this all the process is ,can i debug  in case my war file is deployed different machine and platform and and i want to debug from another amchine ,

 in remote debugging we deploy war file from  windows like

         HTML EXPORT SAMPLE APPLICATION
 or in any way

  how this all process is done please???????????
0
 
LVL 3

Expert Comment

by:ss_p
ID: 17009015
Try to add the

startup parameters in startup.bat or startup.sh
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Assisted Solution

by:ss_p
ss_p earned 166 total points
ID: 17009031
try to add

export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"

in startup.sh of the tomcat and restart the server

in your eclipse in debug say your server name and port as 5005. It sould work
0
 

Author Comment

by:riteinfotech
ID: 17015907
for remote debugging on linux environment  i have to add

export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"

but from which directory i need to go into,

i mean first i have to go at tomcat bin directory and than set this on command promt on anything else ,please write the steps
 thanks
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17016135
You can set this on the console from where you are starting tomcat
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17016137
The directory is not important here, since its environment variable
0
 

Author Comment

by:riteinfotech
ID: 17035258
i know that  remote debugging  is applicable on tomcat 5.5.9 but is this applicable on Tomcat 5.5 also because there are not catalina.ch or catalina.bat files in tomcat 5.5 ????????
0
 
LVL 35

Expert Comment

by:girionis
ID: 17035333
How do you start Tomcat? Can you stop it and then start it again by running the Tomcat5.exe?
0
 

Author Comment

by:riteinfotech
ID: 17048339
well i start tomcat from moniter tomcat  option by clicking on Start Service
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17048491
You can set the debugging options as environment variables:
1. Right click "My Computer"
2. Select Properties
3. Goto "Advaned" tab
4. Click on "Environment Variables" at the bottom of the page
5. In the system variable section, click new and add these parameters
   Name : JAVA_OPTS
   Value : -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n
0
 
LVL 35

Expert Comment

by:girionis
ID: 17048544
> well i start tomcat from moniter tomcat  option by clicking on Start Service

Try by executing the file I mentioned above from the command line and see if the problenm persists.
0
 

Author Comment

by:riteinfotech
ID: 17089601
well i set  -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n in environment variable
and

also did set
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE

-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
  on cmd but error
   

  failed to Connect to Vm.Connection timed Out

0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17089647
can you post the result of following command:

netstat -n | find "5005"
0
 

Author Comment

by:riteinfotech
ID: 17089832
the result is  nothing,its just executed without error
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now