SlideShare a Scribd company logo
1 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
2 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Real World ADF Design & Architecture Principles
Error Handling
ORACLE
PRODUCT
LOGO
15th Feb 2013 v1.0
3 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Learning Objectives
โ€ขโ€ฏ At the end of this module you should be able to:
โ€“โ€ฏ Understand the ADF error handling architecture
โ€“โ€ฏ Know the scope of an error handler
โ€“โ€ฏ Distinguish between error handling and incident reporting
Image: imagerymajestic/ FreeDigitalPhotos.net
4 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
5 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Fiction โ€ฆ
Wouldn't it be good if there was a single
location to handle all application errors
and exceptions?
6 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
โ€ฆ and Fact.
Not perfect, but a solution.
7 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
8 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Error Handling Hooks - Overview
ADF Faces (ADFv)
EJB/JPAADF Business Components Java
ADF Model (ADFm)
JAX-WS
Unhandled exceptions
Servlet Container
Unhandledexceptions
Render
Response
Propagates exceptions
ADF Controller (ADFc)
Business Service Layer
ADF Binding Layer
Data Control
9 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Exception Handlers
โ€ขโ€ฏ ADFm Exception Handler
โ€“โ€ฏ Error Handler (DCErrorHandler) in BindingContext
โ€ขโ€ฏ ADFc Exception Handler
โ€“โ€ฏ Exception Handler activity in Task-Flow
โ€“โ€ฏ Application wide Exception Handler
โ€ขโ€ฏ ADFv Exception Handler
โ€“โ€ฏ oracle.adf.view.rich.context.ExceptionHandler
โ€ขโ€ฏ Container, error-page in web.xml
10 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Error Handling Overview
ADF Interaction in JSF Request Lifecycle
EJB/JPAADF Business Components Java
ADF Binding
JAX-WS
Restore View
Apply Request
Process ValidationUpdate Model
Invoke Action
Render Response
1
2
3
4
5
6
JSF
11 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
12 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
oracle.jbo.JboException
โ€ขโ€ฏ JboException extends java.lang.RuntimeException
โ€“โ€ฏ Thus Business Component method can throw exceptions without
a throws clause in the method signature
โ€ขโ€ฏ Translation of error messages occur by the client calling
getLocalizedMessage() and not when an error is thrown
One Exception Super Class for All Exceptions
13 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Bundled Exception Mode
โ€ขโ€ฏ Enabled by default
โ€ขโ€ฏ Presents maximal set of failed validation exceptions
โ€ขโ€ฏ Java supports single exception to be thrown at a time
โ€ขโ€ฏ ADF BC moves all exceptions under a parent exception
โ€“โ€ฏ Multiple entity attribute validation errors (ValidationException) are
wrapped in RowValException parent exception
โ€“โ€ฏ Multiple rows that fail validation performed during commit will have the
RowValException wrapped in TxnValException object
โ€“โ€ฏ You can recursively introspect exception by calling getDetails() on each
exception
All Exceptions at Once
14 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.14 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Exceptions that are not handled in the business
service propagate to the ADF model layer.
Image: Ambro/ FreeDigitalPhotos.net
15 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
16 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Model Error Handler
โ€ขโ€ฏ The ADF model error handler deals with
โ€“โ€ฏ All ADF binding errors
โ€“โ€ฏ Business service errors that occur when accessing a service
trough the ADF binding layer
โ€ขโ€ฏ Formats and displays error message
โ€ขโ€ฏ Default error handler skips the top-level JboException because it
only is a bundled exception wrapper for other business exceptions
17 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Creating A Custom Error Handler
โ€ขโ€ฏ Extend oracle.adf.model.binding.DCErrorHandlerImpl and configure
your custom error error handler in DataBindings.cpx
โ€ขโ€ฏ Override the following methods as needed
โ€“โ€ฏ reportException
โ€ขโ€ฏ Override this method to analyze exceptions for errors you want to handle
โ€“โ€ฏ getDisplayMessage
โ€ขโ€ฏ Override to change or suppress (null value) the displayed message
โ€“โ€ฏ getDetailedDisplayMessage
โ€ขโ€ฏ Override this method to provide HTML markup formatted detail information
โ€“โ€ฏ skipException(Exception ex)
โ€ขโ€ฏ Called by the framework to check if an exception should be ignored
18 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Oracle JDeveloper 11g R2
19 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Custom Error Handler Example
Skip Exception for SQL Exceptions
public class CustomErrorHandler extends DCErrorHandlerImpl
{
...
protected boolean skipException(Exception ex) {
if (ex instanceof DMLConstraintException) {
return false;
//don't show details of SQL exception
} else if (ex instanceof SQLException) {
return true;
} else {
return super.skipException(ex);
}
}
)
20 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Skip Exception Example
SQLIntegrityConstraintViolationException
skipException == false skipException == true
21 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.21 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
The code is from a managed bean in our
application. What happens in case of an
exception?
Image: imagerymajestic/ FreeDigitalPhotos.net
OperationBinding operationBinding = null;
operationBinding =
getOperationBinding("UpdateOrder");
operationBinding.execute();
โ€ฆ
22 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
On a Related Note
โ€ขโ€ฏ It happens quite often that developers execute a client method
directly on the Application Module
โ€“โ€ฏ BindingContext > findDataControl("...") > getDataProvider()
โ€“โ€ฏ Cast data provider to Application Module interface
โ€“โ€ฏ Execute client methods on it
โ€ขโ€ฏ The risk is that
โ€“โ€ฏ Exceptions thrown by the client interface logic are not handled by the
ADFm error handler if invoked directly
โ€“โ€ฏ Inconsistent error handling may occur
23 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
24 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.24 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
The ADF controller handles exceptions
that occur during task flow execution
Image: Ambro/ FreeDigitalPhotos.net
25 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Controller Exception Handling
โ€ขโ€ฏ Exceptions that may occur during task flow execution include
โ€“โ€ฏ Method call activity that throws an exception
โ€“โ€ฏ Task flow initialize or finalize methods throwing an exception
โ€“โ€ฏ Authorization failures when accessing an activity
โ€ขโ€ฏ Controller exceptions are handled by a task flow activity that is
designated as an exception handler
โ€ขโ€ฏ When a task flow throws an exception, control flow is passed to the
designated exception handling activity
Introduction
26 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Exception Handler Activity
How-to Define an Activity as the Exception Handler
27 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Example: Method Error Handler
public void showErrorDialog() {
ControllerContext context = ControllerContext.getInstance();
ViewPortContext currentViewPort = context.getCurrentViewPort();
if (currentViewPort.isExceptionPresent()) {
FacesMessage fm = new FacesMessage(
FacesMessage.SEVERITY_WARN,
"Application Error",
currentViewPort.getExceptionData().getMessage());
FacesContext fctx = FacesContext.getCurrentInstance();
fctx.addMessage("ApplicationInfo", fm);
fctx.renderResponse();
}
}
28 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Controller
โ€ขโ€ฏ Exceptions that occur in context of
task flow are forwarded to exception
handler activity
โ€ขโ€ฏ Best Practices - Define exception
handling activity in each bounded
and unbounded task flows
โ€ขโ€ฏ Define exception handler in task flow
template for consistency
Exception Handler Activity
29 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Controller
โ€ขโ€ฏ AdfcExceptionHandler is the ADF controller internal framework
class that passes control to the task flow's designated exception
handler activity
โ€ขโ€ฏ If no exception handler activity exists, the control is passed the
browser
โ€ขโ€ฏ Default exception handler does not handle exceptions thrown during
RENDER_RESPONSE phase
Default Exception Handling
30 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Customizing the Framework Error Handling
โ€ขโ€ฏ Configuration
โ€“โ€ฏ Create oracle.adf.view.rich.context.ExceptionHandler
text file and store it in .adfMETA-INFservices
โ€“โ€ฏ you need to create the โ€œservicesโ€ folder
โ€“โ€ฏ Add the absolute name of your custom exception handler
โ€ขโ€ฏ Java class that extends ExceptionHandler
โ€ขโ€ฏ Configured for whole ADF application
โ€“โ€ฏ Deployed in EAR file
Add Your Own Exception Handler
31 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
import oracle.adf.view.rich.context.ExceptionHandler;
public class CustomExceptionHandler extends ExceptionHandler {
public CustomExceptionHandler() { super(); }
public void handleException(FacesContext facesContext, Throwable
throwable, PhaseId phaseId) throws Throwable{
if ( โ€ฆ Exception or Error to check โ€ฆ){
//handle issue
}
else {
//pass error to default exception handler
throw throwable;
}
}
}
ADF Controller
Overriding Default Exception Handler Class
32 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.32 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Be thoughtful. Don't override the
framework exception handler to
eagerly or for no reason. Keep in mind
that the error handler is not deployed
with bounded task flows but deployed
with the application.
Image: Ambro/ FreeDigitalPhotos.net
33 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Log Exceptions, Report Exceptions ..
โ€ขโ€ฏ Exception handler activities handle exceptions but don't
report them
โ€“โ€ฏ No programming error fixes itself
โ€“โ€ฏ Log and report programming or system errors
โ€ขโ€ฏ Implement a exception handling, logging and reporting
strategy that can be reused and that is declaratively applied
โ€ขโ€ฏ Report serious issues
โ€“โ€ฏ Considers weekends and vacations
โ€ขโ€ฏ Evaluate BPM (SOA Suite) Human Workflow integration
โ€“โ€ฏ In case of emergency, send mail or SMS
34 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
35 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
What Could Happen
Task Flow Exception Propagation
Memory Stack
Current Task Flow
Task Flow 4
Task Flow 3
Task Flow 2
Task Flow 1
Task Flow 2
Call
Task Flow 3
Call
Task Flow 4
Call
!
!
View1
View2
View3
View4
Task Flow 1
Task Flow 2
Task Flow 3
Task Flow 4
EH
EH
Method
Call
Current Task Flow
BANG!
36 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
What Could Happen
Task Flow Exception Propagation
Memory Stack
Current Task Flow
Task Flow 2
Task Flow 1
Task Flow 2
Call
Task Flow 3
Call
Task Flow 4
Call
Propagate
Exception
Propagate
Exception
!
!
View1
View2
View3
View4
Task Flow 1
Task Flow 2
Task Flow 3
Task Flow 4
EH
EH
Current Task Flow
Method
Call
BANG!
37 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
What Could Happen
Task Flow Exception Propagation
!
!
View1
View2
Task Flow 1
Task Flow 2
EH
EH
Memory Stack
Current Task Flow
Task Flow 2
Task Flow 1
Task Flow 2
Call
38 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Visual Example
Exception Handler in Caller Task Flow
BANG!
!
39 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Visual Example
Exception Handler in Top Level Task Flow
BANG!
!
40 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.40 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Every bounded task flow should have an
error handler activity defined. Task flow
templates help to configure error handlers
consistent throughout an application.
Image: Ambro/ FreeDigitalPhotos.net
41 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
42 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Unbounded Task Flow
โ€ขโ€ฏ There always is a single unbounded task flow instance available for
an application
โ€“โ€ฏ Independent of the number of adfc-config.xml files available in the
application class path
โ€ขโ€ฏ Unbounded task flows cannot be based on task flow templates
Exception Handling Strategy
43 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Unbounded Task Flow
โ€ขโ€ฏ To build "error handling templates" for unbounded task flows you use
an unbounded task flow definitions in an ADF Library
โ€“โ€ฏ Keep adfc-config.xml as the unbounded task flow definition file
โ€“โ€ฏ Deploy error handling logic as managed bean within ADF library
โ€“โ€ฏ Load order of unbounded configuration files determines which
exception handler become active in cases of multiple defined
handlers
โ€“โ€ฏ ADFc configuration files on the class path precede configurations
in the application
Exception Handling Strategy
44 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
45 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Exception Handling
โ€ขโ€ฏ Typically, view layer exceptions occur because of
โ€“โ€ฏ Failed execution of client logic in managed beans
โ€“โ€ฏ Failed access to the ADF binding layer
โ€ขโ€ฏEL references in page source
โ€ขโ€ฏJava references in managed beans
โ€“โ€ฏ Failed EL expressions
โ€ขโ€ฏTypos in the object name
โ€ขโ€ฏMissing objects (e.g. entity object references)
โ€ขโ€ฏFailed type casting (e.g. oracle.jbo.domain.Number to Long)
โ€“โ€ฏ Expired session
46 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Exception Raised In Managed Bean
Example: Simulating A Problem
47 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Exception Raised In Managed Bean
Solution: Routing Exception To Binding Layer
48 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
49 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Servlet Container
โ€ขโ€ฏ Handles all exceptions not handled by an application
โ€“โ€ฏ Available to all Java EE applications
โ€ขโ€ฏ Looks in web.xml file for directive on how to handle a specific error
code or the exception type
โ€ขโ€ฏ If nothing is set-up in web.xml, the exception terminates the user
application session
โ€“โ€ฏ In Java, a stack trace is displayed in the browser, which exactly
what you don't want to happen
50 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Java EE Exception Handling
Last Resort
<error-page>
<error-code>
โ€ฆ http error code here (e.g 404)โ€ฆ
</error-code>
<location>/unhandled_error_page.html</location>
</error-page>
<error-page>
<exception-type>
โ€ฆ exception class here โ€ฆ (e.g. java.lang.Throwable)
</exception-type>
<location>/unhandled_exception_page.html</location>
</error-page>
51 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Program Agenda
โ€ขโ€ฏ Error Handling Introduction
โ€ขโ€ฏ Handling ADF Lifecycle Errors
โ€ขโ€ฏ ADF Business Components
โ€ขโ€ฏ ADF Binding Layer
โ€ขโ€ฏ ADF Controller
โ€“โ€ฏ Bounded Task Flow
โ€“โ€ฏ Unbounded Task Flow
โ€ขโ€ฏ ADF View
โ€ขโ€ฏ Servlet Container
โ€ขโ€ฏ Summary
52 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
ADF Error Handling Summary
Error Handling by Architecture Layers
โ€ขโ€ฏtry-catch block
โ€ขโ€ฏADFm Error Handler
โ€ขโ€ฏException Handler Activity
โ€ขโ€ฏCustom ADFc Exception
Handler
โ€ขโ€ฏtry-catch block
โ€ขโ€ฏweb.xml
ADF Faces
EJB/JPAADF Business Components Java
ADF Model
JAX-WS
Unhandled exceptions
Servlet Container
Unhandledexceptions
Render
Response
Propagates exceptions
ADF Controller
53 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Conclusion
โ€ขโ€ฏ Anticipate problems and work on a mitigation
strategy
โ€“โ€ฏ Only leave unexpected errors and errors you
want for pass through unhandled for the handlers
โ€“โ€ฏ Like for application security, perform a risk
analysis and identify threats (database down, WS
not responsive, NPE โ€ฆ)
โ€ขโ€ฏ Define exception handling strategies and code them
into custom standard exception handler classes
โ€ขโ€ฏ Log errors by severity
54 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Conclusion
โ€ขโ€ฏ Access business service methods through the
binding layer
โ€ขโ€ฏ Use try/catch blocks in any managed bean method
โ€“โ€ฏ Route managed bean exceptions to the binding layer
reportError() method
โ€ขโ€ฏ Use custom task flow exception handler thoughful
โ€“โ€ฏ .adfMETA-INFservices
โ€“โ€ฏ Avoid new exceptions in your exception handler
โ€“โ€ฏ Keep in mind that this exception handler is on an
application level and not task flow / ADF library level
55 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Further Reading
โ€ขโ€ฏ Oracle Magazine Article "Catch Me If You Can"
โ€“โ€ฏ http://www.oracle.com/technetwork/issue-archive/2013/13-mar/
o23adf-1897193.html
โ€ขโ€ฏ Oracle JDeveloper and ADF Documentation Library
โ€“โ€ฏ Fusion Developer Guide
โ€ขโ€ฏ "Handling and Displaying Exceptions in an ADF Application"
โ€ขโ€ฏ "Customizing Business Components Error Messages"
โ€ขโ€ฏ How to log all errors to the database
โ€“โ€ฏ http://one-size-doesnt-fit-all.blogspot.de/2008/06/jdev-adf-how-to-log-all-
errors-to.html
56 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
Ad

