How to debug ADF Application
Many times, we receive errors in the ADF UI like PPR error and other errors in the server’s log files. Sometimes, it is hard to find what is the cause of this issue and hard to troubleshoot. Recently, one of our ADF pages has a table that takes 3 minutes to load even I have added pagination and configured Tuning parameters. It is hard to troubleshoot, why it takes huge time, and the plain server logs do not help much.
After we enabled debugging on the ADF Model layer, JDeveloper shows the SQL script that runs behind the screens. That helps me to resolve the performance issue which I have described in the below link.
Enable debugging in ADF application helps to resolve many critical issues. For example, the JDeveloper Compiler limited to resolve EL Expression errors; the EL errors can be observed only at run time, So debugging helps to get more information about the cause of the EL errors. In this section, I have explained the following topics to debug ADF application
1. Enable Debug in ADF Application
2. Enable Debug in Integrated WebLogic Server
3. Log Analyzer
4. Enable Grammar Validation in ADF Application
Note: Enable DEBUG only in Development servers, enabling this in Production leads into Performance issue.
1. Enable Debugging in the ADF application
1.1) You can turn on the ADF diagnostic level to DEBUG in your application by setting the Java System property –jbo.debugoutput=adflogger in your application DEB/RUN configuration. The other supported values are
silent = Hide Diagnostic message in the log file
console = Show Diagnostic message to the console
Custom Java class = Write your own Java class by overriding oracle.jbo.common.IDiagnostic for special instruction to route the diagnostic out put
1.2) Also, Set the -Djbo.adflogger.level=FINEST to track Debug information. FINEST is the highest level in Debugging in Java Logging that shows every debug information in the log file. The other supported values are
Severe, Warning, Info, Config, Fine, Finer, Finest
The below screen displays, how to set these two properties in an ADF application
1.3) Suppose, you want to add this log levels in application configuration instead of the runtime configuration then edit the web.xml file and add the following tags
2. Enable Debug in the Integrated WebLogic Server
We can enable Debug in integrated WebLogic server level so that all the deployed applications show debug information in the JDeveloper console. To enable the debug level:
2.1) Right click on the Integrated WebLogic server and select Configure Oracle Diagnostic Logging for “IntegratedWebLogicServer”
2.2) The logging.xml tab will open in the JDeveloper. Enable FINEST to Oracle.adf and Oracle.jbo to see debug information at ADF Model Layer. Server restart is not required. After enabling this, you will get all the debug information in JDeveloper console. Also, we can the SQL scripts in the console that ADF is running behind the screens.
- TO see debug information on ADF view layer packages then enable oracle.adf and Oracle.adfinternal
- To see debug information on ADF Model layer packages, then enable oracle.adf and oracle.jbo
- To see debug information on ADF Controller layer packages, then configure oracle.adf.controller and oracle.adfinternal.controller
3. Log Analyser
3.1) Log Analyzer is a JDeveloper built in TOOL that allows us to search and see the logs by time, level, and severity. From the main menu, choose Tools > Oracle Diagnostic Log Analyzer to see the Analyzer
4. Enable Grammar Validation
4.1) The enable-grammar-validation setting in adf-config.xml allows you to validate the grammar in ADF Controller metadata before deploying an application. For example, invalid characters in ADF Controller metadata, such as a slash (/) in a view activity ID, are flagged as exceptions.
Open your ADF application >> Expand Application Resources >> Descriptors >> ADF-META-INF and open adf-config.xml >> Click on the Controller tab and toggle on Enable Grammar Validation
This all I usually use to debug ADF application. There are other features available to debug ADF application that I will cover in a later post. Please feel free to share your comments below
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