This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 51877 - [40cat] Source file not synchronized during remote debugging
Summary: [40cat] Source file not synchronized during remote debugging
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 4.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Matthew Bohm
URL:
Keywords:
: 56546 (view as bug list)
Depends on: 57457 58980
Blocks:
  Show dependency tree
 
Reported: 2004-11-27 13:50 UTC by vanob
Modified: 2009-09-22 10:33 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vanob 2004-11-27 13:50:48 UTC
[ BUILD # : RC1 ]
[ JDK VERSION : J2SE 1.5.0 ]

I have external tomcat 4.1.31 runnin in debug mode
I attach remotely via socket to the tomcat and debug 
my servlets.

This bug is reproducible with empty user dir always.

Open a servlet and set the breakpoint in the source.
Invoke that servlet. The breakpoint will activate
and you can step over through the lines. No press
Ctrl+F5 (continue). Add one line below the line
where the breakpoint is set. 
int k=0;

Wait until tomcat reload the context.

Now invoke the servlet again. The breakpoint will
activate again but during doing step over the
cursor is hitting wrong lines even empty ones.

Doing detach/attach helps but it's not convenient.
Comment 1 Jan Jancura 2004-12-02 21:25:03 UTC
Can web guys evaluate it, please?
Comment 2 Libor Kotouc 2004-12-08 17:11:32 UTC
I have external Tomcat 5.0.28 and IDE build 041208, JDK 1.5.0. I went
through following steps:

1. I started Tomcat in debug mode,
2. deployed web application on it (from IDE!),
3. attached debugger to it
4. added bp into a servlet,
5. load servlet in browser - it caused bp hit,
6. changed method where bp was set,
7. builded project (F11),
8. finished current http session (behaved in old/unchanged way),
9. repeated step 5,
10. next behavior depended upon context.xml settings:
   a. <context path="/..." reloadable="true">...</context> caused
correct reloading of changed class
   b. <context path="/...">...</context> caused no change in
comparison to original source - container simply did not reload
changed class file (which is also correct)

Well, is there classes/libs reloading correctly set? If changed class
was not reloaded, VM might not return correct values into debugger.
Could you please verify your settings?



Comment 3 vanob 2004-12-09 10:19:05 UTC
Well actually I have context reloadable. As I said 
"Wait until tomcat reload the context."

The workaround of the issue is to just finish debugging
and reattach agian. after that breakpoints work correctly.

So I do the following.
When I want to debug I attach remotely.
If during debugging I change some file I wait until tomcat reloads
the context. Then I press Shift+F5 (Stop debugging) and again attach
to tomcat.

BTW that worked ok in 3.6

Comment 4 zikmund 2004-12-09 10:31:18 UTC
Do you have same problems with Tomcat 5.0.28 (bundled in IDE) when you
add reloadable?
Comment 5 vanob 2004-12-09 10:42:40 UTC
Actually I can not evaluate this situation,
because I have two web apps. One is the base app that serves as a login
application (to achieve single sign on) and the second one is the
application I have encountered the problems with.

I've found out that it's impossible to run two web apps in debug mode
from the IDE using bundled tomcat.

Anyway how it's related to my issue?
Is my configuration (External tomcat 4.1.31) supported on NetBeans 4.0?
Comment 6 zikmund 2004-12-09 10:50:45 UTC
Tomcat 4.x is not supported by NB4.0. I'd like to determine if it is
Tomcat or NetBeans problem, because it seems that it works with Tomcat
5.x.
Could you please create a new simple WebApp and test your scenario on
Bundled Tomcat 5.x? I don't think it is necessary to test it on 'real'
applications.
Comment 7 vanob 2004-12-09 12:12:37 UTC
I could reporduce it with bundled tomcat 5.0.28.

I did the following

1. Created a simple web app. index.jsp is created automatically with the
new web application project.
2. Added the following line in index.jsp after <body> tag
 <a href="debug">Click</a>
3. Created a servlet with the mapping "/debug"
4. Edited META-INF/context.xml and added
reloadable="true" to the context.
5. Started tomcat in debug mode (F5)
6. Set breakpoint in Debug servlet
7. in the browser click on the link
8. The breakpoint is activated.
9. cursor follows source code lines correctly.
10. now changed source code. Add lines, remove lines change the
structure. Compile the servlet with F9.
11. after some time start from the step 7
on the step 9 cursor does not follow source code lines correctly.

Comment 8 Maros Sandor 2005-03-04 10:22:01 UTC
This is a cross-module problem that includes jpda, debuggercore,
webproject and jsp debugger. For this release I suggest a workaround:
Simply invoke the "Fix" debugger action after you redeploy the servlet.
Comment 9 Libor Kotouc 2005-03-16 15:22:28 UTC
*** Issue 56546 has been marked as a duplicate of this issue. ***
Comment 10 Libor Kotouc 2006-08-31 09:55:36 UTC
not fixable in 55.
decreasing to P4, there are more important issues in the debugger area.
Comment 11 Jiri Prox 2008-04-11 01:13:30 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 12 Matthew Bohm 2008-11-25 21:52:26 UTC
I was able to reproduce this on Tomcat 6 using the steps vanob provided for Tomcat 5.0.28.

How might we attempt a fix? Can someone familiar with the underlying mechanism(s) explain? Marking incomplete.
Comment 13 Michal Mocnak 2009-09-22 10:33:52 UTC
Without requested information for long time - INVALID. We can't do anything in this case. Reporter, please add requested information and reopen issue. 
Thanks in advance.