First steps in debugging Apex

As part of creating a small application I've had a few issues getting things to work and had to find out how to get some additional debug info out of Apex to be able to solve the problem.

So far I've made use of the following:

SQL> exec dbms_epg.set_dad_attribute(‘APEX’, ‘error-style’, ‘DebugStyle’);

This enabled debug mode for Apex when run using the EPG option (i.e. no apache or weblogic) - now when i get a 404 error rather than just a blank page i get details of what actually went wrong - very useful

The other option I've made use of is this call inside the Apex application code


This outputs the variable (or text string) or whatever you pass into it to the debug window of the application when run in debug mode.

To activate this debug mode the application has to allow debug - a simple drop down selection in the application properties to allow it.

Once the app allows it you can switch on the debug in one of 2 ways:

1) When you run the app from the developer tool there is a debug button at the bottom of the screen - click this to switch it on.

2) Add YES to the end of the Apex URL which will also activate the mode

Once it is switched on an additional window can be accessed by clicking the "view debug" button at the bottom of the screen. This popup then contains links to the output of the session running the application. Any calls to wwv_flow.debug() are shown in this output.


Post a Comment