Wednesday, June 3, 2009

Turn on Diagnostic to Debug Oracle ADF BC Applications

When you encounter problems running an ADF BC application, one of the first things you can try is to turn on diagnostic to see if the diagnostic output offer further information on the problem.

jbo.debugoutput

To turn on diagnostics, set the Java system parameter jbo.debugoutput to the value console or file depending on whether you want to see the diagnostics on standard output or whether you want them redirected to a file in your output directory. To turn off diagnostics, you can set the system parameter to silent.

If you're invoking your application (middle-tier application) from command line, include -Djbo.debugoutput=console as in:
java.exe -Djbo.debugoutput=console ...

If you're running your application from within JDeveloper:
  1. Select the project (e.g., "Model").
  2. Do right mouse click and select "Project Properties"
  3. On the property dialog, select "Run/Debug/Profile".
  4. Edit your Run Configuration (e.g., "Default")
  5. On the right pane, you should see "Java Options" input text field. Add the following Java system parameter: -Djbo.debugoutput=console

What to Expect?


When you run again, you'll see an abundant amount of diagnostic tracing printed out that will help narrow down the problem. If you run the application from JDeveloper, you should see the following line in the Log view:
Diagnostics: (BC4J Bootstrap) Routing diagnostics to standard output (use ...)

If not, you need to stop the Server Instance and restart it. The typical diagnostic output looks like below:
[00] Diagnostic Properties: Timing:false Functions:false Linecount:true Threshold:6
    
Diagnostics: (BC4J Bootstrap) Routing diagnostics to standard output (use -Djbo.debugoutput=silent to remove)
[00] Diagnostic Properties: Timing:false Functions:false Linecount:true Threshold:6
[01] JavaVMVersion: 11.0-b16
[02] JavaVMVendor: Sun Microsystems Inc.
[03] JavaVMName: Java HotSpot(TM) Client VM
[04] OperatingSystemName: Linux
[05] OperatingSystemVersion: 2.6.18-53.1.4.el5PAE
[06] OperatingSystemUsername: sguan
[07] jbo.323.compatible Flag: false, str: null
[08] jbo.903.compatible Flag: false, str: null
[09] oracle.adfm.usemds Flag: true, str: null
[10] MDS parser created
...
[297] Loading from individual XML files
[298] Loading the Containees for the Package 'oracle.apps.model.Model'.
[299] Connected to Oracle JBO Server - Version: 11.1.1.53.68
[300] No XML file /oracle/apps/model/model.xml for metaobject oracle.apps.model.model
[301] MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/oracle/apps/model/model.xml"
[302] Cannot Load parent Package : oracle.apps.model.model
[303] Business Object Browsing may be unavailable
[304] Loading Typemap entries from oracle.apps.fnd.applcore.oaext.typemap.OATypeMapEntries
[305] Stringmanager using default locale: 'en_US'
[306] CSMessageBundle (language base) being initialized

References

  1. How to Get More Details Error Information

  2. BC4J Helper by Sung Im