Recommended Practice for Exception handling in JSP portlets

Hi,
This may be a redundant question, but hope to get some feedback on the generally used practice of catching exceptions in a JSP based Portal application.
Is it okay to just make use of the standard JSP errorpage directive in each of the JSP portlets to point to the same errorpage.jsp. If a problem occurs in any of the portlets, the userfriendly message in the errorpage.jsp would be rendered.
Of course there could be some kind of error logging done in the errorpage.jsp to track the error stack. This also means, that you would not want to catch any exceptions inside each of the portlet JSPs but rather let the errorpage directive, be the catch all?
regards
-Ananth

Mohana,
Pls ignore the voice mail,it was for something else and I was able to talk to Peter as well about this.
Regarding the error/exception handling -
If the errorPage.jsp is used in each of the JSP portlets with the help of the JPS errorPage directive, if a general system failure or major appln. error occurs, you will get the errorPage.jsp containing the user friendly message to show up in each of the half a dozen portlets on the page!!. Is that allright.
You cannot really redirect the entire page using the code inside the JSP portlet. It will only render inside the same portlet. The only way you can do this is to use Javascript.
-Ananth

Similar Messages

  • What are the best practices for exception handling in n-tier applications?

    What are the best practices for exception handling in n-tier applications?
    The application is a fat client based on MVVM pattern with .NET framework.

    What are the best practices for exception handling in n-tier applications?
    The application is a fat client based on MVVM pattern with
    .NET framework.
    That would be to catch all exceptions at a single point in the n-tier solution, log it and create user friendly messages displayed to the user. 

  • Recommended practice for handling page level validation?

    I'm wondering what the recommended practice is for handling what I would call "page level validation?"
    For example, I have two text boxes. Either one text box or the other must have a non-null value. If they are both null, I want the page validation to fail and redisplay the page the same way it would if validation for a particular field failed. However, I don't want the message that is posted to be associated with either of the two text boxes. I want it to use some other unique ID because I want to display the error text at a location that is different than for either of the text box error messages.

    The reason I don't want to use a custom converter is because I'm using a custom tag/renderer which aggregates several HTML input components and has complex conversion logic. Maybe I could chain things together, but, a converter should be used for conversion not validation. Secondly, I don't understand why validation occurs after conversion. This seems backward to me.
    One hack that I tried which almost worked was to create a custom tag/rendererer that was an input component, but, had no visible UI. I made that component always have a value which caused the validator to always be called. I made it so that it accepted a method binding as an input so that you could specify which validation method was called. I checked the component values for the components of interest using UIInput.getValue(). However, I ran into what might be a bug. Everything worked fine as long as the value changed to a non-null value. When the value was set to null, UIInput.getValue() was returning the old value instead of null. The strange thing is that the bean property that the component was bound to, ultimately was changed to null as I would have expected to. The problem was that UIInput.getValue() was returning the old value instead of null.
    My current solution which isn't ideal is by using code similar to the following in my action method that my form submit button calls.
    if(value1 == null && value2 == null) {
    String message = "Validation Error: Value is required.";
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage("id1", new FacesMessage(message, message));
    return "validationError";
    Note, I had to create my own custom tag/renderer equivalent of h:message because I couldn't get h:message to work. h:message couldn't find the message that I posted.
    The down side to doing it this way is that the validation is occurring after the validation phase. Hence, the error message isn't displayed at the same time as other error messages. Furthermore, if you have more than one button on the form, you'd have to do the check for each action method.
    This is really stupid. I can't believe something that should be so simple is so difficult in JSF. I'm planning on taking a closer look at ASP.NET. I'm pretty sure all you have to do in ASP.NET is override a method to do this and you have access to all the form controls as variables within the Page object. i.e. no having to lookup the controls using a method and a client ID.

  • What is the recommended practice for bundling JRE with Java Application?

    Hello,
    I am using a software called Advanced Installer to create a Windows installer (.msi file).
    This .msi file contains :
    - a .exe file which is a wrapper for a .jar file (a Java Swing program),
    - and a directory for the JRE.
    I read an article on the web which recommended bundling the JRE with the Java program. And
    this is what I am doing. And my understanding is that if the user's system does not already
    have the JRE installed, the bundled JRE would allow my Java Swing program to run.
    However, when I tried to install my .msi file on a system that did not already have the JRE,
    my Java Swing program would not start. After installing the JRE on this system, my Java
    Swing program started and ran fine.
    Do I really need both JREs, one bundled with my Java Swing application and one installed at the
    system's location for my Java Swing program to start and run?
    Another question I have is that if every application would bundle its own JRE, there could be many
    copies/possibly versions of the JRE on the system, is this acceptable? What is the common or
    recommended practice?
    Thank you for your help.
    Akino.

    I'm sure why it didn't work. That is how I bundle the JRE. The only disadvantage about bundling is the size of the installer file will be pretty large. In my opinion, relying on a public version is not a good idea if you have no control of the target box. The user might, for some reason, decide to uninstall java or upgrade to a new incompatible version and your app. may stop working. I'm sure many on here will disagree with this though.
    I always use the marner .exe wrapper:
    http://www.megaupload.com/?d=FYZAVM77
    and inno installer:
    http://www.jrsoftware.org/isinfo.php
    They're both free to use and I've had no problems with them. Another wrapper is Javaround:
    http://sourceforge.net/project/showfiles.php?group_id=234356

  • Best practice for Exceptions

    I wrote my own Exception class. When using it, I'm NOT sure what the best practice is.
    This is a code snippet for a fire object:
    public void doSomething(){
                      try{
                        fire = true;
                        throw new ControllerException("Warning: Reactor meltdown");
                   catch(ControllerException e){
                        System.out.println("Warning: Reactor meltdown");
              public String toString(){
                           return "Warning: Reactor meltdown";
                    }The fire class extends the abstract Disaster class which means that I have to declare a doSomething() method. It is an overridden method. It will run for all subtype objects that are created. Also the toString() method will be run for every object. So I need those two methods. When I run the program, I get the message 3 times obviously.
    What I want to know is, where is the best place to send the message from? What is the best programming practice?
    For example, should I make my Exception class with a no-args constructor and then make the toString() method blank? Or should I eat the Exception (supposedly a bad practice) and use the Constructor to send the message?
    Edited by: SquareBox on Apr 12, 2011 10:24 AM

    Not sure I understand your question.
    SquareBox wrote:
    I wrote my own Exception class. When using it, I'm NOT sure what the best practice is.
    This is a code snippet for a fire object:
    public void doSomething(){
                      try{
                        fire = true;
                        throw new ControllerException("Warning: Reactor meltdown");
                   catch(ControllerException e){
                        System.out.println("Warning: Reactor meltdown");
              public String toString(){
                           return "Warning: Reactor meltdown";
    What class is this whose toString() method always returns "meltdown"? That makes no sense.
    Why are you throwing an exception and then immediately catching it in the same try statement? I really don't get what you're trying to show here.
    What I want to know is, where is the best place to send the message from? What do you mean "send the message"?
    What is the best programming practice?It depends.
    For example, should I make my Exception class with a no-args constructor Usually you would declare a no-arg c'tor, one that takes a String (message), one that takes a Throwable (cause), and one that takes both, all of which just invoke super(...) with the same args. Look at the code for the Exception class for an example.
    and then make the toString() method blank?You usually would not override toString(), since Throwable already does that.
    Or should I eat the Exception (supposedly a bad practice) and use the Constructor to send the message?No idea what you mean by "use the constructor to send the message".

  • Recommended practice for adding and deleting from a Collection

    Are there any suggestions for updating a Collection in a OneToMany ( privateOwned ) Collection? Here is our use case:
    1. Retrieve a Source object from the database
    2. Remove 1 or more SourceLinks from the sourceLinks Set
    3. Add 1 or more new SourceLinks to the sourceLinks Set
    4. Update the Source object
    The SourceLink object has isPrivateOwned(true).
    Adding and Removing things from a Collection seems like a fairly common use case. Are there recommended ways of handeling the above case? I've tried doing the add/remove operation in one transaction as well as removing, then re-fetching, and then adding in separate transactions and haven't had any luck.
    Here is the code an test case.
    class Source
    @OneToMany(mappedBy = "source",
    fetch = FetchType.EAGER,
    cascade = { CascadeType.ALL })
    private Set<SourceLink> sourceLinks = new HashSet<SourceLink>();
    class SourceLink
    @ManyToOne
    @JoinColumn(nullable = false)
    private Source source;
    //~ Unit Tests
    @Test
    public void testMultiUpdateSourceLink()
    // typical set up.
    SourceLink sourceLink = new SourceLink( "junit1", 48, "mp3" );
    SourceLink sourceLink2 = new SourceLink( "junit2", 64, "mp3" );
    Source mySource = new Source( "http://www.site.com", SourceType.RSS );
    mySource.addSourceLink( sourceLink );
    mySource.addSourceLink( sourceLink2 );
    beginTransaction();
    sourceDao.persist( mySource );
    commitTransaction();
    Long sourceId = mySource.getId();
    Assert.assertEquals( 2, mySource.getSourceLinks().size() );
    // fetching what we just added, then deleting something from the set
    // with privateOwned this works.
    beginTransaction();
    Source fetched = sourceDao.find( sourceId );
    fetched.deleteSourceLink( sourceLink );
    sourceDao.update( fetched );
    commitTransaction();
    Assert.assertEquals( 1, fetched.getSourceLinks().size() );
    // now fetch again, try to add a new SourceLink
    // fails with an OptimisticLockException
    beginTransaction();
    Source updated = sourceDao.find( sourceId );
    Assert.assertEquals( 1, updated.getSourceLinks().size() );
    SourceLink sl = new SourceLink( "ryan", 64, "mp3" );
    updated.addSourceLink( sl );
    sourceDao.update( updated );
    commitTransaction();
    Assert.assertEquals( 2, updated.getSourceLinks().size() );
    The sourceDao.update() method simply calls entityManager.merge(source). Is it required to flush the entityManager as well?

    Hi,
    TMG MBE doesn't have the capability to add network topolgy routes via the TMG MMC. You have to use the ROUTE ADD /P command from a privileged command prompt
    regards Marc Grote aka Jens Baier - www.it-training-grote.de - www.forefront-tmg.de - www.galileocomputing.de/3276?GPP=MarcGrote

  • What is Considered Best Practice for Error Handling in Components?

    What would be the best approach to handling errors in custom (possibly composite) components?
    I see three different possibilities:
    Having the error handling funciton within the component. The problem is that this is not adaptable to the consumers error handling setup (i.e. logging to database, redirecting to a pretty error screen, etc.).
    Passing in an error function as a parameter. The problem here is how to have the externally defined error function interact with external elements that are not defined within the component, i.e. passing the error or fault object to a logging class, or something similar, of which the component knows nothing about.
    Referencing the external error handling methods directly from within the component. (Of course that's shabby programming, just listing as a technical option.)
    How do you solve this?
    My goal is to have a versatile custom component that can utilize any given consumer's error handler.
    Thanks,
    Mike

    or define a customized event and dispatch it when error occur, then you can just listen to it outside

  • Alerts from PI for Exception Handling

    We have a scenario where the incoming message is examined and if the value exceeds certain threshold, we want to generate alerts and send notification to a set of users.  What are some of the options available that SAP would recommend or other customers have implemented? 
    Thank you!
    Cheers
    George

    Multiple ways to trigger alerts in XI.
    One of them shown in this blog of mine :
    /people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
    Or use BPM based alerts and so on.
    Regards
    Bhavesh

  • Exception handling best practice

    whats the best practice for exception handling on ?
    - BC
    -controller
    -view layer (Managed beans)
    do we have to handle commit operations on BC so we can rollback like this code
    public void save()
    // create/update/delete ROW
    try
    this.getTransaction().commit();
    catch(JboException e ){this.getTransaction().rollBack();}
    thanks
    Edited by: user3674912 on 23/05/2011 05:18 ص

    Hi,
    IMO, best practices is to handle exceptions as close to their origin. If you can't handle it, you re-throw it as you would in Java so another handler gives it a try
    Frank

  • Best practices for dealing with Exceptions on storage members

    We recently encountered an issue where one of our DistributedCaches was terminating itself and restarting due to an RuntimeException being thrown from our code (see below). As usual, the issue was in our own code and we have updated it to not throw a RuntimeException under any circumstances.
    I would like to know if there are any best practices for Exception handling, other than catching Exceptions and logging them. Should we always trap Exceptions and ensure that they do not bubble back up to code that is running from the Coherence jar? Is there a way to configure Coherence so that our DistributedCaches do not terminate even when custom Filters and such throw RuntimeExceptions?
    thanks, Aidan
    Exception below:
    2010-02-09 12:40:39.222/88477.977 Oracle Coherence GE 3.4.2/411 <Error> (thread=DistributedCache:StyleCache, member=48): An exception (java.lang.RuntimeException) occurred reading Message AggregateFilterRequest Type=31 for Service=DistributedCache{Name=StyleCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=1021, BackupCount=1, AssignedPartitions=201, BackupPartitions=204}
    2010-02-09 12:40:39.222/88477.977 Oracle Coherence GE 3.4.2/411 <Error> (thread=DistributedCache:StyleCache, member=48): Terminating DistributedCache due to unhandled exception: java.lang.RuntimeException

    Bob - Here is the full stacktrace:
    2010-02-09 13:04:22.653/90182.274 Oracle Coherence GE 3.4.2/411 <Error> (thread=DistributedCache:StyleCache, member=47): An exception (java.lang.RuntimeException) occurred reading Message AggregateFilterRequest Type=31 for Service=DistributedCache{Name=StyleCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=1021, BackupCount=1, AssignedPartitions=205, BackupPartitions=204}
    2010-02-09 13:04:22.653/90182.274 Oracle Coherence GE 3.4.2/411 <Error> (thread=DistributedCache:StyleCache, member=47): Terminating DistributedCache due to unhandled exception: java.lang.RuntimeException
    2010-02-09 13:04:22.653/90182.274 Oracle Coherence GE 3.4.2/411 <Error> (thread=DistributedCache:StyleCache, member=47):
    java.lang.RuntimeException: java.lang.ClassNotFoundException: com.edmunds.vehicle.Style$PublicationState
         at com.edmunds.common.coherence.EdmundsEqualsFilter.readExternal(EdmundsEqualsFilter.java:84)
         at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:153)
         at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
         at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3284)
         at com.tangosol.io.pof.PofBufferReader.readAsObjectArray(PofBufferReader.java:3328)
         at com.tangosol.io.pof.PofBufferReader.readObjectArray(PofBufferReader.java:2168)
         at com.tangosol.util.filter.ArrayFilter.readExternal(ArrayFilter.java:243)
         at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:153)
         at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
         at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3284)
         at com.tangosol.io.pof.PofBufferReader.readAsObjectArray(PofBufferReader.java:3328)
         at com.tangosol.io.pof.PofBufferReader.readObjectArray(PofBufferReader.java:2168)
         at com.tangosol.util.filter.ArrayFilter.readExternal(ArrayFilter.java:243)
         at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:153)
         at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
         at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3284)
         at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2599)
         at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:348)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:4)
         at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
         at com.tangosol.coherence.component.net.message.requestMessage.distributedCacheRequest.partialRequest.FilterRequest.read(FilterRequest.CDB:8)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$AggregateFilterRequest.read(DistributedCache.CDB:4)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:117)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassNotFoundException: com.edmunds.vehicle.Style$PublicationState
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at com.edmunds.common.coherence.EdmundsEqualsFilter.readExternal(EdmundsEqualsFilter.java:82)
         ... 25 more
    2010-02-09 13:04:23.122/90182.743 Oracle Coherence GE 3.4.2/411 <Info> (thread=Main Thread, member=47): Restarting Service: StyleCacheOur code was doing something simple like
    catch(Exception e){
        throw new RuntimeException(e);
    }Would using the ensureRuntimeException call do anything for us here?
    Edited by: aidanol on Feb 12, 2010 11:41 AM

  • Exception Handling in Object Oriented Design

    I am developing a huge web based project using Object Oriented design and java,srvlets ,jsp etc ,I am using 3-tier archtecture.I dont understand,how i should handle exceptions in my project.ie.If there is some exception in the base modules how should it be handled.What kind of excpetion Structure should i use,How many exception classes should be made etc,
    Can someone help me in this regard

    A couple things I have found to be good practices for exception handling in an n-tier architecture:
    1. Don't expose all the internal exceptions of a tier to the client of the tier. Create a more useful, descriptive set of exceptions (or use the appropriate predefined exceptions) to throw up to the client.
    For example, on one project, we are doing database access among other things in the "service" tier, which is accessed by the web tier. We catch the SQLExceptions, PersistenceExceptions (a custom exception), and others, and throw a more useful exception that the client will know how to handle such as a NoMeasurementResultsException if the client asks for measurement results when we have none.
    2. Chain your exceptions and/or log the root cause in the tier that re-throws a different exception. There is nothing more aggravating than not knowing why, when you are debugging a problem, you are getting a NoMeasurementResultsException when you know that there ARE results in the database.
    Hope these ideas help in your design.
    Cheers,
    Colin

  • What are the best practices for the RCU's schemas

    Hi,
    I was wondering if there is some best practices about the RCU's schemas created with BIEE.
    I already have discoverer (and application server), so I have a metadata repository for the Application Server. I will upgrade Discoverer 10g to 11, so I will create new schema with RCU in my metada repository (MR) of the Application Server. I'm wondering if I can put the BIEE's RCU schemas in the same database.
    Basically,
    1. is there a standard for the PREFIX ?
    2. If I have multiple components of Fusion in the same Database, I will have multiples PREFIX_MDS schema ? Can they have the same PREFIX ? Or They all need to have a different prefix ?
    For exemple: DISCO_MDS and BIEE_MDS or I can have DEV_MDS and this schema is valid for both Discoverer and BIEE.
    Thank you !

    What are the best practices for exception handling in n-tier applications?
    The application is a fat client based on MVVM pattern with
    .NET framework.
    That would be to catch all exceptions at a single point in the n-tier solution, log it and create user friendly messages displayed to the user. 

  • Exception handling for Null/Incorrect input parameters

    Hi,
    My BI Publisher report has input parameter name as <region>. It is a text field and is mandatory parameter.
    But if I run the report without giving value to the parameter it gives the error "The report cannot be rendered because of an error, please contact the administrator."
    How can I handle this scenario so that User defined message is displayed, asking user to give correct input.
    I am using Oracle BI Publisher 10.1.3.3.3
    Is there some documentation available for Exception Handling/How to display User defined messages in case of error?
    My requirement is that after displaying the error message (say for example "Please enter Region name"), the report processing should stop there only and it should not display the blank pages of the rest of the PDF template.
    Thanks in advance.

    Hi,
    Thanx for the solution.
    I have another query linked to this issue. My requirement is that after displaying the error message (say for example "Please enter Customer name"), the report processing should stop there only and it should not display the blank pages of the rest of the PDF template.
    Thanx in advance.

  • Extend BizTalk ESB Exception Handling to manage exception for all organization wide application exception

    Hello,
    Can we Extend BizTalk ESB Exception Handling to manage exception for all organization wide application ( both biztalk and external) exception ?
    Is it something a good option or there are better approach to do this.
    Business requirement is Exception management should be single window for complete end-to end application ( source-Biztalk - destination)
    Tarun
    Tarun

    Hi Tarun,
    ESB Toolkit framework for exception handling is not complete OOTB. it is intended as a framework and set of patterns that can and should
    be extended based on the customer’s needs.
    One way of extending the capabilities is by using Standardized Exception Management or SEM in short. 
    SEM solution extends the capabilities of the Microsoft ESB Exception Management Framework and follows a design pattern that provides a flexible
    approach to exception monitoring and enables error responses to originate from outside of the solution. While SEM is primarily targeted to Microsoft BizTalk Server applications, it can also be leveraged by other applications that are able to call a Windows
    Communications Foundation (WCF) or web service.
    Refer: Standardized Exception Management
    Standardized Exception Management (SEM)
    Rachit

  • Exception Handling in bounded taskflows - expected behaviour

    Hi,
    I'm currently reviewing exception handling in bounded task flows and some things does not seems to be very clear for me.
    (q1) Does it make sense that a bounded task flow calls a method (via a method activity) defined on the page definition of another page (outside of the BTF) by using a #{data.xxxmyPageDef.myMethodName.execute} EL expression?
    (q2) Is is correct to expect the application to execute the method marked as ExceptionHandler in the taskflow, whenever an exception occurs?
    (q3) I created 5 different scenarios where I call a service method which throws an exception, from within a page fragment of the BTF.
    (q3 – sc1) Call a service method through the binding layer of the current page (by using #{bindings.xxx.execute})
    Result: A dialog containing the exception message appears.
    This is what I expected. Althought, the exception handler method does not seems to be invoked.(q3 – sc2) Call a service method through a task flow method activity using #{bindings.xxx.execute}
    Result: A dialog containing the exception message appears.
    This is what I expected. Althought, the exception handler method does not seems to be invoked.(q3 – sc3) Call a service method through a task flow method activity using #{data.myPageFragementPagedef.xxx.execute} (accessing the pageDef of the page fragment)
    Result: Nothing happens.
    This is not what I expected. Although, the exception handler method does nog seems to be invoked, I expect the ADF Error Handler to create a FacesMessage.(q3 – sc4) Call a service method through a task flow method activity using #{data.myPageContainingThePageFragmentPageDef.xxx.execute} (accessing the page containing the BTF region)
    Result: Nothing happens.
    This is not what I expected. Although, the exception handler method does nog seems to be invoked, I expect the ADF Error Handler to create a FacesMessage. (q3 – sc5) Call a service method through a task flow method activity using #{data.aPageOutsideTheBTFPageDef.xxx.execute} (accessing a page outside the BTW)
    Result: Nothing happens.
    This is not what I expected. Although, the exception handler method does nog seems to be invoked, I expect the ADF Error Handler to create a FacesMessage. (q4) How can it be possible that – without an exception handler – exceptions occur when calling method activities, without the exceptions being translated to FacesMessages?
    Thanks in advance,
    Koen Verhulst
    JDeveloper 11.1.1.4

    Koen,
    +(q1) Does it make sense that a bounded task flow calls a method (via a method activity) defined on the page definition of another page (outside of the BTF) by using a #{data.xxxmyPageDef.myMethodName.execute} EL expression?+
    No. Exceptions should be handled locally.
    +(q2) Is is correct to expect the application to execute the method marked as ExceptionHandler in the taskflow, whenever an exception occurs?+
    Only for exceptions that are before Render Response. The Render Response Phase is not handled in ADFc. So exceptions that occur in managed beans may fall through
    +(q3) I created 5 different scenarios where I call a service method which throws an exception, from within a page fragment of the BTF.+
    +(q3 – sc1) Call a service method through the binding layer of the current page (by using #{bindings.xxx.execute}) Result: A dialog containing the exception message appears.+
    This is what I expected. Althought, the exception handler method does not seems to be invoked.
    The binding layer has an error handler you can override in the DataBinings.cpx file
    +(q3 – sc2) Call a service method through a task flow method activity using #{bindings.xxx.execute}+
    Result: A dialog containing the exception message appears.
    This is what I expected. Althought, the exception handler method does not seems to be invoked.
    Again, you use the binding layer to invoke the service
    +(q3 – sc3) Call a service method through a task flow method activity using #{data.myPageFragementPagedef.xxx.execute} (accessing the pageDef of the page fragment)+
    Result: Nothing happens.
    This is not what I expected. Although, the exception handler method does nog seems to be invoked, I expect the ADF Error Handler to create a FacesMessage.
    Never use such a call. Its bad practice as there is no guarantee the container you reference is active. Always have the method call activity have its own binding defined when accessing a method call activity. I know there are lots of example floating aroundthat you #{data ...} and many are from 10.1.3. This should be avoided alltogether though
    +(q3 – sc4) Call a service method through a task flow method activity using #{data.myPageContainingThePageFragmentPageDef.xxx.execute} (accessing the page containing the BTF region)+
    Result: Nothing happens.
    This is not what I expected. Although, the exception handler method does not seems to be invoked, I expect the ADF Error Handler to create a FacesMessage.
    Again, this is not a proper use of the ADF framework.
    +(q3 – sc5) Call a service method through a task flow method activity using #{data.aPageOutsideTheBTFPageDef.xxx.execute} (accessing a page outside the BTW)+
    Result: Nothing happens. This is not what I expected. Although, the exception handler method does nog seems to be invoked, I expect the ADF Error Handler to create a FacesMessage.
    accessing a page outside the BTW (!!!) This should ring a worst practices alarm on your laptop (obviously doesn't do it either)
    +(q4) How can it be possible that – without an exception handler – exceptions occur when calling method activities, without the exceptions being translated to FacesMessages?+
    Exceptions are not handled in a single place but stacked. The business service raises an exception and passes it to the binding layer if not handled. The binding layer handles the exception and if it can't passes it to ADFc. ADFc can handle this exception if it is not during Render Response.
    Bottom line: There is no single point of exception handling. So as a recommendation for best practices
    - Catch and handle exceptions as close as possible to their origins
    - If things can go wrong, thy will - use try/catch blocks in managed beans
    - Use an exception handling activity in all bounded task flows. In the case of task flow call activities being used exceptions can bubble up to the caller. However, this would take users out of their current application context
    - Exceptions not handled in ADFc can be intercepted by overriding the application task flow exception handler (used by the exception handler activities). This would give you a chance e.g. to handle issues during Render Response
    - Never fight the framework, never bend the framework: Don't use out of scope access to page definitions and resources. Exception handling is not a replacement for bad code practices (sorry for saying this, its not meant to be rude) :-)
    Though I don't have a qualified numbers of bugs open for exception handling in ADF between 11.1.1.4 and now (and some that are open), but there are issues reported in this area. If there is something that really feels wrong, please go ahead and file a bug and provide a test case for development to have a look. The Render Response issue, for example is something we are aware of and that is in discussion (afaik knows, there is a change in exception handling in JSF 2 that may have an impact to what we can do in ADFc).
    thanks
    Frank

Maybe you are looking for