Portlet Factory, Version 6.1.2


 

Debug with Eclipse/RAD using Factory Model Execution Debugging

The Factory Model Execution Debugger support enables model developers to easily leverage the Eclipse/RAD integrated debugger. Features include:

  • Simplified server start and application launch in debug mode.

  • Enable breakpoints in generated code.

  • Easier inspection of web application runtime objects such as variables.

See the Eclipse or RAD product documentation for more detailed information about additional features of the Eclipse/RAD integrated debugger. Follow these general steps to debug your model's Java and JSP code with the Eclipse/RAD integrated debugger.

  1. Set a breakpoint

  2. Start target server in remote debug mode

  3. Start a remote debug connection

  4. Run model

  5. Viewing Model Runtime Data

Parent topic: Overview: debugging an application

 

Setting Breakpoints

You can set breakpoint on the following web application tree objects:

  • Method - Select a method in the web application, and break on the first line during method execution.

  • Page - Select a page in the web application, and break on the first line during the page execution.

  • Event Handlers - Select an Event Handler action in the web application, and break on the first line during the event handler's method execution.

  • Data Service Operation - Select the action of a Data Servers as the breakpoint target. This has the same affect of setting the breakpoint on the Method, but allows you to locate the method more easily.
How to set breakpoints:

  1. From the Application tree panel, select a specific method, page, event, or data service operation.

  2. Right click on the web application tree object and set the breakpoint using the Set Breakpoint pop-up menu option

Note: Once a breakpoint is set you can also use the Eclipse/RAD Debugger view breakpoint tab to manage the breakpoints.

 

Starting Server in Remote Debug Mode

To debug a model's Java or JSP follow this procedure to start your server in remote debug mode. If you are using WAS CE, and you started the server through the IBM WebSphere Portlet Factory your server is started in debug mode already. The WebSphere Portlet Factory Designer will prompt you to start the WAS CE either when you deploy your project, or run a model. If you are manually starting WAS CE, add these two Java options to start the server in debug mode:

  1. Stop the server.

  2. Restart using these start options either from the command line or as a script: set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000

If you have already deployed an application, the file, startdebug.bat or startdebug.sh, is automatically generated. You can use this file to manually start your server in debug mode:

@REM Starts wasce in debug mode. set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 startup > WPFstartDebug.log

 

Starting a Remote Debug Connection

Once your server is started in debug mode you will need to start a remote debug connection to the server in order to begin debugging. To assist with this, WebSphere Portlet Factory creates a Remote Java Application configuration for each project. The debug configuration enables the debugger to locate source code that is related to the target project.

  1. To start the remote connection, select Debug... from the Run menu to open the configuration dialog.

  2. From the configuration dialog, select the Remote Java Application configuration for your project, and then click the "Debug" button.

 

Running the Model

With your server running and a remote debug connection you can now launch the target model that you want to debug. Follow these steps to launch the target model that you want to debug:

  1. Select the Run... menu option to display the Run dialog box.

  2. From the Run dialog select the Active Model configuration from the WebSphere Portlet Factory Model options, and click Run to launch the model.

 

Viewing Model Runtime Data

When debugging your model's Java, and JSP follow this procedure to view the data associated with it, which is usually found nested within the WebAppAccess object instance. For example, if you set a breakpoint in a method and want to find the value of a Variable when the method breakpoint is hit you can browse the WebAppAccess object to locate the desired variable and see it's value. Finding the data can be quite difficult since the data is typically buried deep within the WebAppAccess structure. To make locating the model's data easier the WebSphere Portlet Factory Designer provides a logical structured view of the WebAppAccess object

  1. . To see the logical structure view of the WebAppAccess object click on the Show Logical Structure in the Eclipse/RAD Debugger view.

  2. The logical structure view displays.

The WebAppAccess logical structure allows you to easily view the model data types described below:

  • Variables - View the Variable by name.

  • Linked Models - View the Linked Models using its WebAppAccess.

  • Request Inputs - View the request inputs by name.

  • Data Service - Navigate to the service inputs/outputs variables using the Data Service metadata in place of locating the Variable directly.


Library | Support |