More Related Content

What's hot (20)

Oracle ADF Architecture TV - Deployment - Build Options
Oracle ADF Architecture TV - Deployment - Build OptionsOracle ADF Architecture TV - Deployment - Build Options
Oracle ADF Architecture TV - Deployment - Build Options
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF BC Application Module Design
Oracle ADF Architecture TV - Design - ADF BC Application Module DesignOracle ADF Architecture TV - Design - ADF BC Application Module Design
Oracle ADF Architecture TV - Design - ADF BC Application Module Design
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Service Integration Architectures
Oracle ADF Architecture TV - Design - Service Integration ArchitecturesOracle ADF Architecture TV - Design - Service Integration Architectures
Oracle ADF Architecture TV - Design - Service Integration Architectures
Chris Muir
ย 
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Application Customization and MDS
Oracle ADF Architecture TV - Design - Application Customization and MDSOracle ADF Architecture TV - Design - Application Customization and MDS
Oracle ADF Architecture TV - Design - Application Customization and MDS
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF Reusable Artifacts
Oracle ADF Architecture TV - Design - ADF Reusable ArtifactsOracle ADF Architecture TV - Design - ADF Reusable Artifacts
Oracle ADF Architecture TV - Design - ADF Reusable Artifacts
Chris Muir
ย 
Oracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure DecisionsOracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
Oracle ADF Architecture TV - Design - ADF Architectural PatternsOracle ADF Architecture TV - Design - ADF Architectural Patterns
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
Chris Muir
ย 
Oracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - LoggingOracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - Logging
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Project Dependencies
Oracle ADF Architecture TV - Design - Project DependenciesOracle ADF Architecture TV - Design - Project Dependencies
Oracle ADF Architecture TV - Design - Project Dependencies
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Usability and Layout Design
Oracle ADF Architecture TV - Design - Usability and Layout DesignOracle ADF Architecture TV - Design - Usability and Layout Design
Oracle ADF Architecture TV - Design - Usability and Layout Design
Chris Muir
ย 
Oracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Oracle ADF Architecture TV - Development - Naming Conventions & Project LayoutsOracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Oracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope OptionsOracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Transaction Options
Oracle ADF Architecture TV - Design - Task Flow Transaction OptionsOracle ADF Architecture TV - Design - Task Flow Transaction Options
Oracle ADF Architecture TV - Design - Task Flow Transaction Options
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow OverviewOracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow Overview
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF Service Architectures
Oracle ADF Architecture TV - Design - ADF Service ArchitecturesOracle ADF Architecture TV - Design - ADF Service Architectures
Oracle ADF Architecture TV - Design - ADF Service Architectures
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for SecurityOracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for Security
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Designing for Internationalization
Oracle ADF Architecture TV - Design - Designing for InternationalizationOracle ADF Architecture TV - Design - Designing for Internationalization
Oracle ADF Architecture TV - Design - Designing for Internationalization
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Communication Pattern
Oracle ADF Architecture TV - Design - Task Flow Communication PatternOracle ADF Architecture TV - Design - Task Flow Communication Pattern
Oracle ADF Architecture TV - Design - Task Flow Communication Pattern
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow ConceptsOracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Chris Muir
ย 
Oracle ADF Architecture TV - Deployment - Build Options
Oracle ADF Architecture TV - Deployment - Build OptionsOracle ADF Architecture TV - Deployment - Build Options
Oracle ADF Architecture TV - Deployment - Build Options
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF BC Application Module Design
Oracle ADF Architecture TV - Design - ADF BC Application Module DesignOracle ADF Architecture TV - Design - ADF BC Application Module Design
Oracle ADF Architecture TV - Design - ADF BC Application Module Design
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Service Integration Architectures
Oracle ADF Architecture TV - Design - Service Integration ArchitecturesOracle ADF Architecture TV - Design - Service Integration Architectures
Oracle ADF Architecture TV - Design - Service Integration Architectures
Chris Muir
ย 
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Application Customization and MDS
Oracle ADF Architecture TV - Design - Application Customization and MDSOracle ADF Architecture TV - Design - Application Customization and MDS
Oracle ADF Architecture TV - Design - Application Customization and MDS
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF Reusable Artifacts
Oracle ADF Architecture TV - Design - ADF Reusable ArtifactsOracle ADF Architecture TV - Design - ADF Reusable Artifacts
Oracle ADF Architecture TV - Design - ADF Reusable Artifacts
Chris Muir
ย 
Oracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure DecisionsOracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
Oracle ADF Architecture TV - Design - ADF Architectural PatternsOracle ADF Architecture TV - Design - ADF Architectural Patterns
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
Chris Muir
ย 
Oracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - LoggingOracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - Logging
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Project Dependencies
Oracle ADF Architecture TV - Design - Project DependenciesOracle ADF Architecture TV - Design - Project Dependencies
Oracle ADF Architecture TV - Design - Project Dependencies
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Usability and Layout Design
Oracle ADF Architecture TV - Design - Usability and Layout DesignOracle ADF Architecture TV - Design - Usability and Layout Design
Oracle ADF Architecture TV - Design - Usability and Layout Design
Chris Muir
ย 
Oracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Oracle ADF Architecture TV - Development - Naming Conventions & Project LayoutsOracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Oracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope OptionsOracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Transaction Options
Oracle ADF Architecture TV - Design - Task Flow Transaction OptionsOracle ADF Architecture TV - Design - Task Flow Transaction Options
Oracle ADF Architecture TV - Design - Task Flow Transaction Options
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow OverviewOracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow Overview
Chris Muir
ย 
Oracle ADF Architecture TV - Design - ADF Service Architectures
Oracle ADF Architecture TV - Design - ADF Service ArchitecturesOracle ADF Architecture TV - Design - ADF Service Architectures
Oracle ADF Architecture TV - Design - ADF Service Architectures
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for SecurityOracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for Security
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Designing for Internationalization
Oracle ADF Architecture TV - Design - Designing for InternationalizationOracle ADF Architecture TV - Design - Designing for Internationalization
Oracle ADF Architecture TV - Design - Designing for Internationalization
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Task Flow Communication Pattern
Oracle ADF Architecture TV - Design - Task Flow Communication PatternOracle ADF Architecture TV - Design - Task Flow Communication Pattern
Oracle ADF Architecture TV - Design - Task Flow Communication Pattern
Chris Muir
ย 
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow ConceptsOracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Chris Muir
ย 

