On 13/11/2009 02:33, maven apache wrote:
2009/11/12 Christopher Schultz<ch...@christopherschultz.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To whom it may concern,

On 11/11/2009 8:33 PM, maven apache wrote:
Thanks for your attention.
Actually I did not modify the catalina.bat directly , I create a new bat
named debug.bat in the same directory, the content of the debug.bat is :

-----------------------------------------------------------------------------------------------------------
cd %CATALINE_HOME%/bin

This is not spelled correctly. It should be CATALINA_HOME, not
CATALINE_HOME.

set JPDA_ADDRESS=1044
set JPDA_TRANSPORT=dt_socket

This is the default JPDA_TRANSPORT when using Tomcat's startup scripts.

set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
startup

---------------------------------------------------------------------------------------------------------------
Then I start the tomcat with the debug.bat.

It's tough to tell where the lines end due to word wrapping, but it
looks like this script doesn't do anything but set environment
variables. Is the "startup" word actually on a separate line from the
"set CATALINA_OPTS" line? I'll assume so, otherwise nothing would happen.

Note that you could have put these settings into bin/setenv.sh and it
would be called before calling catalina.bat.

Finally, Tomcat allows you to specify the JPDA_* environment variables
so that you don't then have to re-specify everything in CATALINA_OPTS.
Try deleting your debug.bat file and instead put this into your
CATALINA_BASE/bin/setenv.bat file:

set JPDA_ADDRESS=1044
set CATALINA_OPTS=-server -Xnoagent -Djava.compiler=none

Note that catalina.bat will auto-build the following command-line
arguments when starting up the JVM, given my above settings:

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

Now, you have to start Tomcat like this:

%CATALINA_BASE%\bin\catalina.bat jpda start

This should start Tomcat using all the JPDA options. If you don't use
"jpda start", then all the JPDA_* environment variables are useless. I
can see why you ended up specifying everything in CATALINA_OPTS: because
Tomcat was otherwise ignoring all your settings.

After you get Tomcat started, you'll need to verify that the JPDA
options were actually enabled. If they were, you should have something
listening on port 1044:

C:\Tomcat>  netstat -a -o | find "1044"

If the above command shows something like this:
  TCP    127.0.0.1:1044         Krang:0           LISTENING    332

Then JPDA has properly started and is listening on that port. If not,
try running the netstat command without the "| find" part to see if
that's failing (I tried adding "-b" argument and I got a "requires
elevation" error, so the "find" of course didn't work). If there's
nothing listening on port 1044, then your JPDA configuration is broken
and you should re-post with your current progress.

If it's listening, then you have a problem with your debugger and/or
firewall issues. Since the subject of this thread is "remote debug", I
suspect you are trying to debug over a network. What is the relationship
between the server and the client? Are there firewalls involved? Does
JPDA bind to 127.0.0.1 or to 0.0.0.0 (or some other IP address)? If it
binds to 127.0.0.1, then you'll need an ssh tunnel or something to turn
a remote connection into a localhost one.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr8LgUACgkQ9CaO5/Lv0PDznwCcDKN6CgOYuBYOaOsLnANxBcpE
LacAn1oX3+2oOk5BEBiY20jL54juaN2L
=LdC4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Thanks for your detailed information.
I check it with my own configuration and found that the connection is
established ,however I did not know since there is no message,so I try to
connect the server side again, so I got the connect failed
error................
And now I can connect it ,since I found each time I after I connect the
tomcat start window  will show a message in the below:
Listening for transport at ...1044.
That to say I think the connect of the debug is successful, and I have add
breakpoints in the servlet,so I open a browser and enter:
http://localhost:9000/helloServlet or

If you have a Connector (in server.xml) configured on port 9000 then examine the catalina.out and the other log files for information.

If the Connector is on a different port use that, e.g. 8080.

 http://localhost:8080/helloServlet


http://localhost:1044/helloServlet ,but none of them can open the
page, and the IDE did not turn to the class
where I have add the breakpoints.

Tomcat doesn't serve pages on 1044 - that's purely for the JVM debugger.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to