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.

Bug 242913 - Debugger for ME projects does not work in OTA mode
Summary: Debugger for ME projects does not work in OTA mode
Status: CLOSED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-14 21:07 UTC by alexander.burdukov
Modified: 2014-04-30 16:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexander.burdukov 2014-03-14 21:07:24 UTC
It is impossible to debug ME project started in OTA mode.
To run in OTA mode ME plugin uses 3 commands:

1. -Xjam:install to install app
2. -Xjam:list to find installed app
3. -Xjam:run to run app found at step 2.

The problem is that debug arguments (-Xdebug -Xrunjdwp...) are appended to the first (-Xjam:install) command, when they must be appended to the last (-Xjam:run) command only.

The bug is in org.netbeans.modules.j2me.common.ant.RunTask class
Comment 1 alexander.burdukov 2014-03-14 21:39:36 UTC
Also, I noted that project properties are not always saved. 
E.g. I tried to debug project in Regular Execution mode, than switched to OTA Execution mode and started debug project again. If repeat these two steps several times switching between execution modes stops working.
E.g. I switch to OTA mode, but project is started in Regular Execution mode, however, project properties shows that OTA mode is selected. After restart of NetBeans project properties shows Regular Execution mode again when it was set to OTA mode before closing NetBeans.
Comment 2 alexander.burdukov 2014-03-14 21:40:43 UTC
Due to the second problem debugger can stop working in Regular Execution mode since internally OTA mode is used.
Comment 3 Roman Svitanic 2014-03-17 15:25:18 UTC
(In reply to alexander.burdukov from comment #0)
> The problem is that debug arguments (-Xdebug -Xrunjdwp...) are appended to
> the first (-Xjam:install) command, when they must be appended to the last
> (-Xjam:run) command only.

If debug arguments are moved to Xjam:run command, then midlet doesn't start at all. In emulator it hangs with status "Starting".

Command is as following (for concrete run, with concrete address): emulator -Xdevice:"EmbeddedDevice1" -Xjam:run=1 -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=50261
Comment 4 alexander.burdukov 2014-03-17 16:13:04 UTC
Yes, you are right. Since OTA mode does not have a console, the emulator.exe exists immediately when the command is completed. "-Xjam:run" command just run an application, but does not wait its completion. It means, that debugger port is closed immediatelly when emulator.exe exits.

Therefore, debugger is not supported in OTA mode.
So, to fix this issue, "Debug" command must always start emulator in Regular Execution mode (however, the mode itself should be kept in project properties).
Comment 5 Roman Svitanic 2014-03-17 17:16:22 UTC
fixed in jet-main:
http://hg.netbeans.org/jet-main/rev/323a1c92a239

(In reply to alexander.burdukov from comment #4)
> So, to fix this issue, "Debug" command must always start emulator in Regular
> Execution mode (however, the mode itself should be kept in project
> properties).

Debug now starts always in Regular Execution, project properties are not changed.
Comment 6 Quality Engineering 2014-03-19 02:36:02 UTC
Integrated into 'main-silver', will be available in build *201403190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/323a1c92a239
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: #242913: Debugger for ME projects does not work in OTA mode - fixed
Comment 7 Quality Engineering 2014-03-20 03:05:48 UTC
Integrated into 'main-silver', will be available in build *201403200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/492857b71882
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: Adding forgotten bundle message (#242913)
Comment 8 alexander.burdukov 2014-04-16 19:41:00 UTC
Verified on latest nightly build.
Comment 9 alexander.burdukov 2014-04-16 20:10:37 UTC
Let's keep it in Resolved state until integration into 80patch1
Comment 10 Roman Svitanic 2014-04-18 08:17:26 UTC
transplanted to release80 branch:
http://hg.netbeans.org/releases/rev/b7669e384ac5
http://hg.netbeans.org/releases/rev/7d64bc9daf26
Comment 11 Quality Engineering 2014-04-24 02:10:44 UTC
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/b7669e384ac5
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: #242913: Debugger for ME projects does not work in OTA mode - fixed
Comment 12 alexander.burdukov 2014-04-30 16:48:17 UTC
Verified on NetBeans 8.0 with all updates available on Apr 30, 2014 applied.
Works for me.
Closing.