Viewers also liked (6)

Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with OracleMobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Chris Muir
ย 
Let's Talk Mobile
Let's Talk MobileLet's Talk Mobile
Let's Talk Mobile
Chris Muir
ย 
CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...
CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...
CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...
Chris Muir
ย 
Joulex & Junos Space SDK: Customer Success Story
Joulex & Junos Space SDK: Customer Success StoryJoulex & Junos Space SDK: Customer Success Story
Joulex & Junos Space SDK: Customer Success Story
Juniper Developer Resources Cooney
ย 
Future of Oracle Forms AUSOUG 2013
Future of Oracle Forms AUSOUG 2013Future of Oracle Forms AUSOUG 2013
Future of Oracle Forms AUSOUG 2013
Chris Muir
ย 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)
Lucas Jellema
ย 
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with OracleMobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Chris Muir
ย 
Let's Talk Mobile
Let's Talk MobileLet's Talk Mobile
Let's Talk Mobile
Chris Muir
ย 
CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...
CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...
CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experien...
Chris Muir
ย 
Future of Oracle Forms AUSOUG 2013
Future of Oracle Forms AUSOUG 2013Future of Oracle Forms AUSOUG 2013
Future of Oracle Forms AUSOUG 2013
Chris Muir
ย 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)
Lucas Jellema
ย 
Ad

