![Page 1: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/1.jpg)
![Page 2: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/2.jpg)
<Insert Picture Here>
How to Debug Oracle Application Framework Applications
Lynn MunsingerSenior Principal Product ManagerOracle JDeveloper & ADF
![Page 3: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/3.jpg)
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
![Page 4: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/4.jpg)
"My ADF Application's Not Working… Help!"
• "I see an exception stack trace…"• "I get data, but it's the wrong data…"• "I expect to see data, but no rows appear…"• "My application is slow…"
![Page 5: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/5.jpg)
Start by Getting More Contextual Informationand Trying to Isolate the Problem
• Enable Debug Diagnostics– Verbose trace of what happens before problem occurs
• Try to reproduce using the BC Tester– Avoid web app restart delay as you narrow down the problem
• Try to reproduce using a standalone test client– No UI interaction required = fastest option of all
![Page 6: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/6.jpg)
HOW TO…
Enable Diagnostic Logging
![Page 7: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/7.jpg)
Enable Diagnostic Logging► Creating Run Config with ADF Logging Enabled
Main Menu: { Tools | Preferences… }
![Page 8: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/8.jpg)
Enable Diagnostic Logging► Create New Run Configuration
Main Menu: { Application | Project Properties… }
![Page 9: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/9.jpg)
Enable Diagnostic Logging► Name New Run Configuration
![Page 10: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/10.jpg)
Enable Diagnostic Logging► Edit New Run Configuration
![Page 11: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/11.jpg)
Enable Diagnostic Logging► Add –Djbo.debugoutput=console to Java Options
![Page 12: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/12.jpg)
Enable Diagnostic Logging► Choosing Active Run Configuration
![Page 13: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/13.jpg)
HOW TO
Debug with the Business Components Tester
![Page 14: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/14.jpg)
Debug with the Business Components Tester► Right-click Debug to Use Default Configuration
![Page 15: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/15.jpg)
Debug with the Business Components Tester► Debug Specific Configuration In AM Editor
![Page 16: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/16.jpg)
Debug with the Business Components Tester► Double-click App Module to See Client Methods
![Page 17: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/17.jpg)
Debug with the Business Components Tester ► Choose Method, Enter Params, and Execute
![Page 18: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/18.jpg)
Debug with the Business Components Tester ► Double-click View Instance to See Data
![Page 19: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/19.jpg)
Debug with the Business Components Tester ► Alternatively, Show Data in Editable Table
![Page 20: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/20.jpg)
Debug with the Business Components Tester ► If Needed, View Object Operations Available
![Page 21: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/21.jpg)
Debug with the Business Components Tester ► Choose Method, Enter Params, and Execute
![Page 22: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/22.jpg)
HOW TO
Create a Command-LineTest Client Program
![Page 23: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/23.jpg)
Create a Command-Line Test Client Program► Create a New Java Class with main() Method
![Page 24: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/24.jpg)
Create a Command-Line Test Client Program► Use bc4jclient Code Template
![Page 25: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/25.jpg)
Create a Command-Line Test Client Program► Replace AM, Config, VO Names Appropriately
![Page 26: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/26.jpg)
Create a Command-Line Test Client Program► Write Code to Work with AM and/or VO
![Page 27: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/27.jpg)
HOW TO
Export Debugger Call Stack and Exact JDev/ADF Version
![Page 28: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/28.jpg)
Export Debugger Call Stack► Visit Stack Window Preferences
![Page 29: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/29.jpg)
Export Debugger Call Stack► Enable Line Numbers in Stack Window
![Page 30: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/30.jpg)
Export Debugger Call Stack► Export the Stack to a Text File
![Page 31: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/31.jpg)
Copying Exact Build Information to the Clipboard
![Page 32: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/32.jpg)
TIP
Having the ADF Source Code Makes a Big Difference
![Page 33: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/33.jpg)
Without ADF Source…Parameter Insight Only Gives Data Types
![Page 34: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/34.jpg)
With ADF Source…Parameter Insight Shows Parameter Names, Too
![Page 35: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/35.jpg)
Without ADF Source…Quick JavaDoc Does Not Work At All
![Page 36: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/36.jpg)
With ADF Source…Quick JavaDoc Gives You Instant Overviews
![Page 37: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/37.jpg)
Without ADF Source…Only Method Breakpoints in Fwk, and No Stepping
![Page 38: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/38.jpg)
With ADF Source…Break Anywhere, Step Into Anything
![Page 39: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/39.jpg)
Without ADF Source…Go To Declaration Shows Only Decompiled Stub
![Page 40: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/40.jpg)
With ADF Source…Go To Declaration Really Goes There
![Page 41: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/41.jpg)
With ADF Source, and Find Usages…Find Where Exceptions Thrown, Properties Used, Diagnostics Printed, and More
• PropertyConstantsPropertyMetadata(oracle.jbo.common)
– Configuration Property Definitions
• CSMessageBundle(oracle.jbo.common)
– ADF Business ComponentsRuntime Error Messages
• ADFmMessage(oracle.adf.model)
– ADF Model Data Binding Runtime Error Messages
![Page 42: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/42.jpg)
Requesting the ADF Source Code Is Painless
1. Open a Service Request on Metalink– Indicate exactly the JDev/ADF release you are working with
(for example, 11.1.1.1.3)
2. Have the Legal Agreement Signed– Typically VP or higher but depends on the company– Signer's company must be same as the CSI number
3. Return the Legal Agreement to Oracle– Scan the agreement and email it
4. Support Updates the SR with Download Link– Download the source
![Page 43: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/43.jpg)
HOW TO
Set Up and Use Oracle ADF Source for Debugging
![Page 44: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/44.jpg)
Set Up Oracle ADF Source for Debugging► Create New Library
Main Menu: { Tools | Manage Libraries… }
![Page 45: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/45.jpg)
Set Up Oracle ADF Source for Debugging► Name Library and Add Source Path Entry
![Page 46: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/46.jpg)
Set Up Oracle ADF Source for Debugging► Select ADF Source Zip File
![Page 47: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/47.jpg)
Use Oracle ADF Source for Debugging ► In Project Properties, Add Library
![Page 48: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/48.jpg)
Use Oracle ADF Source for Debugging ► Select ADF Source Library You Created Earlier
![Page 49: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/49.jpg)
Use Oracle ADF Source for Debugging► With Library in Your Classpath, Ready to Debug
![Page 50: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/50.jpg)
HOW TO DEBUG
Exception with Stack Trace
![Page 51: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/51.jpg)
Symptom: NullPointerException on Navigation
![Page 52: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/52.jpg)
Log Window Gives More InfoDouble-click To Maximize Tabbed Contents
![Page 53: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/53.jpg)
Framework Caught Unexpected ExceptionScroll Down to See Original Cause
![Page 54: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/54.jpg)
NullPointerException in EmpImpl.validateEmp()Click on the Hyperlink to Open Source
![Page 55: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/55.jpg)
If getComm() Returns null, We Have a ProblemVerify Your Suspicion Using Exception Breakpoint
![Page 56: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/56.jpg)
In the Breakpoints Tab…Create a New Exception Breakpoint
![Page 57: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/57.jpg)
Use In-Field Classname Insight or Dropdownto Specify Exception Class Name
![Page 58: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/58.jpg)
Debug the Application Again Using theBusiness Components Browser
![Page 59: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/59.jpg)
Unrelated Code Also Throws NullPointerException!Delay Enabling Breakpoint to Avoid Stopping Here
![Page 60: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/60.jpg)
Navigate to Source of ApplicationModuleImplUsing Go to Java Type…
![Page 61: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/61.jpg)
Type Enough of the Class to Narrow the ListCamelcase Matching Saves Keystrokes
![Page 62: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/62.jpg)
Navigate to prepareSession() MethodUsing Quick Outline
![Page 63: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/63.jpg)
Type to Narrow the Method ListUse Arrows+[Enter] or Mouse to Navigate
![Page 64: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/64.jpg)
Set a Breakpoint in prepareSession()This Occurs After AM is Checked Out of Pool
![Page 65: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/65.jpg)
Edit Exception Breakpoint to Add Group Name
![Page 66: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/66.jpg)
Name the Breakpoint Group Anything You Like
![Page 67: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/67.jpg)
Edit the prepareSession() Breakpoint
![Page 68: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/68.jpg)
Visit the Actions Tab
![Page 69: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/69.jpg)
Configure the Action to Enable a Breakpoint GroupChoosing Yours from the List
![Page 70: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/70.jpg)
Disable the Breakpoint Group By DefaultAction Will Enable it at prepareSession() Time
![Page 71: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/71.jpg)
Debug Again. Only Stop at NullPointerExceptionAfter First Hitting the prepareSession() Breakpoint
![Page 72: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/72.jpg)
Add a Watch Expression for getComm()to Inspect Value of the Comm Attribute
![Page 73: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/73.jpg)
Suspicion is Confirmed, It's Null
![Page 74: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/74.jpg)
Add Null Protection to Fix the BugDebug and Test to Verify Your Fix
![Page 75: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/75.jpg)
Summary of Techniques Used in the Example
• Exception breakpoints– To stop when exception is thrown– Use more generic or more specific exception type as needed
• Breakpoint Groups and Actions– To avoid stopping at uninteresting occurrences
• Watch Expressions– To easily inspect the value of attributes
![Page 76: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/76.jpg)
HOW TO DEBUG
"Wrong Data" Problems
![Page 77: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/77.jpg)
Overview of Application to Debug
tfParam_deptno => #{pageFlowScope.deptno}
VarDeptno =#{pageFlowScope.deptno}
<af:setActionListener from="#{bindings.Deptno.inputValue}" to="#{requestScope.deptno}"
tfParam_deptno =#{requestScope.deptno}
![Page 78: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/78.jpg)
Symptom: Choose Department "ACCOUNTING" (10)But See Employees for All Departments
![Page 79: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/79.jpg)
Set a Breakpoint in ViewObjectImplbindParametersForCollection() Method & Debug
![Page 80: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/80.jpg)
Breakpoint Hit: View Object Query is Executing,But Which One?
![Page 81: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/81.jpg)
This Query Execution is for VO InstanceNamed "DepartmentList" (for Dropdown List)
![Page 82: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/82.jpg)
Edit the Breakpoint to Make it Break Only For the"EmpView1" View Object We're Interested In
![Page 83: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/83.jpg)
Edit Breakpoint, Add Conditional Expression toStop Only For "EmpView1" VO Instance
![Page 84: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/84.jpg)
Choose a Department, Click Button toCall the Task Flow
![Page 85: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/85.jpg)
Bind Variable VarDeptno has null value Next, Need to Figure Out Why
![Page 86: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/86.jpg)
Toggle Breakpoint on TaskFlow Call Activityand Repeat the Test
![Page 87: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/87.jpg)
At Breakpoint, Use ADF Structure to Inspect the Request Scope: deptno Attribute Set Correctly
![Page 88: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/88.jpg)
Drilldown to Task Flow, Toggle Breakpoint onDefault MethodCall Activitity, then Continue
![Page 89: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/89.jpg)
At the Breakpoint, Use ADF Structure to Inspectthe Task Flow: pageFlowScope.deptno Set OK
![Page 90: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/90.jpg)
Navigate to the Method Call Activity's Page Def
![Page 91: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/91.jpg)
Toggle Breakpoint on ExecuteWithParams Action,Then Continue Execution
![Page 92: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/92.jpg)
At the Breakpoint, Explore the Value of MethodAction's Arguments: VarDeptno is null Incorrectly!
![Page 93: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/93.jpg)
Explore Action Binding Runtime Metadatain ADF Data Window to See EL Expression Used
![Page 94: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/94.jpg)
View the Whole EL Expression Value,Copy it to Clipboard
![Page 95: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/95.jpg)
Use EL Evaluator to Test Pasted ExpressionIt Evaluates to null. Notice Typo deplno
![Page 96: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/96.jpg)
Fix Typo, Test Expression, Copy to Clipboard
![Page 97: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/97.jpg)
Edit Action Binding, Paste in Correct ExpressionRerun Application to Verify the Fix
![Page 98: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/98.jpg)
Now, EmpView1's VarDeptno Bind VariableGets Correctly Set to the Selected Department Id
![Page 99: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/99.jpg)
Summary of Techniques Used in the Example
• Breakpoint in bindParametersForCollection()– To break whenever a View Object's query executes
• Conditional breakpoint expressions– To break only for the EmpView1 VO instance
• Breakpoints on Task Flow Activities– To break on task flow call and method call (among others)
• ADF Structure and ADF Data Windows– To Inspect ADF context, scopes, task flow artifacts
• Breakpoint on Action Bindings in Page Definition– To break just before action occurs
• EL Evaluator Window– To test EL expressions in correct runtime context
![Page 100: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/100.jpg)
HOW TO DEBUG
"No Data" Problems
![Page 101: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/101.jpg)
Symptom: No Data Appears
![Page 102: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/102.jpg)
At bindParametersForCollection() Breakpoint, Add Watches for getQuery() and params
![Page 103: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/103.jpg)
Use View Whole Value... to Copy/Paste QueryInto SQL Worksheet, Then Format SQL
Format SQL
![Page 104: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/104.jpg)
Execute SQL Using Same Bind Variable ValuesAs in the Watches Window. Data OK
![Page 105: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/105.jpg)
ViewObject FlowChart for "No Data" Problems
Fetched Row null?Fetched
Row null?
bindParametersForCollection()
bindParametersForCollection()
createRowFromResultSet()createRowFromResultSet()
Rows Returned
?
Rows Returned
?
No Results from DBNo Results from DBNo Results from DBNo Results from DB
Discriminator MismatchDiscriminator MismatchDiscriminator MismatchDiscriminator Mismatch
rowQualifies()rowQualifies()Qualifies
for RowSet?
Qualifies for
RowSet?
Failed to QualifyFailed to QualifyFailed to QualifyFailed to Qualify
No
No
Yes
Yes
No
Row Added to RowSetRow Added to RowSet
Yes
while (hasNext())
![Page 106: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/106.jpg)
createRowFromResultSet() Shows Null RowPoints to Discriminator Mismatch Problem
![Page 107: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/107.jpg)
Query Retrieves JOB Column Values DifferentFrom the Defined Discriminator Values!
![Page 108: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/108.jpg)
Changing the Applied View Criteria to Limit Resultsto Only Include Clerks and Salesmen Fixes Problem
![Page 109: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/109.jpg)
Summary of Techniques Used in the Example
• Breakpoint in bindParametersForCollection()– To examine query statement and bind variable values
• SQL Worksheet– To test query against same database as the application
• Breakpoint in createRowFromResultSet()– To test whether database row is retrieved without error
![Page 110: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/110.jpg)
TIP
Show Address in Data and Watches Windows to Distinguish Instances
![Page 111: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/111.jpg)
Use Address in Data and Watches Window► Open Data or Watch Window Preferences
![Page 112: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/112.jpg)
Use Address in Data and Watches Window► Enable Address Column
![Page 113: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/113.jpg)
Use Address in Data and Watches Window► Jot Down Address of Objects at One Breakpoint
![Page 114: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/114.jpg)
Use Address in Data and Watches Window► Compare to Object Address at Other Breakpoint
![Page 115: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/115.jpg)
HOW TO DEBUG
"Slow Application" Problems
![Page 116: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/116.jpg)
Logging Executed Queries and Fetched Rows
![Page 117: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/117.jpg)
Logging Executed Queries and Fetched Rows
![Page 118: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/118.jpg)
TIP
Watches Can Evaluate Most Java Expressions
![Page 119: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/119.jpg)
Not Sure What Watch Expression to Use?Find Member in Data Window, Then Watch It
![Page 120: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/120.jpg)
• Navigate Members Regardless of Access Mode– mInner.mRows[0].mData.mStorage
• Call Functions– getViewObject().findAttributeDef("Dname").getUIHelper().getLabel(getViewObject().getApplicationModule().getSession().getLocaleContext())
Debugger Watch Expressions Can Do Many ThingsFor Example, At a Breakpoint in ViewRowImpl…
![Page 121: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/121.jpg)
Debugger Watch Expression Tricks (Cont'd)
• Call Methods That Produce Log Output– xmlNode.print(System.out)
![Page 122: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/122.jpg)
TIP
Customize Debugger Display of Any Object Type
![Page 123: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/123.jpg)
Customize Debugger Display of Any Object Type ► Select Object Preferences for a Given Entry
![Page 124: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/124.jpg)
Customize Debugger Display of Any Object Type ► Decide What Fields/Expressions To Show
![Page 125: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/125.jpg)
Customize Debugger Display of Any Object Type ► Four Changes Are Showing, But Others, Too
![Page 126: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/126.jpg)
Customize Debugger Display of Any Object Type► Customize Supertype Members, Too, If Needed
![Page 127: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/127.jpg)
Other Interesting Info in ADF Structure / ADF DataLifecycle Breakpoints and Page UI Component Tree
![Page 128: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/128.jpg)
Other Interesting Info in ADF Structure / ADF DataADF Context
![Page 129: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/129.jpg)
New ADF Debugger Improvements► Easily See Binding Values
![Page 130: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/130.jpg)
Future ADF Debugger Improvements► Easily Explore ViewRows and Entity Objects
![Page 131: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/131.jpg)
When Debugging Does Not Succeed…Create a Great Test Case for Worldwide Support
• Small investment of your time pays dividends– Simple testcase → faster diagnosis, workaround, fix
• Base the testcase on EMP or HR schema– Eliminates any database setup complications
• Otherwise, provide minimal SQL script– Insert only enough sample data to reproduce problem
• Create a command-line test client– Reduces reproduce instructions to: "Run Test.java"
• Otherwise, give the minimum steps to reproduce– Some issues only occur in context of multi-step, web scenario
![Page 132: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/132.jpg)
AppendixUseful ADFM/ADFBC Methods for Debugging
Object Method DescriptionViewObjectImpl bindParametersForCollecti
onInspect SQL and bind variables just before executing query
createRowFromResultSet Study each row as its fetched from the databaseViewRowImpl populate Observe row after being populated with fetched
datasetAttributeInternal Examine attribute value being setsetAttributeValues Examine multiple attribute values being set
(typically by LOV mechanism)ApplicationPoolImpl
doCheckout Watch AM as its checked out of the pool
doManagedCheckin See AM as its checked into pool in managed modedoUnmanagedCheckin See AM as its checked into pool in stateless mode
EntityImpl setAttributeInternal Examine attribute value being setExprEval doEvaluate Analyze each Groovy expression being evaluatedJUCtrlActionBinding
doIt Follow any (method) action binding invocation
![Page 133: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/133.jpg)
QUESTIONS?
![Page 134: How to Debug Oracle Application Development Framework Applications S316887](https://reader038.vdocuments.us/reader038/viewer/2022102700/544e5e2ab1af9f156f8b4f27/html5/thumbnails/134.jpg)