Debugging portlets
You can debug portlet applications that are running on WebSphere Portal installed locally on your workstation or on a remote machine.
The process of debugging a portlet application is the same as debugging a Web application. You can control and trace the execution of the portlet. You can set the break points in the Java source code and the JSP files.
To debug your portlet application, you need to define a WebSphere Portal Test Environment server (for local debugging) or a WebSphere Portal Server Attach server (for remote debugging). For more information on creating servers, refer to Defining servers for testing portlets.
Local debugging
You can debug a portlet application running on WebSphere Portal installed within the workbench. The behavior of the portlet application is the same as when it runs on WebSphere Portal. To enable local debugging, do the following:
- Select to install the WebSphere Portal Test Environment component at installation time.
- Create a WebSphere Portal Test Environment server definition.
For more information on the local debugging, refer to Debugging portlets locally.
Local debugging benefits
When debugging locally, the server is running against the resources that are in the workbench. Therefore, you can add, change, or remove a resource from a portlet project and the server will pick up these changes automatically. In the local debugging, the following operations required to debug portlets are automatically executed when you start the server.
- Installing or updating portlets to WebSphere Portal using Portal Administration functions.
- Adding the portlet application to the page container.
It is recommended that you debug portlets locally, unless debug them remotely.
Local debugging restrictions
To debug the following kinds of portlet applications, remote debugging is the only option:
- Personalized portlet applications. Refer to Troubleshooting, for more information.
- Portlet applications that require components that are not included in the run-time environment supported by the workbench and must be installed on WebSphere Application Server.
To continue debugging after changing portlet properties, such as the portlet name or supported markups and modes during debugging, you may have to publish on WebSphere Portal and restart the server.
Remote debugging
You can debug a portlet application running on WebSphere Portal on a remote system accessible through a network connection. Do the following to debug remotely:
- Install WebSphere Portal on a remote machine and enable debug mode.
- Access WebSphere Portal as an administrator.
- Create a WebSphere Portal Server Attach server definition.
- Deploy portlets to WebSphere Portal. You can use Debug > Debug on Server option, or you can deploy them manually using the Portal Administration of WebSphere Portal.
For more information on the remote debugging, refer to Debugging portlets remotely.
Remote debugging benefits
Remote debugging is useful when the program that you are debugging is running on another system and behaves differently on that system than on your own.
Remote debugging restrictions
Remote debugging is similar to local debugging. Changes made in the workspace require republishing before they take effect on the server. There could also be network delays.
Related tasks
Debugging portlets locally
Debugging portlets remotely
Defining servers for testing portlets
Related reference
Troubleshooting