By ranjansatya on Feb 07, 2007
This blog describes how you can debug a portlet application while you are using NetBeans 5.5 IDE + Portal Pack plug-in for portlet development.
This blog assumes that you are using
- NetBeans 5.5 IDE and Portal Pack Plugin for portlet development
- Open Source Portlet Container on Glassfish application server for portlet deployment
Though Portal Pack plugin starts the Glassfish server automatically from NetBeans IDE, but currently it doesn't starts the server in debug mode. Using the following approach you can quickly debug your portlet application.
Set Debug mode for GlassFish Application Server
- Open NetBeans IDE
- I am assuming that you have already added a Portlet Container instance in your NetBeans IDE
- Go to Runtime window . Right click on Servers > Open Source Portlet Container instance.
- Click "Start" to start the server.
- When the server is started properly. Open http://localhost:4848 in your browser.
- Login to GlassFish Admin Console as "admin" (default password is "adminadmin")
- Go to the "Application Server" page .
- Select the JVM Settings tab and the General option.
- Check the Debug Enabled box.
- Check debug port (default value is 9010)
- Select the Save button.
- Now restart the server through the NetBeans IDE by the same way you had started the server.
Configure debugger in NetBeans IDE
- Go to Run > Attach Debugger menu in title menu bar of NetBeans IDE.
- It will pop-up a dialog box.
- Select Debugger as "JPDA Debugger"
- Select Connector as "SocketAttach"
- Give your machine host. (example, localhost)
- Give debug port no. (Default, 9010).
- Click Ok
- Now the debugger will be attached to the application server's debug port