Search code examples
websphereportletwebsphere-portal

Is it possible to debug a portlet on Websphere Portal?


I'm using Rational Application Developer to develop JSR168 portlets and deploy them to Websphere Portal 6.1. Now I want to debug them.

What I want to do is this workflow:

  1. Develop the portlet and set a breakpoint
  2. Start Portal in debug mode
  3. Deploy the portlet using the right mouse button context menu in RAD
  4. Open portal, create a page, place the portlet
  5. Start the action that should get me to the breakpoint
  6. Use the debug perspective in RAD to debug

Is it possible and is there a tutorial out there?


Solution

  • The process of setting up a portal server on your local development machine is pretty straight forward. I didn't find the setup information at first, but they're available on IBMs website at https://www-304.ibm.com/support/docview.wss?uid=swg21330952 for Portal 6.1.

    The installation took me a couple of hours, but after that you can add Portal in your Rational Application Developer and start it. That's painfully slow on an older machine, and you really want to have 4GB RAM for using it daily.

    If Portal is running, right-click your portlet project and choose Deploy portlet... from the context menu. The portlet will be deployed.

    I have to check, if @Nachtfrost is right with the cleanup of temp directories to re-enable the right-click deployment.

    If right-click deployment does not work for you, try this approach: (this will not allow you to debug your portlets! It's only meant as a workaround to run them at all)

    1. Export your portlet as WAR (right-click the project, choose Export... from context menu
    2. Right-click Portal in your Servers view and choose Open Portal from the context menu
    3. Log in as admin, go to Administration
    4. Go to the web applications menu (I'm writing this from memory, so try to find the menu somewhere around the Portlet administration menu)
    5. Install your portlet from the WAR file, like any other web app
    6. Create a new page, place your portlet on that page