1 2 Previous Next 16 Replies Latest reply: Mar 1, 2012 6:04 PM by safarmer RSS

    NetBeans java card platform

    Mehmet
      Dear All,

      I need a java card simulator to debug my java card applet code.
      I try to use Java Card Platform on NetBeans IDE 7.1 for debugging purpose. After successfully building the applet and loading it onto the simulated card environment I try to select the applet instance using the following command through the Console.

      select //aid/3F564379F5/00279CD982

      in response I receive the following error.

      "Connection reset by peer: socket write error"

      Is anyone using Java Card Platform for debugging? I would be very happy to hear how to resolve this problem.

      Thanks in advance!

      Cheers!

      Mehmet
        • 1. Re: NetBeans java card platform
          Umer
          Hi,

          Which version of java card you are using java card 3.0 ?
          And for debugging you can use JCOP a eclipse plug-in. By using this you will be able to simulte your applet also.

          Regards
          Umer
          • 2. Re: NetBeans java card platform
            Mehmet
            my deployment environment is Java Card library version 2.2.1 on Gemalto TOP IM GX4(gemXpressoPro). The simulation environment is JCDK3.0.2_ConnectedEdition.
            I used JCOP tools before for simulation but I could not manage to debug bigger size applets. But I will try again. Thanks!
            • 3. Re: NetBeans java card platform
              rohit007
              Mehmet wrote:
              Dear All,

              I need a java card simulator to debug my java card applet code.
              I try to use Java Card Platform on NetBeans IDE 7.1 for debugging purpose. After successfully building the applet and loading it onto the simulated card environment I try to select the applet instance using the following command through the Console.

              select //aid/3F564379F5/00279CD982

              in response I receive the following error.

              "Connection reset by peer: socket write error"

              Is anyone using Java Card Platform for debugging? I would be very happy to hear how to resolve this problem.

              Thanks in advance!

              Cheers!

              Mehmet
              I also use netbeans 7.1 for java card development, and it is working fine, I also debug the code by using break points!!!!!!!!!!!!! for debug why u go to console or how any one can debug the code from console?
              just set the break point and click debug...............................
              • 4. Re: NetBeans java card platform
                Mehmet
                you need to send APDU to the applet to test don't you? Console is the only way to send APDU as far as I know...
                • 5. Re: NetBeans java card platform
                  Umer
                  rohit pathak wrote:
                  I also use netbeans 7.1 for java card development, and it is working fine, I also debug the code by using break points!!!!!!!!!!!!! for debug why u go to console or how any one can debug the code from console?
                  just set the break point and click debug...............................
                  Actually it is not a normal desktop application which you can just execute and debug it using break points. So Mehmat is right while having break points you also need to send APDUs for the applet execution. And it is not necessary to have a console for it you can have GUI base interface also from which you can send and receive APDUs.
                  • 6. Re: NetBeans java card platform
                    rohit007
                    Umer wrote:
                    rohit pathak wrote:
                    I also use netbeans 7.1 for java card development, and it is working fine, I also debug the code by using break points!!!!!!!!!!!!! for debug why u go to console or how any one can debug the code from console?
                    just set the break point and click debug...............................
                    Actually it is not a normal desktop application which you can just execute and debug it using break points. So Mehmat is right while having break points you also need to send APDUs for the applet execution. And it is not necessary to have a console for it you can have GUI base interface also from which you can send and receive APDUs.
                    Ya u surely would be right, after all i m a newbie here!!!!!!!!!!!!!!
                    • 7. Re: NetBeans java card platform
                      rohit007
                      hello,

                      I think u r doing the same which i wanted to do!!!!! so perhaps you can help me, It was easy to make applets and execute apdu by JCRE simulator of Net beans, i used script file which contain APDU , by run application JCRE handle script file and give me result in ouput window, but now i wanted to go up a level, I am trying to make a window application and from there over button click event , i want to execute specific APDU.
                      but my main problem is that I dont have Real java card, and i m bound to use simulator, so
                      // so it is possible to run an apdu from host application button click???? because in actual environment we need to use a java window applicaton!!!!!!!!
                      give me suggestion regarding this
                      • 8. Re: NetBeans java card platform
                        Mehmet
                        I tried to debug on Netbeans with a script file. This time I don't receive a good response to ATR.
                        Any suggestions?
                        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, 3f, 56, 43, 79, f5, 83, Le: 00, SW1: 69, SW2: 99
                        Input data length != Lc around line 21.
                        BUILD SUCCESSFUL (total time: 1 second)
                        • 9. Re: NetBeans java card platform
                          Mehmet
                          Hello Rohit,
                          The following thread has been helpful for me. It might help you as well.
                          Re: RSAEncryption
                          • 10. Re: NetBeans java card platform
                            rohit007
                            Mehmet wrote:
                            Hello Rohit,
                            The following thread has been helpful for me. It might help you as well.
                            Re: RSAEncryption
                            this example have a client application and one applet, here this is using com.sun.javacard.apduio library for making interaction with applet, {i.e pure simulation java card environment }.
                            my problem is :-
                            this contain two .java files
                            1- for applet writing
                            2- client program

                            at a same time both will work together, how can i implement this, I am using netbeans 7.1. I am really stuck here, please guide me.
                            • 11. Re: NetBeans java card platform
                              Mehmet
                              Hello Rohit,

                              I could not exactly solve my problem yet.

                              I saw the following thread. And now trying to use open platform library...

                              power up a JCOP card with client application

                              I will let you know If I can manage to communicate with the simulator..

                              Mehmet
                              • 12. Re: NetBeans java card platform
                                rohit007
                                Mehmet wrote:
                                Hello Rohit,

                                I could not exactly solve my problem yet.

                                I saw the following thread. And now trying to use open platform library...

                                power up a JCOP card with client application

                                I will let you know If I can manage to communicate with the simulator..

                                Mehmet
                                I think u r working over real java card, right? I have a contactless java card and contactless reader,
                                i only want to check that this both are working fine or not,
                                can u give some some line of code by which i can check , it is working fine or not?
                                if card is empty and then we call select applet , it must show response other than 90 00, so show me some line of code to check its working!!!!!!!!!!!!!!
                                • 13. Re: NetBeans java card platform
                                  Mehmet
                                  Hello Rohit,

                                  If you download the Java Card Development Kit (http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javame-419430.html#java_card_kit-2.2.1-oth-JPR)
                                  you will have a set of sample java card applets to use.

                                  You can use JPShell to download the cap files(compiled applet) onto the card and send ADPU to the card to see if you get correct response.

                                  Following link provides all the information to set up the environment and start developing java card applets using NetBeans IDE and GPShell.

                                  https://minotaur.fi.muni.cz:8443/~xsvenda/docuwiki/doku.php?id=public:smartcard:javacardcompilation

                                  I hope this can help.

                                  Mehmet
                                  • 14. Re: NetBeans java card platform
                                    rohit007
                                    Mehmet wrote:
                                    Hello Rohit,

                                    If you download the Java Card Development Kit (http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javame-419430.html#java_card_kit-2.2.1-oth-JPR)
                                    you will have a set of sample java card applets to use.

                                    You can use JPShell to download the cap files(compiled applet) onto the card and send ADPU to the card to see if you get correct response.

                                    Following link provides all the information to set up the environment and start developing java card applets using NetBeans IDE and GPShell.

                                    https://minotaur.fi.muni.cz:8443/~xsvenda/docuwiki/doku.php?id=public:smartcard:javacardcompilation

                                    I hope this can help.

                                    Mehmet
                                    I already have , Netbeans 7.1 and now i have gpshell 1.4.4 ,i think netbeans is capable to making .cap file, did you mean that with use of gpshell i can connect with java card through reader? gp shell would work stand alone or we need to set this to netbeans? i read the link which u passed to me, it seems very good but "it seems very tough to implement" . HELL IS WAITING FOR ME... KIDDING DEAR,
                                    one last thing, anything other than net beans { here we create applet and it automatically create cap file} and gp shell are require to load applet onto the card? OR these is enough to implement wholo java card application- I asked this because i get the term JCOP and etc when i read uploading applet to card.
                                    anyways thanks for your help.
                                    1 2 Previous Next