Solved

remote debugging

Posted on 2006-06-29
27
744 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

758 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

21 Experts available now in Live!

Get 1:1 Help Now