The simplest way to debug a Java server extension is to attach a Java debugger to the running JVM. By specifying appropriate X-Tension Java options, you can make the JVM initialization wait during Tamino server startup until a debugger is attached.
Any Java IDE that supports JDWP (Java Debug Wire Protocol) should be suitable. NetBeans (from https://netbeans.org/), for example, uses the following JVM options:
-Xdebug -Xrunjdwp:transport=dt_socket,address=xxxx,server =y
where xxxx should be replaced by the relevant address.
The following generic steps should be followed to debug a Java server extension.
Warning: This should only be done on a test database, as it may result in significant performance degradation. |
To debug a Java server extension
Add the required string to the X-Tension Java options (as documented in Administrating Tamino Server Extensions – Specifying Java Options).
Start the Tamino Server. The server start process will wait until you have attached the Java debugger.
Set breakpoint(s) as required in the Java sources of your server extension.
Start the Java IDE and attach it to the Tamino server's JVM (usually by entering the host and port number specified in the JVM options). The start process of the Tamino server will now complete.
Execute the server extension you want to debug. Execution stops if it reaches a breakpoint, and you can use all of your Java IDE's debugging functionality.
To stop debugging, let the server extension execute until it terminates. Stop the server with Tamino Manager and end the Java IDE debugging session.
Remove the debugging string from the X-Tension Java options.
Restart the Tamino server in normal operation mode.