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.
Summary: | JPS debugging is not working properly in free form project when attach is used | ||
---|---|---|---|
Product: | javaee | Reporter: | L Martinek <lmartinek> |
Component: | Web Freeform | Assignee: | Milan Kubec <mkubec> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | abadea, geertjan, jskrivanek, lkotouc |
Priority: | P3 | Keywords: | RELNOTE |
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 57025 | ||
Bug Blocks: |
Description
L Martinek
2004-11-27 17:13:54 UTC
This works when ant debug target is used (there's a bug in doc, though), doesn't work when attach is used - therefore decreasing priority and setting tm - we should fix this for 4.1. Should be part of release notes: JSPs in freeform project can't be debugged when attaching debugger to a process. Use ant debug target as described in help topic 'Writing A Debug Target for a Free-Form Web Project' instead. CCing Geertjan for comments. I tried it on my web free-form project. It looks as fixed. Not fixed. I can still reproduce it in build 20050314-0449. I've just updated the 'Debugging the application' section of the Web Import Guide for 4.1. Here it is: http://testwww.netbeans.org/kb/41/import_web.html It explains how the new web debug target is generated (nothing needs to be customized, but you can select a different server, port number, transport in the debug.properties file) and how it is used. Geertjan: the problem here is debugging when attached to debuggee with 'Attach Debugger...'. It does not relate to target generation. Libor: these problems typically arise when a user does not add web-root directory to Java Sources (node in project's properties dialog). Debugger then stops on bp, but does not mark the line with green color and, in addition, is not able to step. You can check it in Sources view (if web-root is there then debugger will behave well). Could you please verify it? "Libor: these problems typically arise when a user does not add web-root directory to Java Sources (node in project's properties dialog). Debugger then stops on bp, but does not mark the line with green color and, in addition, is not able to step. You can check it in Sources view (if web-root is there then debugger will behave well)." This is a workaround for Beta, right? In the current build I do not need to do this any longer. No it doesn't work when you use 'Run|Attach Debugger' and try to debug free form project. If I add web-root directory to Java sources in properties dialog, it doesn't appear in Sources view. I wonder why it is different from regular web application project (web-root is not added to Java sources but it appears in Sources view). web-root for freeform project is also known, so it should be added to Sources view by default. It is not exact. 1. For debugging via running debug target: stepping works because web-root is added to the sourcepath (in generated target). The workaround lasts even now. But this workaround is not mandatory. User will have to add web-root if he wants to see web-root in Sources view. 2. For debugging via attaching debugger: there is no way how to bring sourcepath to debugger. If user wants to step he MUST add web-root to Java Sources and check it in Sources view if needed. Issue 56345 does not solve the second problem because there is no sourcepath which we could register along with java sources. It is a project-settings issue, thus reassigning to freeform. The web nature needs to register the web root in GlobalPathRegistry when the project is opened. This is not currently supported by the freeform project. I will file an issue. This requires an API change and we're in API freeze, so the fix won't make it for 4.1. Please document the workaround. TM 5.0->TBD Done. Webroots of web freeform projects are registered in GlobalPathRegistry by ProjectOpenedHook as source classpath. Such classpath is then shown in Sources tab of Debugger output window. Checking in WebProjectNature.java; /cvs/web/freeform/src/org/netbeans/modules/web/freeform/WebProjectNature.java,v <-- WebProjectNature.java new revision: 1.11.22.1.2.1; previous revision: 1.11.22.1 done Diff: http://www.netbeans.org/source/browse/web/freeform/src/org/netbeans/modules/web/freeform/WebProjectNature.java?r1=1.11.22.1&r2=1.11.22.1.2.1 Verified in build 20060608-0933. The classpath registered in GlobalPathRegistry does not change as the web root changes (e.g. by the user in the project customizer). The classpath should change its contents and send property change events just as the classpaths registered by the Java nature and the template projects do. The classpath implementation should listen on the project.xml and the property evaluator. Also it seems the getFile() method could be simplified using org.netbeans.modules.ant.freeform.spi.support.Util.resolveFile(). Second try, hopefully better. Webroot classpath changes with project.xml and it provides property change events. Checking in WebProjectNature.java; /cvs/web/freeform/src/org/netbeans/modules/web/freeform/WebProjectNature.java,v <-- WebProjectNature.java new revision: 1.11.22.1.2.2; previous revision: 1.11.22.1.2.1 done Diff: http://www.netbeans.org/source/browse/web/freeform/src/org/netbeans/modules/web/freeform/WebProjectNature.java?r1=1.11.22.1.2.1&r2=1.11.22.1.2.2 Verified. |