Debug with Eclipse/RAD using Factory Model Execution DebuggingAdded by IBM | Edited by Jonathan Booth on November 20, 2010 | Version 2 (Show original)
|The Factory Model Execution Debugger support enables model developers to easily leverage the Eclipse/RAD integrated debugger.
The Factory Model Execution Debugger support enables model developers to easily leverage the Eclipse/RAD integrated debugger.
- 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.
- 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.
- From the Application tree panel, select a specific method, page, event, or data service operation.
- 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, when you start the server using the IBM® WebSphere® Portlet Factory there is an option for starting your server in debug mode. 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 running server other than WAS CE, see the topic, Configuring a server for debugging a model, found at the bottom of this topic.
If you are manually starting WAS CE, add these two Java options to start the server in debug mode:
- Stop the server.
- 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:
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.
@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
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.
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:
- Select Run -> Debug Configurations to open the configuration dialog.
- From the configuration dialog, select the Remote Java Application configuration for your project, and then click the "Debug" button.
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
- Select the Run... menu option to display the Run dialog box.
- From the Run dialog select the Active Model configuration from the WebSphere Portlet Factory Model options, and click Run to launch the model.
- To see the logical structure view of the WebAppAccess object click on the Show Logical Structure in the Eclipse/RAD Debugger view. This is an icon at the top of the Variables view.
- 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.
Parent topic: Debugging a IBM WebSphere Portlet Factory application: wpf7
Debug Tracing builder: wpf7