Solutions Products Services

Search
Download Contact Us
Documentation Site map
Support About Us
E-commerce SolutionsiPlanet



Executing and Debugging

Execution Time

There are three central actions related to development of particular objects within the Forte IDE; deploy, execute, and debug.

The deploy action can be used upon EJBModules, WebModules, or J2EE Applications. Deployment is done first to establish to the IDE the context by which an associated executable component, such as a servlet, JSP, or web module can then be exercised. Without such context, the IDE will not know which J2EE application contained within a web module should be used or if the execution should occur with only the standalone deployed WebModule.

Therefore, during execution, no deployment activity takes place. Deployment must have been done prior to execution. As a reminder of this, the following message is displayed in the iPlanet Deployment tab of the Output Window whenever an execute action is requested:
 
  Upon execution, the following events occur:
 

NOTE:The KJS is restarted only if you starts the IDE or if a J2EE module has been deployed after the last KJS restart.


 

  • The corresponding web page is the concatenation of the following:

  •  

    Debugging

    You can use the Forte debugger tool to locate and correct bugs in your program. This tool can be used on servlets; JSP debugging is not supported with iPlanet Application Server 6.5.

    When you execute a program with the debugger tool, you can start execution at any servlet. The program stops executing at set breakpoints in the servlet and you can interactively inspect and debug sections of code. To run the debugger tool, designate the entry point into your program by selecting a servlet from the Explorer Filesystems tab, then from the Debug menu select Start.

    This action will:

    Debugging Example

    For this example, we will set a debug breakpoint. This debug example uses the HelloServlet servlet that we created in Creating Servlets in this tutorial.

    1. From the Forte toolbar, select the Editing tab.
    2. From the Explorer, double click to select the HelloServlet node open it in the Source Editor.
    3. Select the out.println("Hello. You are visitor "+(counter++)); line in the editor.
    4. Right click and select Toggle Breakpoint from the context menu.

      The line appears highlighted in red indicating the location is set with a breakpoint.

    5. From the Explorer, select the HelloServlet node.
    6. From the Debug menu, select Start.

      The KJS process launched in Creating Servlets is killed. After a moment, a debugger message appears indicating that the iPlanet Server engine is restarting. Then, after another moment, a new KJS process is started in the Execution window. Also, the Output window deployment messages appear indicating the WebModule WAR file is created and deployment is finished.

      Additionally, the HelloServlet file displays in the Source Editor with the current breakpoint line displayed in blue.

    7. From the Debug window, select Variables tab.
    8. Locate the counter variable and change the value to 10.

    9. From the toolbar, select Continue to finish executing your servlet.

      The resulting servlet is displayed in the web browser. Notice that the counter variable now appears as 10.

    10. From the Debug menu, select Finish Debugging.

      The Finish Debugging window appears.

    11. Select OK to stop the KJS process in the debugger.

      Congratulations, you have successfully debugged your servlet on a local server.

      You can also debug a deployed EJB in this same manner. Simply set breakpoints in the EJB classes and execute the servlet in debug mode. The application server will then stop on the breakpoints you set in the EJB classes.

      The next step in the iPlanet Application Server Integration Module Tutorial is localization of web modules.

       
         
    See also
      Creating a Session Entity Java Bean

    Legal Notices


    Search