Basics: Debugging with Oracle Weblogic Server

Markus Eisele
Remote Debugging a JVM is quite simple at all. This is the same, if you are trying to debug an Oracle Webglogic Server instance.
Grep your favourite IDE and give it a try.

First thing to do, is to enable Debugging with Oracle Weblogic Server. Look out for the startWeblogic.cmd/sh in your Weblogic Server Domain and add the needed properties to the java options:

set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n

JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
export OPTIONS

The -XDebug parameter enables debugging. The -Xnoagent parameter disables the default debug agent. The -Xrunjdwp parameter loads the JPDA reference implementation of JDWP. Debugging is enabled on port 4000. The JDWP protocol is the protocol used to debug with a remote debugger.

After this, start the WebLogic Server by invoking the startWebLogic.cmd/sh script.

Next step is to deploy your application to the server. You can do this, however you like to. Use the Oracle Enterprise Pack for Eclipse or the autodeploy feature or even the weblogic administration console.

Now start your favourite IDE and look out for the debugging view. If you are using Eclipse, open the Debug configurations and choose "Remote Java Application" and press the "new Launch Configuration" button and enter the needed values.

Now we must start the remote debugger. Right click on the class you want to debug and choose "Debug As" and your server configuration. The only thing left to do is to set the needed breakpoints in your code.

Post a Comment


Post a Comment (0)