Debugging portlets on local servers

You must have a local install of the WebSphere® Portal V6.0, or higher, to debug a portlet project on a local 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 the portlets are automatically republished to the test environment. Some changes, like changing the portlet name, supported markups or supported modes, might require you to restart the server to confirm the resource changes for your portlet projects.

When you publish portlets to a local test environment, a Rational Portlets page is created in which each portlet is its own page, and where 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 click

    Debug As | 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 local test environment, and the server is started in the debug mode. The Web browser launches automatically.

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

    If you want the Debug perspective to always start when a break point is hit, or to turn it off completely, change the preferences on the

    Window | Preferences | Run/Debug page.

Restrictions: Remote debugging is the only way to debug the following types of portlet applications:

 

Related tasks

Testing and debugging portlets

Defining local servers for testing portlets

Defining Web browsers and device emulators

Debugging portlets on remote servers

Deploying portlet projects