This blog explains how to configure Java debugger for any OUAF product.
Set the parameter WEB_ADDITIONAL_OPT in ENVIRON.INI file to the following
WEB_ADDITIONAL_OPT=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=7757,server=y,suspend=n
The port number (7757) can be set to any port that is not being used.
The parameter can be set during initial configuration or you can go to ENVIRON.INI file and update the value of the parameter.
Run initialSetup.cmd so that the parameter is updated in all the configuration files.
Now start the server
As seen below the listener port is opened up waiting for Remote Java debugging requests
Open Eclipse
Go to Run -> Debug Configurations -> Remote Java Application
Enter the host with the ip of the server on which the above setting was made. In port enter the port number set earlier.
As seen below, eclipse connects to the server and the debugger is connected.
Now open the application and go to the functionality for which the above java code is referred. In this case, the code is for a Web service. Hence opening XAI Submission and executing a request to hit the Java Web Service referred above.
The moment you execute the request, the control reaches the eclipse window. As seen below, the runtime stops at the code line where the debugger is attached. Also the different windows in the debug perspective help to see the various values of variables referred in the runtime.
As seen above, you can hover over different variables to see their runtime values.
Also you can use F5 to step in. F6 to step over.
When you want to end the debugging session, just click on disconnect button
So that’s how a java debugger is attached for an OUAF application. Try it out, let me know in case of any doubts. Happy Debugging.. ☺