Similar to Oracle ADF Architecture TV - Development - Error Handling (20)

Programming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionappsProgramming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionapps
Berry Clemens
ย 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
Edward Burns
ย 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java Platform
Sivakumar Thyagarajan
ย 
ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)
Logico
ย 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
Thomas Wuerthinger
ย 
Introduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise MonitorIntroduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise Monitor
Mark Leith
ย 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Betclic Everest Group Tech Team
ย 
Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...
Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...
Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...
Kamalesh Ramasamy
ย 
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Haytham Ghandour
ย 
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsUsing Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Luis Cruz
ย 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
Mayank Prasad
ย 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
Eric Wyles
ย 
Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824
Oracle
ย 
Lightning page optimization &amp; best practices
Lightning page optimization &amp; best practicesLightning page optimization &amp; best practices
Lightning page optimization &amp; best practices
Gaurav Jain
ย 
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
Fred Rowe
ย 
OSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaOSI_MySQL_Performance Schema
OSI_MySQL_Performance Schema
Mayank Prasad
ย 
Functional Programming With Lambdas and Streams in JDK8
 Functional Programming With Lambdas and Streams in JDK8 Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8
IndicThreads
ย 
Best Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXBBest Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXB
Martin Grebac
ย 
Con8780 nair rac_best_practices_final_without_12_2content
Con8780 nair rac_best_practices_final_without_12_2contentCon8780 nair rac_best_practices_final_without_12_2content
Con8780 nair rac_best_practices_final_without_12_2content
Anil Nair
ย 
Revised Adf security in a project centric environment
Revised Adf security in a project centric environmentRevised Adf security in a project centric environment
Revised Adf security in a project centric environment
Jean-Marc Desvaux
ย 
Programming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionappsProgramming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionapps
Berry Clemens
ย 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
Edward Burns
ย 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java Platform
Sivakumar Thyagarajan
ย 
ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)
Logico
ย 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
Thomas Wuerthinger
ย 
Introduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise MonitorIntroduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise Monitor
Mark Leith
ย 
Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...
Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...
Oracle zdm Migrate Amazon RDS Oracle to Oracle Autonomous 2021 Kamalesh Ramas...
Kamalesh Ramasamy
ย 
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Haytham Ghandour
ย 
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsUsing Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Luis Cruz
ย 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
Mayank Prasad
ย 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
Eric Wyles
ย 
Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824
Oracle
ย 
Lightning page optimization &amp; best practices
Lightning page optimization &amp; best practicesLightning page optimization &amp; best practices
Lightning page optimization &amp; best practices
Gaurav Jain
ย 
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
Fred Rowe
ย 
OSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaOSI_MySQL_Performance Schema
OSI_MySQL_Performance Schema
Mayank Prasad
ย 
Functional Programming With Lambdas and Streams in JDK8
 Functional Programming With Lambdas and Streams in JDK8 Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8
