To check the behavior of a Java EE application, deploy the Java EE application to the server, then start the server. Perform these operations in the Servers view. When the server starts, the Java EE application waits to be invoked from the client. The behavior is checked by invoking Java EE 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.
Preparations for Server Operation
In order to start and stop the server from the workbench, the server must be added to the Servers view. Once the server is added you will need to specify things such as the applications to be deployed to it.
Adding Servers
Add to the Servers view the server that is the application deployment destination for checking the application behavior. Use the New Server wizard to add the server. Right-click the Servers view, then select [New] > [Server] from the context menu. For wizard setup items, refer to the following:
Server's host name
Set the name of the host where the server exists. For a local machine, specify "localhost".
Server type
Select the server type. For an Interstage Java EE container, select [FUJITSU LIMITED] > [Interstage Application Server V11.1 IJServer Cluster (Java EE)].
Server name
The server name can be customized, but modifications made here are not reflected in Interstage Studio, and use the format "IJServer Cluster name [server type name] (host name)"
Server runtime environment
Specify the runtime settings in accordance with the server type. For an Interstage Java EE container, select [Interstage Application Server V11.1 IJServer Cluster (Java EE)].
If the server is an Interstage Application Server, the following setup items are also displayed:
Use HTTPS communication to connect to the target
Select this item if SSL encryption is used. It must match the server settings.
For the server settings, refer to the security property value of the HTTP listener in the Interstage Java EE Admin Console.
Interstage JMX Service Port Number
Set the port number to a value that is the same as the port number of the Interstage Java EE Admin Console. After specifying the port number, click [Login] to check whether login to the server is possible. If login succeeds, [Next] is enabled. If the user does not have administrator permissions, an authentication dialog box will be displayed. Set a user ID and password with administrator permissions.
Admin Console port number
Specify the Interstage Java EE Admin Console port number. The default port number is 12001. It must match the server settings.
For the server settings, refer to the Admin Server port number in the Interstage Java EE Admin Console.
Select IJServer Cluster
In the Servers view, select the IJServer Cluster for operations.
HTTP Port Number and Debug Port Number
The default values are displayed, and can be changed if required.
Stop the IJServer Cluster on shutdown
This checkbox changes to selectable if the IJServer Cluster is on the local machine (not selectable if "server" is selected as the IJServer Cluster). If selected, the IJServer Cluster is stopped on workspace shutdown.
Note that the IJServer Cluster is not stopped for remote machine, when the workspace shuts down. Thus, this checkbox cannot be selected if a remote machine was specified at the wizard.
Point
The Interstage Java EE DAS service can be used to perform operation verification on the local machine. To use the Interstage Java EE DAS service, select "server" when selecting the IJServer Cluster.
A server can also be added using the New wizard.
Note
Refer to "6.2.1 Preparing the Deployment Destination for Verifying Application Operation" for information on the advantages of the Interstage Java EE DAS service and of IJServer Cluster, and for related notes.
For IJServer(J2EE), [Use HTTPS communication to connect to the target] is replaced by [HTTPS is used for the connection to the management console] and, if specified, SSL communication targets only connections to the Admin Console.
Wizard input items may be masked depending on the specified host and IJServer Cluster type.
If the server type was set to a value prior to Interstage Application Server V9.3, set the following values.
Interstage JMX Service Port Number
Specify the Interstage Java EE Admin Console port number. The default port number is 8919.
Admin Console port number
Specify the Interstage Admin Console port number. The default port number is 12000.
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 Projects] 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
If the connection to the IJServer Cluster is not yet established, nothing is displayed in the [Status] column for the IJServer Cluster at the Servers view, and start and stop operations are not performed. In this case, select the IJServer Cluster at the Servers view, then select [Connect/Login] from the context menu to connect to the IJServer Cluster.
If the Interstage Management Service of the server is stopped while connected to the IJServer Cluster, connection to the IJServer Cluster will be interrupted, causing failure of operations of the IJServer Cluster in the Servers view. If operations fail, in the Servers view, select IJServer Cluster, and from the context menu, select [Refresh]. After updating the status of the IJServer Cluster, from the context menu, select [Connect/Login] to reconnect to the IJServer Cluster.
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.
Note
If starting the server in debug mode, and from the project context menu, selecting [Run As] > [Run on Server] or [Debug As] > [Debug on Server], take note of the following points.
If selecting [Run As] > [Run on Server], debug mode must be cancelled. Before execution, in the Servers view, restart or stop the server.
When [Debug As] > [Debug on Server] is selected, the [Debug On Server] dialog box is displayed. Select [Continue in the current mode], then select [OK].
Stopping Servers
To stop the server, select the server at the Servers view, then select [Stop] from the toolbar.
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.
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.
Setting and removing breakpoints
Double-click the ruler part of the editor to toggle between setting and removing breakpoints. In addition, the Breakpoints view can be used to check breakpoints that have been added and to remove breakpoints.
Disabling breakpoints
To temporarily disable a breakpoint, select [Disable Breakpoint] from the ruler context menu, or deselect it from the Breakpoints view. Alternatively, to temporarily skip all breakpoints, select [Skip All Breakpoints] under [Run] from either the Breakpoints view toolbar or the menu bar.
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.
Step Over
The currently selected line is executed, then execution is interrupted at the next executable line.
Step Into
The next expression that needs to be executed in the currently selected line is invoked, then execution is interrupted at the next executable line of the invoked method.
Step Return
Execution up to the next return statement of the current method is restarted, then execution is interrupted at the next executable line.
Resume
Execution continues until the next breakpoint is reached.
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.
In the Servers view, from the context menu, when [Admin Console] is selected, the Interstage Java EE Admin Console is displayed in the editor area.
To display the Interstage Java EE Admin Console, an Internal Web Viewer is used. This is a built-in browser used to display pages on the Web server.
An address bar and toolbar are provided with the Internal Web Viewer.
Address Bar
The address bar shows the [Address] field for entering of the URL of the page to be displayed, along with the following button.
Button | Command | Description |
---|---|---|
Go | Moves to the page belonging to the entered URL. |
Tool Bar
The toolbar shows the following buttons.
Button | Command | Description |
---|---|---|
Go Back | Returns to the previous page that was displayed in the Internal Web Viewer before the current page. | |
Go Forward | Redisplays the page that was displayed before [Back] was clicked in the Internal Web Viewer. | |
Stop | Stops loading of the current page in the Internal Web Viewer. | |
Refresh | Reloads the current page displayed in the Internal Web Viewer. | |
Text Size | Changes the size of displayed characters in the Internal Web Viewer. You can select from the following five sizes: [Largest], [Larger], [Medium], [Smaller], and [Smallest]. |
Note
If displaying the Interstage Java EE Admin Console in the Internal Web Viewer, the address bar is not displayed.
If the Interstage Management Service of the server is stopped, even if [Admin Console] is selected from the context menu, the Interstage Java EE Admin Console will fail to display. In such cases, connection to the IJServer Cluster will be interrupted, therefore reconnection to the IJServer Cluster is required. To reconnect to the IJServer Cluster, in the Servers view, select IJServer Cluster, and from the context menu, select [Refresh]. After updating the status of the IJServer Cluster, from the context menu, select [Connect/Login]. After reconnection is finished, execute [Admin Console] again.