Top
Interstage Studio User's Guide
FUJITSU Software

9.6.5 Checking Application Behavior

To check the behavior of a Java EE 6 application, deploy the Java EE 6 application to the server, then start the server. Perform these operations in the Servers view. When the server starts, the Java EE 6 application waits to be invoked from the client. The behavior is checked by invoking Java EE 6 application from the client.
In addition, the application can be debugged by interrupting program execution and executing code one line at a time and checking variable values.

Note

  • After the application is deployed in the following environments, an archive file (such as EAR/WAR) will be created in the workspace folder. Please confirm that there is enough available space on the hard disk.

    • When the application is deployed to a remote server.

    • When the application is deployed to a localhost where [User Real Jar Archives for Deployment] of the server page is selected.

  • When WebServer(Interstage HTTP Server 2.2) and WebServer connector (used in Interstage HTTP Server 2.2) are used to confirm the application actions, refer to "Web Server Linkage Restrictions" in the "Interstage Application Server Java EE Operator's Guide (Java EE 6 Edition)".
    During the setting of WebServer integration, the following operations are needed if the asadmin command is not available.

    • After the application is deployed, it is necessary to add the assignment target application through the add-application-ref sub command of the wscadmin command.

    • After the application deployment is cancelled, it is necessary to delete the assignment target application through the delete-application-ref sub command of the wscadmin command.

Specifying the Project to be Deployed to the Server

The project to be deployed to the server is specified by adding the project to the Servers view server. Use the Add and Remove Projects wizard to add the project to be deployed to the server. To launch the Add and Remove Projects wizard, select the server at the Servers view, then select [Add and Remove] from the context menu.
A project can also be added using the last page of the New Server wizard.

Point

To deploy an application manually, select the server, then select [Publish] from the context menu. If [Clean] is used, all deployed applications are temporarily discarded and then redeployed. If the application is synchronized with the server, "synchronized" is displayed as the status. If not synchronized, "Republish" is displayed.

Starting Servers

In the Servers view, select the server, then select either [Start] or [Debug] from the context menu. The application can be deployed automatically when the server starts. The default setting is that applications are deployed automatically when the server starts.

Point

  • The user can select the project, then select [Run As] > [Run on Server] or [Debug As] > [Debug on Server] from the context menu to add the server, add the project, launch the server, and launch the client all together.

  • To set such that the application is not deployed automatically when the server starts, select [Server] > [Launching] from the Preferences page, then set [Automatically publish when starting servers] to off.

Stopping Servers

To stop the server, select the server at the Servers view, then select [Stop] from the context menu.

9.6.5.1 Debugging

This section describes the debugging that is used to detect logical errors in programs.
To debug an application, set breakpoints to interrupt the launched program, and then execute the code one line at a time and check the variable content.

Breakpoints

Program execution is interrupted at the lines where breakpoints have been set. When execution is interrupted, a confirmation dialog box asking whether or not to open the Debug perspective is displayed. The Debug perspective is comprised of layouts used during debugging, such as the Debug view, the Variables view, and the Breakpoints view.

Note

If breakpoints have been set in a JSP file, execution is also interrupted for JSP files with the same name in different folders.

Execution Control

Various methods are available for restarting execution of execution-interrupted programs, including step over, step into, step return, and resume. To execute these commands, select stack frame from the Debug view, then select a command from [Run] in the Debug view toolbar, context menu, or menu bar.

Checking and Changing Variable Values

When a stack frame is selected, the variables that are visible in that stack frame can be displayed in the Variables view.
Primitive type values are displayed in the Variables view. If complex variables are expanded and their members are displayed, these can be inspected. Values can be changed using [Change Value] under the context menu.

Point

Debug information must be added to a compiled class file in order to reference variable values and perform debugging. The default setting is that the debug information required for debugging is added to the class file. If debugging is not required, for example, when deploying to an operating environment, the size of the class file can be reduced by not adding the debug information.

The debug information is used to display source file names and line numbers in the stack trace that is output when, for example, an exception is thrown. It is recommended to add source file names and line numbers to a class file.