IndicThreads
ย 
Best Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXBBest Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXB
Martin Grebac
ย 
Con8780 nair rac_best_practices_final_without_12_2content
Con8780 nair rac_best_practices_final_without_12_2contentCon8780 nair rac_best_practices_final_without_12_2content
Con8780 nair rac_best_practices_final_without_12_2content
Anil Nair
ย 
Revised Adf security in a project centric environment
Revised Adf security in a project centric environmentRevised Adf security in a project centric environment
Revised Adf security in a project centric environment
Jean-Marc Desvaux
ย 
Ad

Recently uploaded (20)

TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
ย 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
ย 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
ย 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
ย 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
ย 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
ย 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
ย 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
ย 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
ย 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
ย 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
ย 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
ย 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
ย 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
ย 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
ย 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
ย 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
ย 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
ย 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
ย 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
ย 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
ย 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
ย 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
ย 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
ย 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
ย 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
ย 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
ย 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
ย 

Oracle ADF Architecture TV - Development - Error Handling

  • 1. 1 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.
  • 2. 2 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Real World ADF Design & Architecture Principles Error Handling ORACLE PRODUCT LOGO 15th Feb 2013 v1.0
  • 3. 3 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Learning Objectives โ€ขโ€ฏ At the end of this module you should be able to: โ€“โ€ฏ Understand the ADF error handling architecture โ€“โ€ฏ Know the scope of an error handler โ€“โ€ฏ Distinguish between error handling and incident reporting Image: imagerymajestic/ FreeDigitalPhotos.net
  • 4. 4 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 5. 5 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Fiction โ€ฆ Wouldn't it be good if there was a single location to handle all application errors and exceptions?
  • 6. 6 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. โ€ฆ and Fact. Not perfect, but a solution.
  • 7. 7 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 8. 8 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Error Handling Hooks - Overview ADF Faces (ADFv) EJB/JPAADF Business Components Java ADF Model (ADFm) JAX-WS Unhandled exceptions Servlet Container Unhandledexceptions Render Response Propagates exceptions ADF Controller (ADFc) Business Service Layer ADF Binding Layer Data Control
  • 9. 9 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Exception Handlers โ€ขโ€ฏ ADFm Exception Handler โ€“โ€ฏ Error Handler (DCErrorHandler) in BindingContext โ€ขโ€ฏ ADFc Exception Handler โ€“โ€ฏ Exception Handler activity in Task-Flow โ€“โ€ฏ Application wide Exception Handler โ€ขโ€ฏ ADFv Exception Handler โ€“โ€ฏ oracle.adf.view.rich.context.ExceptionHandler โ€ขโ€ฏ Container, error-page in web.xml
  • 10. 10 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Error Handling Overview ADF Interaction in JSF Request Lifecycle EJB/JPAADF Business Components Java ADF Binding JAX-WS Restore View Apply Request Process ValidationUpdate Model Invoke Action Render Response 1 2 3 4 5 6 JSF
  • 11. 11 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 12. 12 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. oracle.jbo.JboException โ€ขโ€ฏ JboException extends java.lang.RuntimeException โ€“โ€ฏ Thus Business Component method can throw exceptions without a throws clause in the method signature โ€ขโ€ฏ Translation of error messages occur by the client calling getLocalizedMessage() and not when an error is thrown One Exception Super Class for All Exceptions
  • 13. 13 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Bundled Exception Mode โ€ขโ€ฏ Enabled by default โ€ขโ€ฏ Presents maximal set of failed validation exceptions โ€ขโ€ฏ Java supports single exception to be thrown at a time โ€ขโ€ฏ ADF BC moves all exceptions under a parent exception โ€“โ€ฏ Multiple entity attribute validation errors (ValidationException) are wrapped in RowValException parent exception โ€“โ€ฏ Multiple rows that fail validation performed during commit will have the RowValException wrapped in TxnValException object โ€“โ€ฏ You can recursively introspect exception by calling getDetails() on each exception All Exceptions at Once
  • 14. 14 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.14 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Exceptions that are not handled in the business service propagate to the ADF model layer. Image: Ambro/ FreeDigitalPhotos.net
  • 15. 15 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 16. 16 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Model Error Handler โ€ขโ€ฏ The ADF model error handler deals with โ€“โ€ฏ All ADF binding errors โ€“โ€ฏ Business service errors that occur when accessing a service trough the ADF binding layer โ€ขโ€ฏ Formats and displays error message โ€ขโ€ฏ Default error handler skips the top-level JboException because it only is a bundled exception wrapper for other business exceptions
  • 17. 17 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Creating A Custom Error Handler โ€ขโ€ฏ Extend oracle.adf.model.binding.DCErrorHandlerImpl and configure your custom error error handler in DataBindings.cpx โ€ขโ€ฏ Override the following methods as needed โ€“โ€ฏ reportException โ€ขโ€ฏ Override this method to analyze exceptions for errors you want to handle โ€“โ€ฏ getDisplayMessage โ€ขโ€ฏ Override to change or suppress (null value) the displayed message โ€“โ€ฏ getDetailedDisplayMessage โ€ขโ€ฏ Override this method to provide HTML markup formatted detail information โ€“โ€ฏ skipException(Exception ex) โ€ขโ€ฏ Called by the framework to check if an exception should be ignored
  • 18. 18 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Oracle JDeveloper 11g R2
  • 19. 19 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Custom Error Handler Example Skip Exception for SQL Exceptions public class CustomErrorHandler extends DCErrorHandlerImpl { ... protected boolean skipException(Exception ex) { if (ex instanceof DMLConstraintException) { return false; //don't show details of SQL exception } else if (ex instanceof SQLException) { return true; } else { return super.skipException(ex); } } )
  • 20. 20 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Skip Exception Example SQLIntegrityConstraintViolationException skipException == false skipException == true
  • 21. 21 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.21 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. The code is from a managed bean in our application. What happens in case of an exception? Image: imagerymajestic/ FreeDigitalPhotos.net OperationBinding operationBinding = null; operationBinding = getOperationBinding("UpdateOrder"); operationBinding.execute(); โ€ฆ
  • 22. 22 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. On a Related Note โ€ขโ€ฏ It happens quite often that developers execute a client method directly on the Application Module โ€“โ€ฏ BindingContext > findDataControl("...") > getDataProvider() โ€“โ€ฏ Cast data provider to Application Module interface โ€“โ€ฏ Execute client methods on it โ€ขโ€ฏ The risk is that โ€“โ€ฏ Exceptions thrown by the client interface logic are not handled by the ADFm error handler if invoked directly โ€“โ€ฏ Inconsistent error handling may occur
  • 23. 23 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 24. 24 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.24 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. The ADF controller handles exceptions that occur during task flow execution Image: Ambro/ FreeDigitalPhotos.net
  • 25. 25 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Controller Exception Handling โ€ขโ€ฏ Exceptions that may occur during task flow execution include โ€“โ€ฏ Method call activity that throws an exception โ€“โ€ฏ Task flow initialize or finalize methods throwing an exception โ€“โ€ฏ Authorization failures when accessing an activity โ€ขโ€ฏ Controller exceptions are handled by a task flow activity that is designated as an exception handler โ€ขโ€ฏ When a task flow throws an exception, control flow is passed to the designated exception handling activity Introduction
  • 26. 26 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Exception Handler Activity How-to Define an Activity as the Exception Handler
  • 27. 27 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Example: Method Error Handler public void showErrorDialog() { ControllerContext context = ControllerContext.getInstance(); ViewPortContext currentViewPort = context.getCurrentViewPort(); if (currentViewPort.isExceptionPresent()) { FacesMessage fm = new FacesMessage( FacesMessage.SEVERITY_WARN, "Application Error", currentViewPort.getExceptionData().getMessage()); FacesContext fctx = FacesContext.getCurrentInstance(); fctx.addMessage("ApplicationInfo", fm); fctx.renderResponse(); } }
  • 28. 28 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Controller โ€ขโ€ฏ Exceptions that occur in context of task flow are forwarded to exception handler activity โ€ขโ€ฏ Best Practices - Define exception handling activity in each bounded and unbounded task flows โ€ขโ€ฏ Define exception handler in task flow template for consistency Exception Handler Activity
  • 29. 29 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Controller โ€ขโ€ฏ AdfcExceptionHandler is the ADF controller internal framework class that passes control to the task flow's designated exception handler activity โ€ขโ€ฏ If no exception handler activity exists, the control is passed the browser โ€ขโ€ฏ Default exception handler does not handle exceptions thrown during RENDER_RESPONSE phase Default Exception Handling
  • 30. 30 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Customizing the Framework Error Handling โ€ขโ€ฏ Configuration โ€“โ€ฏ Create oracle.adf.view.rich.context.ExceptionHandler text file and store it in .adfMETA-INFservices โ€“โ€ฏ you need to create the โ€œservicesโ€ folder โ€“โ€ฏ Add the absolute name of your custom exception handler โ€ขโ€ฏ Java class that extends ExceptionHandler โ€ขโ€ฏ Configured for whole ADF application โ€“โ€ฏ Deployed in EAR file Add Your Own Exception Handler
  • 31. 31 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. import oracle.adf.view.rich.context.ExceptionHandler; public class CustomExceptionHandler extends ExceptionHandler { public CustomExceptionHandler() { super(); } public void handleException(FacesContext facesContext, Throwable throwable, PhaseId phaseId) throws Throwable{ if ( โ€ฆ Exception or Error to check โ€ฆ){ //handle issue } else { //pass error to default exception handler throw throwable; } } } ADF Controller Overriding Default Exception Handler Class
  • 32. 32 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.32 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Be thoughtful. Don't override the framework exception handler to eagerly or for no reason. Keep in mind that the error handler is not deployed with bounded task flows but deployed with the application. Image: Ambro/ FreeDigitalPhotos.net
  • 33. 33 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Log Exceptions, Report Exceptions .. โ€ขโ€ฏ Exception handler activities handle exceptions but don't report them โ€“โ€ฏ No programming error fixes itself โ€“โ€ฏ Log and report programming or system errors โ€ขโ€ฏ Implement a exception handling, logging and reporting strategy that can be reused and that is declaratively applied โ€ขโ€ฏ Report serious issues โ€“โ€ฏ Considers weekends and vacations โ€ขโ€ฏ Evaluate BPM (SOA Suite) Human Workflow integration โ€“โ€ฏ In case of emergency, send mail or SMS
  • 34. 34 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 35. 35 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. What Could Happen Task Flow Exception Propagation Memory Stack Current Task Flow Task Flow 4 Task Flow 3 Task Flow 2 Task Flow 1 Task Flow 2 Call Task Flow 3 Call Task Flow 4 Call ! ! View1 View2 View3 View4 Task Flow 1 Task Flow 2 Task Flow 3 Task Flow 4 EH EH Method Call Current Task Flow BANG!
  • 36. 36 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. What Could Happen Task Flow Exception Propagation Memory Stack Current Task Flow Task Flow 2 Task Flow 1 Task Flow 2 Call Task Flow 3 Call Task Flow 4 Call Propagate Exception Propagate Exception ! ! View1 View2 View3 View4 Task Flow 1 Task Flow 2 Task Flow 3 Task Flow 4 EH EH Current Task Flow Method Call BANG!
  • 37. 37 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. What Could Happen Task Flow Exception Propagation ! ! View1 View2 Task Flow 1 Task Flow 2 EH EH Memory Stack Current Task Flow Task Flow 2 Task Flow 1 Task Flow 2 Call
  • 38. 38 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Visual Example Exception Handler in Caller Task Flow BANG! !
  • 39. 39 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Visual Example Exception Handler in Top Level Task Flow BANG! !
  • 40. 40 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.40 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Every bounded task flow should have an error handler activity defined. Task flow templates help to configure error handlers consistent throughout an application. Image: Ambro/ FreeDigitalPhotos.net
  • 41. 41 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 42. 42 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Unbounded Task Flow โ€ขโ€ฏ There always is a single unbounded task flow instance available for an application โ€“โ€ฏ Independent of the number of adfc-config.xml files available in the application class path โ€ขโ€ฏ Unbounded task flows cannot be based on task flow templates Exception Handling Strategy
  • 43. 43 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Unbounded Task Flow โ€ขโ€ฏ To build "error handling templates" for unbounded task flows you use an unbounded task flow definitions in an ADF Library โ€“โ€ฏ Keep adfc-config.xml as the unbounded task flow definition file โ€“โ€ฏ Deploy error handling logic as managed bean within ADF library โ€“โ€ฏ Load order of unbounded configuration files determines which exception handler become active in cases of multiple defined handlers โ€“โ€ฏ ADFc configuration files on the class path precede configurations in the application Exception Handling Strategy
  • 44. 44 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 45. 45 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Exception Handling โ€ขโ€ฏ Typically, view layer exceptions occur because of โ€“โ€ฏ Failed execution of client logic in managed beans โ€“โ€ฏ Failed access to the ADF binding layer โ€ขโ€ฏEL references in page source โ€ขโ€ฏJava references in managed beans โ€“โ€ฏ Failed EL expressions โ€ขโ€ฏTypos in the object name โ€ขโ€ฏMissing objects (e.g. entity object references) โ€ขโ€ฏFailed type casting (e.g. oracle.jbo.domain.Number to Long) โ€“โ€ฏ Expired session
  • 46. 46 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Exception Raised In Managed Bean Example: Simulating A Problem
  • 47. 47 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Exception Raised In Managed Bean Solution: Routing Exception To Binding Layer
  • 48. 48 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 49. 49 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Servlet Container โ€ขโ€ฏ Handles all exceptions not handled by an application โ€“โ€ฏ Available to all Java EE applications โ€ขโ€ฏ Looks in web.xml file for directive on how to handle a specific error code or the exception type โ€ขโ€ฏ If nothing is set-up in web.xml, the exception terminates the user application session โ€“โ€ฏ In Java, a stack trace is displayed in the browser, which exactly what you don't want to happen
  • 50. 50 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Java EE Exception Handling Last Resort <error-page> <error-code> โ€ฆ http error code here (e.g 404)โ€ฆ </error-code> <location>/unhandled_error_page.html</location> </error-page> <error-page> <exception-type> โ€ฆ exception class here โ€ฆ (e.g. java.lang.Throwable) </exception-type> <location>/unhandled_exception_page.html</location> </error-page>
  • 51. 51 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda โ€ขโ€ฏ Error Handling Introduction โ€ขโ€ฏ Handling ADF Lifecycle Errors โ€ขโ€ฏ ADF Business Components โ€ขโ€ฏ ADF Binding Layer โ€ขโ€ฏ ADF Controller โ€“โ€ฏ Bounded Task Flow โ€“โ€ฏ Unbounded Task Flow โ€ขโ€ฏ ADF View โ€ขโ€ฏ Servlet Container โ€ขโ€ฏ Summary
  • 52. 52 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. ADF Error Handling Summary Error Handling by Architecture Layers โ€ขโ€ฏtry-catch block โ€ขโ€ฏADFm Error Handler โ€ขโ€ฏException Handler Activity โ€ขโ€ฏCustom ADFc Exception Handler โ€ขโ€ฏtry-catch block โ€ขโ€ฏweb.xml ADF Faces EJB/JPAADF Business Components Java ADF Model JAX-WS Unhandled exceptions Servlet Container Unhandledexceptions Render Response Propagates exceptions ADF Controller
  • 53. 53 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Conclusion โ€ขโ€ฏ Anticipate problems and work on a mitigation strategy โ€“โ€ฏ Only leave unexpected errors and errors you want for pass through unhandled for the handlers โ€“โ€ฏ Like for application security, perform a risk analysis and identify threats (database down, WS not responsive, NPE โ€ฆ) โ€ขโ€ฏ Define exception handling strategies and code them into custom standard exception handler classes โ€ขโ€ฏ Log errors by severity
  • 54. 54 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Conclusion โ€ขโ€ฏ Access business service methods through the binding layer โ€ขโ€ฏ Use try/catch blocks in any managed bean method โ€“โ€ฏ Route managed bean exceptions to the binding layer reportError() method โ€ขโ€ฏ Use custom task flow exception handler thoughful โ€“โ€ฏ .adfMETA-INFservices โ€“โ€ฏ Avoid new exceptions in your exception handler โ€“โ€ฏ Keep in mind that this exception handler is on an application level and not task flow / ADF library level
  • 55. 55 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved. Further Reading โ€ขโ€ฏ Oracle Magazine Article "Catch Me If You Can" โ€“โ€ฏ http://www.oracle.com/technetwork/issue-archive/2013/13-mar/ o23adf-1897193.html โ€ขโ€ฏ Oracle JDeveloper and ADF Documentation Library โ€“โ€ฏ Fusion Developer Guide โ€ขโ€ฏ "Handling and Displaying Exceptions in an ADF Application" โ€ขโ€ฏ "Customizing Business Components Error Messages" โ€ขโ€ฏ How to log all errors to the database โ€“โ€ฏ http://one-size-doesnt-fit-all.blogspot.de/2008/06/jdev-adf-how-to-log-all- errors-to.html
  • 56. 56 Copyright ยฉ 2013, Oracle and/or its affiliates. All rights reserved.