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 177843 - Source code modification is ignored after classic applet is run 1st time
Summary: Source code modification is ignored after classic applet is run 1st time
Status: RESOLVED DUPLICATE of bug 177997
Alias: None
Product: javacard
Classification: Unclassified
Component: Java Card (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-30 06:09 UTC by dkuzmin
Modified: 2009-12-03 15:06 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 dkuzmin 2009-11-30 06:09:47 UTC
Create a new "Classic Applet Project". Add one line to process() method:

    public void process(APDU apdu) {
        ISOException.throwIt((short) (0x9001));
    }

Run the project. Notice this line in the log:


CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 06, cf, cb, 92, 69, e2, dc, Le: 00, SW1: 90, SW2: 01

Last two values is a status word 0x9001, behavior is correct.

Change value in program to 0x9002 and run it again. Output still shows 0x9001 status.

Here is the tail of the log:
----------------------------------
OffCard Installer [v3.0.2]
    Copyright (c) 2009 Sun Microsystems, Inc.
    All rights reserved.
    Use is subject to license terms.
[ INFO: ] [Deleting an instance //aid/CFCB9269E2/DC from http://localhost:8019/cardmanager/]
[ INFO: ] "Off Card Installer validating delete request information"
[ INFO: ] "Off Card Installer sending delete request"
[ INFO: ] Operation completed successfully.

OffCard Installer [v3.0.2]
    Copyright (c) 2009 Sun Microsystems, Inc.
    All rights reserved.
    Use is subject to license terms.
[ INFO: ] Begin load........
[ INFO: ] [Loading app bundle <somedir>\nbp\ClassicApplet2\dist\ClassicApplet2.cap onto http://localhost:8019/cardmanager/ with name ClassicApplet2]
[ INFO: ] "Off Card Installer Validating load information"
[ INFO: ] "Off Card Installer sending load request"
[ INFO: ] Attempt to load module (or) library which was already loaded.
Bundle/Library ClassicApplet2 exists on the card. 
create-instance:

OffCard Installer [v3.0.2]
    Copyright (c) 2009 Sun Microsystems, Inc.
    All rights reserved.
    Use is subject to license terms.
[ INFO: ] [Creating an instance of ClassicApplet2 with instance ID //aid/CFCB9269E2/DC on http://localhost:8019/cardmanager/]
[ INFO: ] "Off Card Installer validating create information"
[ INFO: ] "Off Card Installer preparing create information"
[ INFO: ] "Off Card Installer sending create request"
[ INFO: ] Operation completed successfully.
An instance //aid/CFCB9269E2/DC is created for //aid/CFCB9269E2/DB.
run-client:
Invoking apdutool on <somedir>\nbp\ClassicApplet2/scripts/classicapplet2.scr
ApduTool [v3.0.2]
    Copyright (c) 2009 Sun Microsystems, Inc.
    All rights reserved.
    Use is subject to license terms.
Opening connection to localhost on port 9025.
Connected.
Received ATR = 0x3b 0xf0 0x11 0x00 0xff 0x00 
CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 06, cf, cb, 92, 69, e2, dc, Le: 00, SW1: 90, SW2: 01
run:
BUILD SUCCESSFUL (total time: 3 seconds)
----------------------------------

According to it applet instance was deleted:

[ INFO: ] [Deleting an instance //aid/CFCB9269E2/DC from http://localhost:8019/cardmanager/]

After that there was an attempt to install new version of the module:

[ INFO: ] [Loading app bundle <somedir>\nbp\ClassicApplet2

which failed because old version of module is still there:

[ INFO: ] Attempt to load module (or) library which was already loaded.
Bundle/Library ClassicApplet2 exists on the card.

and after that new instance of old applet version is created:

[ INFO: ] [Creating an instance of ClassicApplet2 with instance ID //aid/CFCB9269E2/DC on http://localhost:8019/cardmanager/]

To run new code user have to stop "device" manually.

Build used is #34.
Comment 1 _ tboudreau 2009-12-01 09:50:32 UTC
Anki, is this expected behavior here?  I.e. should the Run action remove any existing instance of the applet?  Otherwise I think this is the behavior you would get.

This issue probably belongs to the RI and its Ant tasks, not NetBeans, I think - unless the IDE should be doing the delete prior to run (== different Ant script behavior in and out of the IDE).
Comment 2 ankinelaturu 2009-12-02 09:34:50 UTC
Yes, the run should delete instances and unload the bundle.

This probably be an issue in the build file.

run action (or target) should be calling
<jc-delete/>
<jc-unload/>
<jc-load/>
<jc-create/>
in this sequence.
Comment 3 _ tboudreau 2009-12-03 15:06:02 UTC
Closing as duplicate of 177997 - if Unload is not working, that would cause the rest as a side-effect.

*** This bug has been marked as a duplicate of bug 177997 ***