This chapter includes the following sections:
Debugging Oracle Application Development Framework (Oracle ADF) is a process of collecting and isolating factors that contribute to problems that occur when the web page components interact with the ADF Model layer.
You can use diagnostics tools for collecting contextual information for isolating the problem. One of the most useful diagnostic tools is the ADF Logger. You use this logging mechanism in JDeveloper to capture runtime traces messages. With Oracle ADF logging enabled, JDeveloper displays the application trace in the Message Log window. The trace includes runtime messages that may help you to quickly identify the origin of an application error. Another useful diagnostic tool is SQL trace, which enables tracing of the current database session and logs all SQL statements to a server-side trace file.
Once you have gathered the diagnostic information, you can use the JDeveloper debugging tools to investigate where your application failure occurs. These include the JDeveloper Debugger, which is a comprehensive debugger to assess and repair your code, and the ADF Declarative Debugger for declaratively setting breakpoints on ADF task flow activities, page definition executables, method, action, and value bindings, and Oracle ADF lifecycle phases.
Oracle SOA Suite provides a complete set of service infrastructure components for designing, deploying, and managing composite applications. Test cases enable you to simulate the interaction between a SOA composite application and its web service partners before deployment in a production environment. This helps to ensure that a process interacts with web service partners as expected by the time it is ready for deployment to a production environment.
Collecting diagnostics information helps you to obtain more contextual information for isolating the problem.
In the Integrated WebLogic Server environment, you can maximize the availability of diagnostics information by:
Enabling diagnostic logging in the development environment
Enabling database tracing
You can also enable logging in the development environment by setting the Java system property named jbo.debugoutput
to the value console
.
Related Links
The following document provides more information about the topic discussed in this section:
For more information, see the "How to Turn On Diagnostic Logging for Non-Oracle ADF Loggers" section in Developing Fusion Web Applications with Oracle Application Development Framework.
Database tracing can be a very useful way of verifying whether the queries executed by ADF Business Components are actually returning any data. The ADF Business Components tracing output (-Djbo.debugoutput=console
) lists the query and the bind variable, but it is not always clear how many rows are fetched or how the fetching takes place, that is, in batches or one row at a time. If you are investigating a suspected bug or performance issue in ADF Business Components, it is always good to have the database trace to help understand the problem.
Database tracing is usually used for performance tuning. You should know how to generate a SQL trace, find the query you are interested in, check the bind variables, and tell how many rows were returned. It is usually the quickest way of telling whether missing data in your application is a middle tier application bug, or missing data in the database. It is also useful when you are investigating ORA errors being returned from the database.
You should consider the following with database tracing:
When you test using Integrated WebLogic Server with Oracle WebLogic Server data sources, the database connection is obtained from fusion_apps_wls.properties
and not from connections.xml
. However, when you use the application module tester to run an application module, the connection details from connections.xml
are used, even when you set your application module configuration to use an Oracle WebLogic Server data source. Since the application module tester does not use Oracle WebLogic Server, it builds a database connection from the information in connections.xml
.
If you change the database details in fusion_apps_wls.properties
, the updates are not picked up until the Oracle WebLogic Server domain is re-created. Shutting down the Integrated WebLogic Server instance is not enough. The domain for the Integrated WebLogic Server is automatically created when you launch the Integrated WebLogic Server instance for the first time in a new Oracle Fusion Applications ADE view, or re-created the next time you run the Integrated WebLogic Server instance after deleting the domain directory. If in doubt, you can view the ApplicationDBDS JDBC data source in the Oracle WebLogic Server Administration Console to see what database it is pointing to. You can change the database in the Oracle WebLogic Server Administration Console to point to the new database, but the next time the domain is re-created it will be set to the connection defined in fusion_apps_wls.properties
.
When you try to examine data from a SQL*Plus session for views based on translated data, check that select userenv('lang') from dual;
returns US
. If it does not, change the language with:
alter session set nls_language='American';
If you do not do this, some of the translated view will not return any data. For example, if you are based in the United Kingdom, select userenv('lang')
may return GB
by default, which does not match any of the data in the TL tables. This is particularly important in the development environment where only the US messages are available.
There may be other security restrictions that prevent you from viewing certain data from a SQL*Plus session, such as data that is protected by virtual private database (VPD) or data that requires you to initialize your userenv
.
You may receive ORA-600 errors, which typically manifest themselves as ORA-3114 or ORA-3113 on the client and indicate that the database session has terminated abnormally. In this case, a trace file is always created automatically, and the database alert log is updated with a record of the failure and the name of the trace file. You do not need to enable SQL trace in this case because the trace file is always created and should include a full dump, which will help database Support and Development diagnose the cause. Both the alert log and the trace file will be in the database User Directory.
You can also enable Oracle ADF tracing. For information, see the "Use SQL Tracing to Identify Ill-Performing Queries" section in Developing Fusion Web Applications with Oracle Application Development Framework.
In the standalone WebLogic Server environment, you can maximize the availability of diagnostics information by:
Enabling diagnostic logging
Adding debug messages to your code
Enabling database tracing
Use logging profile options to enable diagnostic logging in the provisioned environment so you can view your log statements in the directory configured against your apps-handler.
${domain.home}/servers/${weblogic.Name}/logs/apps/${weblogic.Name}-diagnostic-log
To enable diagnostic logging in the provisioned environment:
To help you investigate problems in the standalone WebLogic Server instance, you can add debug messages to your code so that messages, such as System.out.println()
, which are normally displayed on the Java console, are written to the server log file (AdminServer.log
) in the default domain.
Since the log file may get rather large, particularly if more than one user is using the environment, you may want to prefix your messages with an identifier that you can easily find through a search.
Log in to the Environment Management System (EMS) WebLogic Server host using the Applmgr username and password. The default password is the username in uppercase letters, but your family environment owner may have changed it, so check with them if necessary. The server log should be in the Applmgr home directory. To locate other log files, use the find . -name "*.log"
command.
Enabling database tracing allows the standalone WebLogic Server instance to write all your actions to an associated trace file. When an internal error is detected by a process, it dumps information about the error to its corresponding trace file.
Enable database tracing before you start your test flow.
To enable database tracing:
The trace file can be found in the USER_DUMP_DEST
directory specified by the user_dump_dest init.ora
parameter, which is usually ORACLE_HOME
/log/diag/rdbms/
sid
/
sid
/trace
. The trace filename includes the FND session ID appended to the end, for example, mysid_ora_4473_881497BF7770BEEEE040E40A0D807BB1.trc
. You must identify the session ID to locate your trace file.
Note:
From SQL*Plus, you can execute SQL> show parameter user
to show user_dump_dest
. An operation system login is required to access this directory.
To identify the session ID in Mozilla Firefox:
In addition to reviewing the diagnostics information, you can perform various tasks to diagnose problems in your server environment.
Perform the following tasks to diagnose problems in the Integrated WebLogic Server environment:
While you are diagnosing problems in the Integrated WebLogic Server environment, you may want to verify that the JDBC data source connections are pointing to the correct database connection string.
To test the connections:
weblogic
and weblogic1
.When running on Integrated WebLogic Server, you can view the application module pooling statistics to verify that the domain is properly configured for Oracle ADF.
To view the application module pooling statistics:
http://localhost:7101/dms/Spy
.ampool
metric.Sanity checking your EAR file helps to diagnose problems in the Integrated WebLogic Server environment. Download the EAR file and open it using a decompression utility. You can then drill down into the WAR file and individual Oracle ADF libraries.
While sanity checking your EAR file, verify the following:
The UI libraries are in the WEB-INF/lib
directory of the WAR file.
The Model libraries are in the APP-INF/lib
directory of the EAR file.
The service middle tier JAR and the service WAR files are directly under the EAR file.
The service common JAR file is directly under the EAR file or under the APP-INF/lib
directory, depending on how it was set up.
The individual Oracle ADF libraries only contain components from the project that was deployed to create the Oracle ADF library, and do not contain any components from referenced projects. (This could happen if you have "build output" dependencies.) If components from other projects were included, it should be obvious from the package, since every project has a unique default package.
All standalone components (that is, those not in an Oracle ADF library) in the WAR file belong to the UI project that was deployed (such as SuperWeb for Oracle Fusion Applications). There should therefore be no standalone model components in the WAR file.
None of the Model and Service Oracle ADF libraries have a public_html
directory.
No technology JAR files are included in the EAR and WAR files. Tech stack JAR files added to the WAR or EAR file take precedence over the ones in the shared libraries, but the shared libraries contain the correct versions. The technology JAR files in your EAR or WAR file may not be the correct versions.
Perform the following tasks to diagnose problems in the standalone WebLogic Server environment:
Sanity check your enterprise archive (EAR) file
Examine the Oracle WebLogic Server classloaders
The procedure for sanity checking your EAR file in the standalone WebLogic Server environment is the same as the procedure for Integrated WebLogic Server. For information, see Sanity Checking Your EAR File in the Integrated WebLogic Server Environment.
Using a tool called CATX (Classloader Analysis Tool), you can diagnose problems in the standalone WebLogic Server environment by examining the JAR files and loaded classes when your application is running from Oracle WebLogic Server.
CATX is a web application that is deployed by default to every Oracle Fusion Applications Oracle WebLogic Server domain. To launch CATX, run http://
host
:
port
/catx/
.
With CATX, you can identify a duplicate class by determining from which JAR file a class file was loaded. You can also identify any other locations where the class is duplicated in the J2EE application classpath or web application classpath.
As an alternative to CATX, you can add the following code to your custom classes to display in the console the JAR file from which the class was loaded:
File moduleFile = new File
(YOURCLASSHERE.class.getProtectionDomain().getCodeSource().getLocation().
toURI());
System.out.println("Jar file name = "+moduleFile.fullPath());
This method may be useful if you are actively debugging code from JDeveloper or using the AM Tester.
The following debugging tools are available for debugging in JDeveloper:
JDeveloper Debugger.
For information, see the JDeveloper online help.
ADF Declarative Debugger.
Related Links
The following document provides more information about the topic discussed in this section:
For information, see the "Using the ADF Declarative Debugger" section in Developing Fusion Web Applications with Oracle Application Development Framework.
Use JDeveloper to perform remote debugging for your application.
Oracle WebLogic Server logs and Fusion Middleware ODL (Oracle Diagnostic Logging) logs are located in the following directory:
JDEV_USER_HOME/system11.1.1.1.32.52.37/DefaultDomain/servers/DefaultServer/logs/
To perform remote debugging of your application:
setenv debugFlag true
Start Oracle WebLogic Server.
Using JDeveloper, go to Application Navigator and select your ViewController project.
Select Run, Choose Active Run Configuration, Manage Run Configurations.
Select New and enter a name for the new profile. For example, Remote Debug.
Click OK.
Edit the new Remote Debug profile by entering the following information:
Add a default Run Target. For example:
JDEV_system_dir/SvcValidation/Supplier/src/oracle/apps/sv/supplier/supplierService/applicationModule/server/SupplierServiceImpl.java
Select the remote Debugging and Profiling option.
Go to Debugger, Remote. Enter the following information:
Protocol: Attach to (Java Platform Debugger Architecture (JPDA))
Host: Enter the host where Oracle WebLogic Server is running.
Port: Enter the Java Debugger Wire Protocol (JDWP) port number.
The Java Virtual Machine (JVM) is listening for JDPA requests. The default port is 8453. Use the setenv DEBUG_PORT
new port number
command to change the port number.
Note:
Alternatively, you can create a profile by selecting your ViewController project, right-click and select Project Properties, Run/Debug/Profile.
On the toolbar, click the Bug icon. Select the new Remote Debug profile. A dialog appears to confirm attaching to the Administration Server.
The debugging log file will contain an entry similar to the following:
Debugger attempting to connect to remote process at ab6052cdef.us.example.com 8453.Debugger connected to remote process at ab6052cdef.us.example.com 8453.Processing 10008 classes that have already been prepared...Finished processing prepared classes.Debugger process virtual machine is Java HotSpot(TM) Server VM.
Set your break points and initiate your program. When you have finished, click the red Stop button, and a dialog will appear asking if you want to Detach, Terminate, or Cancel. Detach detaches from the remote Oracle WebLogic Server, and Terminate terminates the remote Oracle WebLogic Server.
Tip:
Only one developer can debug at a given time on a specific port.
This section describes common problems that you might encounter when using Oracle ADF with Oracle Fusion Applications and explains how to solve them.
The following are common problems you may encounter and solutions that solve them:
You receive an error that indicates that too many files are open.
Problem
The open file limit on local Linux servers has been exceeded.
Solution
Increase the open file limit.
For information, see Increasing Open File Limit on Linux Machines.
You encounter a compilation error.
Problem
A reference to an Oracle ADF business component or Java class in an Oracle ADF library cannot be resolved, such that it does not exist or is incompatible with the existing reference.
Solution
All references to components contained in Oracle ADF libraries are resolved when the workspace is loaded in JDeveloper. Refresh the library in one of the following ways:
Close the workspace and re-open it to refresh the references to the Oracle ADF libraries. (Closing and restarting JDeveloper with a workspace open does not refresh the references to the Oracle ADF libraries.)
If you have a specific project selected in the JDeveloper navigator pane, select View, then Refresh ADF Library Dependencies for ….jpr to refresh the references to the Oracle ADF libraries.
Note:
When you make any changes to the components in a project, where the components are being referenced as an Oracle ADF library by your user interface (UI) project, you must redeploy the Oracle ADF library and refresh the Oracle ADF library dependencies for your UI project. The same applies to one model project referencing from another model project. If you are developing or debugging code in a model project while running the referencing UI project to test it, it may be easier to add the model project as a build output dependency, so you do not need to go through the cycle of redeploying the Oracle ADF library or refreshing the Oracle ADF library references each time you make a change.
Either a No Def Found
or No Class Def Found
runtime exception occurs.
Problem
Lower level dependency changes were made outside of the design time session.
Solution
Refresh the library in one of the following ways:
Close the workspace and re-open it to refresh the references to the Oracle ADF libraries. (Closing and restarting JDeveloper with a workspace open does not refresh the references to the Oracle ADF libraries.)
If you have a specific project selected in the JDeveloper navigator pane, select View, then Refresh ADF Library Dependencies for ….jpr to refresh the references to the Oracle ADF libraries.
Note:
When you make any changes to the components in a project, where the components are being referenced as an Oracle ADF library by your user interface (UI) project, you must redeploy the Oracle ADF library and refresh the Oracle ADF library dependencies for your UI project. The same applies to one model project referencing from another model project. If you are developing or debugging code in a model project while running the referencing UI project to test it, it may be easier to add the model project as a build output dependency, so you do not need to go through the cycle of redeploying the Oracle ADF library or refreshing the Oracle ADF library references each time you make a change.
Execution stops before or after the line with the breakpoint, depending on whether you have added or removed lines of code from the source.
Problem
If you consume the components from another project in the same workspace and run in debug mode, you can open the source Java classes from the referenced project in the JDeveloper edit window and set breakpoints. However, if you consume the components at runtime through an Oracle ADF library, the compiled objects from the Oracle ADF library may not be synchronized with the source if you made changes since you last deployed the Oracle ADF library. If you are using a build output dependency, then you are not affected by this issue.
Solution
Redeploy the Oracle ADF library to synchronize the source code.
The Applications Core wizards display an empty list of data controls after you make changes to an application model and add additional view object instances or additional view criteria to the view objects.
Problem
The Data Controls panel in JDeveloper was not opened in a new view or refreshed following changes made to the data bound Applications Core component.
Solution
If using the Applications Core wizards to create an applications panel, applications table, or other data bound Applications Core component, you must open the Data Controls panel in JDeveloper at least once in a new view, or at least once after deleting the system directory, before launching the Applications Core wizards. If necessary you should refresh from the Data Controls panel before launching the Applications Core component wizards.
A runtime error occurs while the runtime model is being located using the information in the DataBindings.cpx
file.
Problem
You have more than one UI project (for example, task flows referenced from an Oracle ADF library) when the DataBindings.cpx
files are merged at runtime.
Solution
Make sure that each instance of DataBindings.cpx
resides in its own package.
An Application module not found
error occurs.
Problem
The DataBindings.cpx
file was moved because the default package was set incorrectly.
Solution
Make sure that the package defined in the Application
tag of DataBindings.cpx
matches the current package location.
You get unexpected behavior, blank components, or unexpected exceptions when you hot reload in either of the following ways:
In the Message Log window, select the Running Integrated WebLogic Server tab and click the URL that launched your page in Integrated WebLogic Server.
Remove the Oracle ADF state related information from the URL displayed in the browser (for example, ?_adf.ctrl-state=ku8guslcz_4
) and reload the page.
Problem
Changes were made to the page binding definition file (PageDef
), the resource (XLF
) files, or the Oracle ADF libraries.
Solution
Generally if the change you make is contained within a page or page fragment of the current project, you do not need to redeploy your application. However, if changes are made to the page binding definition file (PageDef), the resource (XLF) files, or the Oracle ADF libraries then you must redeploy your application.
You discover a missing ADF component at runtime in Oracle WebLogic Server.
Problem
There is a second version of the ADF component erroneously included when the Oracle ADF libraries and WAR or EAR files were built.
Solution
Check the EAR file to make sure that the missing component is actually present in the expected location.
You receive odd errors related to an ADF component that suggests a recent change was not picked up.
Problem
A second copy of that component is incorrectly referenced in another Oracle ADF library via a build output reference.
Solution
Perform one of the following tasks to resolve the problem:
Refresh the library in one of the following ways:
Close the workspace and re-open it to refresh the references to the Oracle ADF libraries. (Closing and restarting JDeveloper with a workspace open does not refresh the references to the Oracle ADF libraries.)
If you have a specific project selected in the JDeveloper navigator pane, select View, then Refresh ADF Library Dependencies for ….jpr to refresh the references to the Oracle ADF libraries.
Note:
When you make any changes to the components in a project, where the components are being referenced as an Oracle ADF library by your user interface (UI) project, you must redeploy the Oracle ADF library and refresh the Oracle ADF library dependencies for your UI project. The same applies to one model project referencing from another model project. If you are developing or debugging code in a model project while running the referencing UI project to test it, it may be easier to add the model project as a build output dependency, so you do not need to go through the cycle of redeploying the Oracle ADF library or refreshing the Oracle ADF library references each time you make a change.
Force recompilation by right-clicking the JSP and selecting Build, then Clean All, then rebuild and redeploy.
The Oracle WebLogic Server instance may seem unresponsive.
Problem
The Oracle WebLogic Server Java process may be CPU intensive.
Solution
Use kill –3
pid
to write a Java thread dump to the administration console for Integrated WebLogic Server or to the server log file for standalone WebLogic Server.
kill –3
pid
is the same as kill –QUIT
pid
, which sends SIGQUIT
to the process.
The Java process implements a signal.
If you are using Jrockit Java, use this command to print threads:
jrcmd <pid> print_threads [nativestack=true]
The base class is missing when you test the Model project in the Oracle Business Component Browser.
Problem
The Model project is missing the Applications Core library.
Solution
Add the Applications Core library to the Model project.
The FND components are not available when you add components to your page or page fragment.
Problem
The Applications Core (ViewController) tag library is missing.
Solution
Add the Applications Core (ViewController) library to your project to automatically add the Applications Core (ViewController) tag library. You may need to close the Project Properties dialog, save the changes, and reopen the Project Properties dialog before you see all the dependent changes made when adding the Applications Core library.
You get JavaServer Pages (JSP) compilation errors or other JSP errors.
Problem
The page or page fragment is invalid. In the source editor, you can see that there are errors in the page, often because of malformed XML (for example, missing or mismatched XML tags) or some other error reported by the design time audits. This can occur if you cut and paste directly into the XML source. JDeveloper allows you to run the page even though it is invalid.
Solution
In the Preferences option of the Tools menu, you can set an audit to run during compilation. If there are failures, it will prevent the run. However, the audit only executes during compilation. The first time you try to run, it may need to compile and the audit kicks in and it fails, which causes the run to stop. The second time you try to run, everything that needs to compile may have already successfully compiled. In this case, there is no compilation, so there is no audit.
You get errors related to ApplicationDB when you are running the Integrated WebLogic Server.
Problem
The settings for ApplicationDB are not configured correctly.
Solution
Check the settings for the ApplicationDB in the Oracle WebLogic Server Administration Console.
You get the following Metadata Services (MDS) runtime exception:
oracle.mds.exception.MDSRuntimeException: MDS-02401: The operation ModifyAttribute on the showDetailItem node is not allowed. MDS-02404: The subelement RAshowdetail2 in the MDX document does not allow customization of /oracle/apps/fnd/applcore/patterns/uishell/RegionalArea.jsff#RAshowdetail2.
Problem
The CHANGE_PERSISTENCE
parameter value is incorrect.
Solution
Locate the following context parameter in web.xml
:
<context-param> <description> This parameter turns on the session change persistence. </description> <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name> <param-value>oracle.adf.view.rich.change.MDSDocumentChangeManager</param-value> </context-param>
Change the value of CHANGE_PERSISTENCE
to oracle.adf.view.page.editor.change.ComposerChangeManager
.
Your application is unable to fetch data from the Oracle Fusion Applications database.
Problem
The fusion_apps_wls.properties
file does not contain the correct connection strings for the application's data source.
Solution
Run the Configure Fusion Domain Wizard to create or update the fusion_apps_wls.properties
file with the correct connection information. For instructions on using the wizard, see Chapter 2, "Setting Up Your Development Environment."
You get the following message:
Deployer: 149140 The task cannot be processed further until the current edit session is activated.
Problem
You modified the configuration of the server and did not activate the changes.
Solution
Go to the Administration Console (http://localhost:7101/console). Check the upper left hand corner regarding messages about changes not being activated.
You get the following exception:
weblogic.transaction.internal.TimedOutException
Service logic is taking longer than the default 300 seconds defined for Java Transaction API (JTA). Services may have heavy validation which will take more time to create row.
Solution
Set the JTA timeout condition to more than 300.
http://localhost:7101/console
).300
.For more information about testing and troubleshooting SOA composite applications, see the "Testing and Troubleshooting" section in Developing SOA Applications with Oracle SOA Suite.
You can also automate the SOA composite applications testing. For information, see the "Automating Testing of SOA Composite Applications" section in Developing SOA Applications with Oracle SOA Suite.