?
Solved

remote debugging

Posted on 2006-06-29
27
Medium Priority
?
772 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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 672 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 664 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
 
LVL 3

Assisted Solution

by:ss_p
ss_p earned 664 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

801 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