Debugging portlets on local servers

To debug a portlet project on a local server, you will use a portal test environment server. It is recommended that you debug portlets on a local server rather than a remote server.

The process of debugging a portlet application is exactly the same as for 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.

During the debugging phase, most changes to portlets are automatically republished to the test environment. However, some changes, such as changing the portlet name, supported markups or supported modes, may require you to restart the server to confirm the resource changes for your portlet projects.

When you debug a portlet on the local test environment server, the default theme and skin are used. To use a customized theme or skin, refer to Testing and debugging portals

When portlets are published to a test environment server, a Test Environment page is created. Each portlet is placed on its own page under the Test Environment page. Each portlet page has the same name as the associated portlet project.

To debug a portlet application in the test environment:

  1. In the Project Explorer view, right-click the portlet project and select Debug > Debug on Server. The Server Selection panel appears.
  2. Select an existing server under localhost or create a new server. Refer to Defining local servers for testing portlets for instructions on creating servers.
  3. Click Finish. The project is published to the WebSphere® Portal Test Environment, and the server is started in the debug mode. The Web browser is launched automatically.

    If you have set breakpoints in your code, and one of them is hit, you will be asked if you wish to open the Debug perspective.

    To change the behavior of the Debug perspective startup to always open the Debug perspective when a break point is hit, or to never open the Debug perspective when a breakpoint is hit, change the preferences on the Windows > Preferences > Run/Debug page.

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 runtime environment supported by the workbench and must be installed on WebSphere Application Server.
Related tasks
Defining local servers for testing portlets
Defining Web browsers and device emulators
Debugging portlets on remote servers
Deploying portlet projects
Configuring the WebSphere Portal 5.1 Test Environment
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.