Tips and information about Oracle JDeveloper and Oracle ADF

Remote Debugging PL/SQL using JDeveloper

I always find myself a little surprised when I show people that we can do PL/SQL debugging in JDeveloper and they say "we didn't know you can do it". I just realized that if "normal" PL/SQL debugging is a hidden feature of JDeveloper, then you can probably count the number of people that know that we also can do remote debugging of PL/SQL on the fingers of your hand.

So here we go with the 2 minutes explanation of how to remote debug PL/SQL using JDeveloper.

For those not familiar with the concept of remote debugging - basically it means that you set a break point on in your PL/SQL code inside JDeveloper, and then you wait for someone to invoke the code from whatever application - and you are able to debug the code as it was invoked from his environment (parameters and all).

Basically you need to set up an empty project in JDeveloper and in its properties under the run/debug properties set it to do remote debugging and also to "Listen to JPDA" (edit the run configuration for this).

Then you set a breakpoint in your favorite PL/SQL code.

The tricky part now is that whoever needs to invoke the code needs to set his session to send info to your waiting debugger.

You do this by running the following PL/SQL procedure:

DBMS_DEBUG_JDWP.CONNECT_TCP(host, port);

in the case you run this all on your own machine you can use:

DBMS_DEBUG_JDWP.CONNECT_TCP( '127.0.0.1', 4000 );

Then you just invoke the code and JDeveloper will stop at your break point.

With the 'Listen to JPDA' I cannot start the remote debugger.
It gives me the message
"Debugger is not able to listen for JPDA using the specified parameters."
Wondering what is that I need to do to fix this.

Back on orablogs version of this blog somebody asked:
> Is there an easy way to set up integrated
> debugging between a Java application and
> PL/SQL.
A proof of concept of a debugger (using JPDA and Eclipse) for combined call stack debugging of Java and PL/SQl, see http://db-db.sourceforge.net

I am able to configure and debug the java program using JDeveloper.
But the debugger is not entering the PL/SQL packages break points.

Can you please help on this. There is no documentation available for configuring Pl/SQL packages from Java programs.

I am able to debug pl/sql packages from SQLPLUS using the DBMS_DEBUG_JDWP.CONNECT_TCP(host, port); But can we do the Pl/SQL package debugging from the java program without using the above DBMS statement.