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.
From TienTien: "The composite application project should have a "Debug Project" action that delegates to its subprojects. This is similar to what NB's enterprise app project has. A enterprise app project can have multiple EJB module projects and web application projects all provide debugging support."
Heighten the priority to P1 as this issue blocks another P1 issue 83255 (which is already fixed in its part)
After elaborating on the issue 83255 and this issue as its related, I've realized that we need to revise our approach in the following aspects. We have three parties involved in the "Debug Project" workflow. These are: - Composite Application Project - JBI Module Projects (such as BPEL Project) - Service Engine's Debugger Engine (such as BPEL Debugger Engine). First, we wanted CompApp project's "debug" target to delegate it to its subprojects' "debug" ant targets (after doing some preparation which includes deployemnt of the CompApp project). Each subproject was supposed to start its own Debug Session which would lead to as many debug sessions as the number of CompApp's subprojects. This approach would also require JBI Module Projects to be dependent on the Debugger Engines. I would like to propose another approach which utilizes the NB Debugging Framework in more extent, particularly, which allows us to have only one Debug Session and have various Debugger Engines registered for it. It is similar to what we can see when debugging some j2ee ear application using NB. In EarApp debugging there is only one Debug Session with two Debugger Engines registered - JSP and Java. When Java breakpoint is reached the Java Debug Engine becomes current, and for JSP breakpoint it would be the JSP Debug Engine. User can see/change the current Debug Engine in the Sessions View - column "Language", but normally he/she doesn't need to go there since NB Debugging Framework does the necessary context switches automatically. So, in the proposed approach, CompApp's "debug" ant target creates a single Debug Session, which doesn't know anything about its subprojects or Service Engines or Debugger Engines. It serves as the context for the various Debugger Engines and provides a lookup to get Session related information like CompApp's base dir and the J2ee Server Instance being used. Debugger Engines may subscribe themselves to the CompApp Debug Session and use its lookup to setup themselves. With this approach we end up with: - CompApp knows only about NB Debugger APIs (doesn't have to know about subproject types or Debugger Engines) - JBI Module Projects doesn't know anything about debugging or CompApp - Debugger Engines know the string ID of the CompApp Debug Session as well as the string keys for the properties in the Sessions's lookup. They might know about JBI Module Projects but they don't have to.
TienTien, Jun, while I was working on the issue 83255 (Improve "start BPEL Debug" workflow), I had to do some modifications in CompAppProject module (locally), and eventually came up with the solution for this issue. This solution uses the approach described in my previous comment, which I hope you will accept. As we really want the issue 83255 to be closed for 5.5.1 (it's P1 RFE and also it will help us in dealing with the tricky P2 bug 79288 - "Debugger confuses BPEL sources from different projects"), I wanted to ask you to review the attached fixes and commit them if you think they are OK.
Created attachment 38030 [details] Suggested fixes for this issue (see description below)
The attached "compapp_fixes.zip" has 7 files put in the folders according the CompApp module structure. Two of them are new and others are modified. As most of the "start debug session" logic was already there, all the modifications are quite simple. The short description per each file follows (you can find more detailed comments in the source files themselves). org.netbeans.spi.debugger.SessionProvider (New, enterprise/compapp/projects/jbi/src/META-INF/debugger/CompAppDebuggerInfo) Registers the CompAppSessionPrivider class in the NB Debugger framework. CompAppSessionProvider.java (New, enterprise/compapp/projects/jbi/src/org/netbeans/modules/compapp/debugger) Registers the "CompAppDebugSession" key in the NB Debugger Framework so that Debugger Engines (such as BPEL Debugger Engine) could include themselves to CompApp Debug Session. Also provides the logic for representing this Session in the Sessions View. SetUpDebugEnvironment.java (Modified, enterprise/compapp/projects/jbi/antsrc/org/netbeans/modules/compapp/projects/jbi/anttasks) Prepares the Map with the debug parameters and starts the debug session. JbiActionProvider.java (Modified, enterprise/compapp/projects/jbi/src/org/netbeans/modules/compapp/projects/jbi) Added ACTION_DEBUG action to supported action list; added mapping from ACTION_DEBUG action to "debug" ant target. build-impl.xsl (Modified, enterprise/compapp/projects/jbi/src/org/netbeans/modules/compapp/projects/jbi/resources) Changed "debug" target definition so that it depends on "run" and "-pre-debug" targets; commented out some jpda-related logic from the target's definition as it wasn't used. Bundle.properties (Modified, enterprise/compapp/projects/jbi/src/org/netbeans/modules/compapp/projects/jbi/ui) Added a label for ACTION_DEBUG action. JbiLogicalViewProvider.java (Modified, enterprise/compapp/projects/jbi/src/org/netbeans/modules/compapp/projects/jbi/ui) Made ACTION_DEBUG action to appear in the CompApp project's context menu
Alexander's fix has been integrated into NB 5.5.1. It should be in 551 beta branch too.