Running RestartableTasks Sample Web Application

The RestartableTasks sample demonstrates how a registered task can be automatically available after the card is reset. The sample registers a task that serves data via an HTTP connection to the client.This sample contains two web applications, InfoClient and InfoServer, that demonstrate a registered task that is available after the card is reset.

Running the RestartableTasks sample consists of using the IDE to open the InfoClient and the InfoServer projects, starting the InfoClient and InfoServer applications, and clicking the Register Ping Service hyperlink to display the JCPingServer page. The server is stopped and restarted and the JCPingServer page is displayed.

Before You Begin

Before performing the following procedure, the Java Card 3 Development Kit, Connected Editon must be downloaded and installed on your development system.

The InfoClient and the InfoServer projects are located under the JC_CONNECTED_HOME\samples\web\RestartableTasks folder.


Note - Refer to the Java Card 3 Platform Development Kit User’s Guide for additional details including screen captures.


  1. Click File > Open Project in the main window.
  2. Go to the JC_CONNECTED_HOME\samples\web\RestartableTasksfolder and open the InfoClient and the InfoServer projects.
  3. Select the InfoServer project and click the run button in the main window.

    The IDE compiles, builds, and runs the InfoServer application. When the application runs, the IDE launches the default browser and displays the Restartable Tasks page.

  4. Click the Register Info Service link in the web page to start the JCInfoServer and display the server page.
  5. Select the InfoClient project and click the run button in the main window.

    The IDE compiles, builds, and runs the InfoClient application. When the InfoClient application runs, the hit number is incremented in the output and a different text message is displayed.

  6. Stop and resume the server.
    1. In the cjcre.exe window, kill the server by using ctrl + C.
    2. Open a new Command Prompt window and navigate to the JC_CONNECTED_HOME\bin directory.
    3. Restart the server from the new window by using, cjcre.exe -resume.
  7. Run the InfoClient application.

    The hit number in the output text continues to increment from the previous value.

  8. Close the browser to stop the application.