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.
[NetBeans 4.0 FCS, JDK 1.4.2_06] 1. Start AppServer 2. Open properties of JVMs node and change value of jpds_port_number property. 3. Stop Server 4. Debug project. Debugger tries to connect to old port number.
LiboreM, there's a difference in which kind of project you are trying to debug. Was it a web project? Please provide full info. Thanks.
I debugged "Web Application" created by wizard.
The problem is al little bit complicated. When appserver is running and I change debug port number, this change is propagated to debugger. When I start debugger (without appserver restart), debugger tries to connect to new port number, but appserver is still running with old port number so connection fails. In tomcat, it's solved by disabling properties change when tomcat is running. If you do this for appserver, you would not be able to change properties at all, because properties are not available when appserver is not running. On the contrary, there is another problem. If I manually stop server after debug port number change and start debugger, appserver is started properly with new debug port number, but debugger connects to old port number. So connection fails again. Result is that I am not able to change debug port at all.
Small correction: If I change debug port and manually stop server then debugger tries always to connect to port 1044, whatever old port was. Second debugger start is OK and debugger connects to new port.
On Windows, the plugin automatically changes the debug setting from dt_socket to sh_mem because of a JDK bug that would prevent further debugging... So If you have on windows, you cannot use dt_socket and the app server 8. If this the case? See bugs 4989322 and 5029980 jdk 1.4 bug)( http://andorra1.sfbay:8080/cgi-bin/ws.exe/bugtraq/jdk/bug.hts?bugid_value=4989322 http://andorra1.sfbay:8080/cgi-bin/ws.exe/bugtraq/jdk/bug.hts?bugid_value=5029980 and http://andorra1.sfbay:8080/cgi-bin/ws.exe/bugtraq/jdk/bug.hts?bugid_value=5008234 Thanks,
This issue is for all OSs and is about socket debugging. You probably wanted to reply on issue #52393, which is exectly what you discribed.
Cannto fix for the 4.0 release. Need release notes. For 4.1 we might remove this logic since the latest JDK 1.5 has the fix.
Are you still talking about this bug? What logic? This bug is about that sometimes the debugger tries to connect to port 1044 regardless what is set in properties. But when I tried it with plugin 041222 I wasn't able to reproduce it so it's probably fixed.
fixed in the 4.0 plugin...We cache the debug info in the user settings. Still same issue in the 4.1 code base, so we might want to open another bug there... The real fix then will be to fix someting in J2EEServer module to query for the debug info after the server is started and not before.
I verified it's fixed in 4.0. It's still present in 4.1 so I am reopening this bug to be fix in 4.1.
*** Issue 52393 has been marked as a duplicate of this issue. ***
This is because getDebugInfo() is always called with a NULL Target This is wrong, it sohuld be called: 1/ only when the target is running 2/ with the correct target. The plugin needs ther target to be running to query its debug values. I did a hack in nb4.0 to locally store the valuees, but we need to fix the bug in j2eeserver. BTW, this was working in nb3.6 ans is a regression http://www.netbeans.org/download/dev/javadoc/J2EEServerAPI/org/netbeans/modules/j2ee/deployment/plugins/api/StartServer.html#getDebugInfo(javax.enterprise.deploy.spi.Target)
The problem is dual, both in webproject (and other devmodules) and j2eeserver. The fix in j2eeserver for calling getDebugInfo with non-null target is trivial. I could check in the change tonight. The other part involving restart server instance is more controversial. Currently devmodule build-impl.xml call jpda tasks asking for debuginfo way before nbdeploy, while restart/start only happen during nbdeploy. We have 3 fix options: (1) move the init for jpda.host/address till after nbdeploy. (2) check and start/restart during J2eeModuleProvider.getServerDebugInfo() before query and return debuginfo. (3) plugin start/restart server in debug mode immediately when user change debug port. Since options (2) and (3) have UI ugliness, (1) seems to be best and simple solution.
go for 1/
Checked in j2eeserver and web/project changes. This main test case will work. /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/spi/J2eeModuleProvider.java,v <-- J2eeModuleProvider.java new revision: 1.40; previous revision: 1.39 /cvs/j2eeserver/ant/antsrc/org/netbeans/modules/j2ee/ant/Deploy.java,v <-- Deploy.java new revision: 1.17; previous revision: 1.16 /cvs/web/project/src/org/netbeans/modules/web/project/WebActionProvider.java,v <-- WebActionProvider.java new revision: 1.50; previous revision: 1.49
For completeness, we still need to have plugin implement StartServer.needsRestart and the test case for that would be changing debug port while already in debug mode (sounds not very interesting use case though). Also, same test case but with other j2ee projects (ejbjarproject, earproject). I only did web/project.
Fixed in the plugin repository for now. Will check in later in nb_all
fixed, we implement now correctly StartServer.needsRestart
verified