java - eclipse: remote debugging a tomcat server behind a firewall -
java - eclipse: remote debugging a tomcat server behind a firewall -
after starting tomcat jpda on, while @ company can remote debug bunch of web applications in eclipse. number of reasons in need of developing , remote debugging same webapps outside company firewall, , can access server via ssh on port 22.
i tunneled needed ports (svn, nexus, tomcat itself, server or via server) localhost , services work fine, cannot start eclipse debugger in way; i'm getting "connection timed out while waiting packet xxx" or "connection refused" sec time seek on. checking nmap on server, reports port open before first connection attempt, , becomes closed after that. no interesting output log in catalina.out
the command utilize start tunnel is:
ssh -l 8000:localhost:8000 user@mycompany.com
iptables temporarily stopped both on server , in local machine testing.
am missing something? need forwards other port localhost? or in way involved name resolution?
edit
open ports before connection attemp eclipse:
root@lnxulisse:/opt/apache-tomcat-6.0.32/bin# lsof -p 2147 -n |grep tcp java 2147 root 4u ipv4 640850 0t0 tcp *:8000 (listen) java 2147 root 38u ipv6 640859 0t0 tcp *:http-alt (listen) java 2147 root 40u ipv6 640865 0t0 tcp *:https (listen) java 2147 root 46u ipv6 640908 0t0 tcp 127.0.0.1:18005 (listen) java 2147 root 48r ipv6 642625 0t0 tcp 172.24.0.82:48347->172.24.0.82:mysql (established) java 2147 root 181u ipv6 640891 0t0 tcp 172.24.0.82:60353->172.24.0.82:mysql (established)
and after:
java 2147 root 4u ipv6 642769 0t0 tcp 172.24.0.82:48956->172.24.0.82:mysql (established) java 2147 root 5u ipv4 640851 0t0 tcp 127.0.0.1:8000->127.0.0.1:34193 (established) java 2147 root 38u ipv6 640859 0t0 tcp *:http-alt (listen) java 2147 root 40u ipv6 640865 0t0 tcp *:https (listen) java 2147 root 46u ipv6 640908 0t0 tcp 127.0.0.1:18005 (listen) java 2147 root 181u ipv6 640891 0t0 tcp 172.24.0.82:60353->172.24.0.82:mysql (established)
exact eclipse error returned is:
exception occurred during launch failed connect remote jvm. connection timed out. timeout occurred while waiting packet 204.
(the packet number varies on each attempt).
in workspace/.metadata/.log
get:
!entry org.eclipse.osgi 2 0 2011-07-17 18:43:53.024 !message while loading class "org.eclipse.core.net.proxy.iproxyservice", thread "thread[main,6,main]" timed out waiting (5000ms) thread "thread[thread-6,5,main]" finish starting bundle "org.eclipse.core.net_1.2.1.r35x_20090812-1200 [232]". avoid deadlock, thread "thread[main,6,main]" proceeding "org.eclipse.core.net.proxy.iproxyservice" may not initialized. !stack 0 org.osgi.framework.bundleexception: state alter in progress bundle "reference:file:plugins/org.eclipse.core.net_1.2.1.r35x_20090812-1200.jar" thread "thread-6". @ org.eclipse.osgi.framework.internal.core.abstractbundle.beginstatechange(abstractbundle.java:1073) @ org.eclipse.osgi.framework.internal.core.abstractbundle.start(abstractbundle.java:278) [...] !entry org.eclipse.ui.ide 4 4 2011-07-17 18:43:53.028 !message proxy service not found.
eclipse configured direct net connection.
edit 2
i think solution might here:
http://blog.cantremember.com/debugging-with-jconsole-jmx-ssh-tunnels/
but have problem understanding jndi/rmi settings, , extent applies configuration.
edit 3
this clarification answering "use <lan|local ip address>
instead of <localhost>
"
b , c in 2 different sub-networks in same network infrastructure; connections port 22 of c outside allowed (and "proxied", don't know network internals).
a "outside" (my dsl connection dynamic ip address).
debugging on c b via ssh tunnel -> works debugging on c via ssh tunnel -> connection timed out while waiting packet xxx
this article suggests default port on remote java virtual machine (jvm) listening in debugging mode 1044. should tunnel port on remote jvm running well.
more generally, run wireshark/tcpdump see port connection attempts made when starting debugger.
edit:
a few more things try:
check on remote host (e.g.ps auxwww
if it's linux) arguments (look comes behind -xrunjdwp
or lsof -p pid_of_jvm_to_be_debugged
on tcp port listens (look lines tcp
, listen
in lsof
output) make sure jvm on remote host listens on lo
interface, not network interface (that's specify localhost
in -l
alternative ssh). does starting debugger hand on machine start eclipse jdb -attach localhost:8000
work ? (you seek on remote host ensure debugger running on port 8000) make sure eclipse tries connect localhost
(when not specifying bind address before first 8000 -l
alternative ssh listens on lo
interface) java eclipse tomcat remote-debugging ssh-tunnel
Comments
Post a Comment