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.
(Reported few weeks ago directly via email.) Concrete scenario (NB 5.0beta/daily build & Profiler M9/daily build): - I start Tomcat using the Run Main Project action for a webapp - While Tomcat is running, I choose Profile Main Project for the same webapp - The task tries to start already running Tomcat again, which leads to java.net.BindException: Address already in use and related errors. Starting profiling session then fails. The problem is that before starting Tomcat in profiling mode it isn't stopped by the task first, ignoring the forceRestart attribute which is hardcoded to 'true' in buildscript. The problem is in ServerInstance.startProfileImpl() method. Concrete comments to the source code are attached below. Here is summary of when the running server has to be stopped first before starting it again in profiling mode: - if it's running in non-profiling mode - if it's running in profiling mode but requested server settings differ from current - if it's running and the forceRestart attribute is set to true Moreover, any other server currently running in profiling mode has to be stopped first, before testing previous 3 conditions. Please fix this for 5.0.
Created attachment 25920 [details] Problematic code fragment with comments
TM -> 5.0
*** Issue 67523 has been marked as a duplicate of this issue. ***
F. Checking in ant/antsrc/org/netbeans/modules/j2ee/ant/Bundle.properties; /cvs/j2eeserver/ant/antsrc/org/netbeans/modules/j2ee/ant/Bundle.properties,v <-- Bundle.properties new revision: 1.3; previous revision: 1.2 done Checking in ant/antsrc/org/netbeans/modules/j2ee/ant/StartProfiledServer.java; /cvs/j2eeserver/ant/antsrc/org/netbeans/modules/j2ee/ant/StartProfiledServer.java,v <-- StartProfiledServer.java new revision: 1.3; previous revision: 1.2 done Checking in ant/src/org/netbeans/modules/j2ee/ant/Bundle.properties; /cvs/j2eeserver/ant/src/org/netbeans/modules/j2ee/ant/Bundle.properties,v <-- Bundle.properties new revision: 1.5; previous revision: 1.4 done Checking in src/org/netbeans/modules/j2ee/deployment/devmodules/api/Bundle.properties; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/Bundle.properties,v <-- Bundle.properties new revision: 1.6; previous revision: 1.5 done Checking in src/org/netbeans/modules/j2ee/deployment/devmodules/api/Deployment.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/Deployment.java,v <-- Deployment.java new revision: 1.22; previous revision: 1.21 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/Bundle.properties; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/Bundle.properties,v <-- Bundle.properties new revision: 1.34; previous revision: 1.33 done RCS file: /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerException.java,v done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ServerException.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerException.java,v <-- ServerException.java initial revision: 1.1 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ServerInstance.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerInstance.java,v <-- ServerInstance.java new revision: 1.68; previous revision: 1.67 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/TargetServer.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/TargetServer.java,v <-- TargetServer.java new revision: 1.44; previous revision: 1.43 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ui/ProgressUI.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/ProgressUI.java,v <-- ProgressUI.java new revision: 1.17; previous revision: 1.16 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/DebugAction.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/DebugAction.java,v <-- DebugAction.java new revision: 1.3; previous revision: 1.2 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/ProfileAction.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/ProfileAction.java,v <-- ProfileAction.java new revision: 1.3; previous revision: 1.2 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/RestartAction.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/RestartAction.java,v <-- RestartAction.java new revision: 1.5; previous revision: 1.4 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/StartAction.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/StartAction.java,v <-- StartAction.java new revision: 1.4; previous revision: 1.3 done Checking in src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/StopAction.java; /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/actions/StopAction.java,v <-- StopAction.java new revision: 1.5; previous revision: 1.4 done