As a prerequisite, your portal server has to run in debug mode. If that’s not the case, open your configtool, click on the server node and apply the settings as in the screenshot below:
Then you have to restart the server process. After restart you should see in the J2EE Engine view of your Netweaver Studio that Debug Mode is “ON”.
Ok, your server is now ready to debug, all what we need now is a portal application project in the NDS. Fortunately, I’ve already prepared one. It took me weeks of heavy effort to present you this highly-sophisticated, well-designed, hardcore-java portal application project which consists of a single component named FooComponent (applause!).
In the source code, you’re able to set breakpoints by double-clicking at the left side next to your code line. You also can use the right mouse button to use the context menu.
When debugging, the execution of your component will stop right before the line of your breakpoints.
After setting the breakpoints you can start your debugging. Click on “Run” -> “Debug…”
In the debug window’s configuration tree, right click on the configuration “Remote Java Application” and choose “New”.
Your Project should be automatically selected, if not, click “Browse” and select your project.
In the connection properties enter your “Host” and “Port”. The port is the same you specfied in the config tool. For standard portals, it’s 50021.
Now switch to the tab “Common” and change the dropdown box to “Enterprise Portal”.
You’re done. Click “Apply” to save your changes or “Debug” if you want to start immediately.
If you’ve started debugging, switch to the “Debug” perspective and have a look at the “Debug” view. You should see your component and a lot of running threads.
Now invoke your component in your browser window with the Component Inspector or with an iView. The execution should stop at your first breakpoint.
In the “Debug” perspective there also is a view called “Variables” where you can see the values of all variables including the request object. See the screenshot below and the value of my String object “debugTest”.
For going to the next breakpoint, click the “Resume” icon on your “Debug” view or press F8.
To stop debugging, right click on your server node in the “Debug” view and select “Disconnect”.
There are some more features in the debug mode, but you can consult the documentation of your NDS for getting into details.