Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 218311 - KdpDebugTask do not attach debugger in some cases
KdpDebugTask do not attach debugger in some cases
Product: javame
Classification: Unclassified
Component: -- Other --
PC Windows 7
: P2 (vote)
: 7.3
Assigned To: Tomas Zezula
Depends on:
  Show dependency treegraph
Reported: 2012-09-13 17:28 UTC by alexander.burdukov
Modified: 2014-04-16 19:10 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description alexander.burdukov 2012-09-13 17:28:59 UTC
The problem exists in NetBeans at least starting from 7.1.1 latest nightly 7.2.x and 7.3 builds are also affected.

On slow PCs debugger did not attached, but thinks that it attached successfully.
Reproduced with ME SDK (not in this case it can be reproduced not on every PC), but can be reproduced also using following steps without any emulator:

1. Create any simple Java ME project.
2. Optionally set breakpoint somewhere
3. Open project build-impl.xml file and find "cldc-debug" target
4. In this target comment out or remove invocation of "nb-run" target 
   and set jpda.port property to value some free port.
   E.g. "cldc-debug" target after these changes will look like:
   <target name="cldc-debug" if="cldc-platform.trigger">
            <property name="jpda.port" value="65432"/>
                <sleep seconds="5"/>
                <antcall target="nbdebug"/>

5. Debug the project (probably, several attempt will be required for this step to reproduce)

As the result, you will see following in the output view:

KdpDebugTask connecting to debugger 1 ..
Attached JPDA debugger to localhost:65432
BUILD SUCCESSFUL (total time: 12 seconds)

As you can see NetBeans thinks that it successfully attached debugger, but in fact we even did not opened a port to attach the debugger.

The problem is located it least in KdpDebugTask.execute method. It uses JPDADebugger.attach method to attach debugger. If this method did not thow any exception it is assumed as the debugger is attached. This assumption is incorrect: JPDADebugger.attach returns JPDADebugger object and at least the result value of JPDADebugger.getState() method must be taken into account to detect if the debugger was really attached.
Comment 1 alexander.burdukov 2012-09-13 17:30:49 UTC
The priority is set to P2 since due to this problem debugging with ME SDK works very unstable on wide range of PCs, however, ME SDK workarounded this problem on its side in the nearest release.
Comment 2 Tomas Zezula 2013-01-14 16:21:01 UTC
Fixed jet-main e27e4ab38382
Comment 3 Petr Somol 2013-01-14 17:09:59 UTC
reviewed the patch. false debugger attachment is now prevented.
Comment 4 Quality Engineering 2013-01-15 07:29:36 UTC
Integrated into 'main-golden', will be available in build *201301150001* on (upload may still be in progress)
User: Tomas Zezula <>
Log: #218311:KdpDebugTask do not attach debugger in some cases
Comment 5 Stepan Zebra 2013-01-15 14:42:24 UTC
verified in trunk
Comment 6 Tomas Zezula 2013-01-18 10:14:50 UTC
Integrated into NB 7.3: 5d5eccb709b2
Comment 7 Quality Engineering 2013-01-19 00:03:15 UTC
Integrated into 'releases', will be available in build *201301182100* or newer. Wait for official and publicly available build.
User: Tomas Zezula <>
Log: #218311:KdpDebugTask do not attach debugger in some cases
Comment 8 Stepan Zebra 2013-01-25 11:40:08 UTC
verified in 7.3 RC1
Comment 9 alexander.burdukov 2014-04-16 19:10:55 UTC
Verified on NB8.0. Closing.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo