How can my custom DCErrorHandler class throw/handle an exception?

I had written a custom DCErrorHandler extending the DCErrorhandlerImpl as similar as shown in SRDemo example.
Assume that i have a method authenticateUser() in AppmoduleService Class calling from Backing Bean.java where in i encountered ArrayOutOfBoundsException. So how can i catch this exception without using try catch block? if i use
try{
authenticateUser();
catch(Exception eX)
{} the exception is well-handled.Then what exactly my customErrorHandler class doing?
Do the above customErrorHandler class help in this case by replacing try-catch?

From where my customErrorHandler's methods are invoked.
If i want to do it exlicitly from any method of my backing bean class can i do it?
LoginBackingBean.java
public String loginButton_Action()
ArrayList userDetailsList = null;
LoginService service = (LoginService)ADFUtils.getLoginServiceInterface();
if(service != null)
userDetailsList = service.checkUserLoginDetails(getUsername(), getPassword());
if(userDetailsList != null && userDetailsList.size()>0) {                 
JSFUtils.storeOnSession("key_loggedUserDetails",userDetailsList);
return "success";
else
JSFUtils.addFacesErrorMessage("You have entered an invalid User name and/or Password.");
return "wrongLogin";
else{
return "wrongLogin";
Now assume that i have customDCErrorHandler class and also assume that an exception will be thrown ..say ArrayOutOfBoundException.
if i keep the above code in try and catch block the user login screen is remained as it is by catching the exception.
if i remove the try and catch block user screen if filled up with so many debugging messages as shown : "500 Internal Server Error
javax.faces.FacesException: #{login.loginButton_Action}: javax.faces.el.EvaluationException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)     at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
So can we avoid this by using my customDCErrorHandler ???? If so i need a sample code.
More over if i use a customDCErrorHandler class,
Do i need to bother about the exceptions occuring in the application?

Similar Messages

  • How can I hide the class file ??

    Hi !
    I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. Thinks

    See these....
    http://www.saffeine.com/
    http://www.jarsafe.com/
    I recently read this. This will help you.
    http://developer.java.sun.com/developer/qow/archive/160/index.jsp
    Enojy....
    Rajesh

  • How can I convert a class file to Exe file

    hai
    How can I convert a class file to Exe file

    Please search the forums before asking questions - this has been answered hundreds (really!) of times.

  • How can I  custom my date  in OBIEE.

    How can I custom my date in OBIEE.I want to see date in my user friendly format for Date Format MM/DD/YYYY to filter with
    leading zero(number) eg (01.21.2008) and not M/D/YYYY (1.21.2008) that i am seeing.I would appreciate it if you could give me a step by step process on how to do it in RPD.I know how to change the data format in my column propeties since i have more that 5000 columns that need changed.I am looking for a localised area
    that can take care of business.
    Thanks

    Edit the following parameters in OracleBI\web\config\localedefinitions.xml
    - Search for the locale that you want to customize by looking for the tag *<localeDefinition name="en">*
    - Customize the following tags as you require
    <property name="dateShortFormat">MM/DD/YYYY</property>
    <property name="dateLongFormat">dddd, MMMM dd, yyyy</property>
    - Restart the presentation server

  • Than how can i get java class by using it's class file?

    Hi
    After compilation of a java program, it creates a class file.
    After getting class file suppose class file has been deleted.
    Than how can i get java class by using it's class file?
    Thanks in advance.

    get a decompiler and run your class file through it--I'll assume you want the source code back and that you are not trying to recover a missing class file by attempting to use the class file that is missing--if it's missing, then I've not a clue on how to get it back by using what is already missing.
    BTW: many of your compilers have source control--if it does, just restore your missing file.

  • How can I access another class in a MembershipRule's Expression

    Hello,
    I want to create an InstanceGroup using Module Microsoft.SystemCenter.GroupPopulator.
    I need to collect all Logical Disks which contain an MS SQL DB Log File.
    I would start as follows:
    <DataSource ID="DS" TypeID="SC!Microsoft.SystemCenter.GroupPopulator">
      <RuleId>$MPElement$</RuleId>
      <GroupInstanceId>$Target/Id$</GroupInstanceId>
      <MembershipRules>
        <MembershipRule>
          <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.LogicalDisk"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MSIL!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>     
    <Expression>
            <And>
      <!--
       First Expression
      -->
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <Property>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/Name$</Property>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
      <!--
        How can I access another class's properties ? 
      -->
                    <GenericProperty>$MPElement[Name="SQL!Microsoft.SQLServer.2008.DBLogFile"]/Drive$</GenericProperty>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <HostProperty>
                      <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]</MonitoringClass>
                      <Property>PrincipalName</Property>
                    </HostProperty>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <GenericProperty>$MPElement[Name="SQL!Microsoft.SQLServer.2008.DBLogFile"]/Drive$</GenericProperty>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </And>
          </Expression>
        </MembershipRule>
      </MembershipRules>
    </DataSource>
    In the first expression you "see" my question:
    I want to compare the LogicalDisk's Name Property with the DB Log File's Drive property.
    But how can I access the DB Log File's Drive property in this MembershipRule ?
    Furthermore LogicalDisk and DB Log File must be hosted on the same Windows Computer.
    Would be great if somebody could help.
    Thanks
    Sebastian

    Hi Niki,
    thanks for the idea, but that will not work. $Target/Id$ refers always to the group to be discovered.
    On last week end I was given following idea, hope it will work:
    Step 1
    Collect all the DB SQL Logfile Objects and write computername (PrincipalName?) and Driveletter into a textfile, line by line. Shouldn't be a problem, PowerShell is your friend.
    Step 2
    Read the file from Step 1, build discovery data for each disk drive as object of class "Logical Disk (Server)",
    and then discover the containment-relationships from those Logical Drive(Server) Objects to the InstanceGroup.
    Perhaps I must do it for the OS-Version related Disks, because I need the target classes  of the Logical Disk Freespace monitors. Some more work. "Risks": I donot know the discovery algorithm for the Logical Disk(Server) Objects, but a "deep
    dive" into the MPs should help.
    Thanks to all, who have read.
    I will inform you about progress and success
    sebastian

  • How can we call a class file of one package for class file of another

    How can we call a class file of one package from class file of another package and both packages exist in a same folder

    How can we call a class file of one package from
    class file of another package and both packages exist
    in a same folder
    Luckily they don't so it's really not a problem after all.

  • How can our customer edit our Captivate 6 content with Captivate 5?

    Our company has decided to dive into the e-learning business and create e-learnings.  We just purchased a Captivate 6 subscription, unfortunately before finding out our customer uses Captivate 5.  He would like to edit our files once in a while when he needs to if he doesn't have enough time to have us do it.   Is there anyway he can edit content produced in Captivate 6 with his Captivate 5.  Can I export files of a certain type that he can in turn import and add to his Captivate 5 and edit himself?  In other words, what kind of files can I export from Captivate 6 than he can import with Captivate 5 and make small changes to?
      Vielen Dank,
                 Ryan

    Thank you.  I see that I can export content as an .xml file.  Isn’t this something he can upload with Captivate 5?    Thanks for bearing with my naivety. : )
    Von: RodWard [email protected]
    Gesendet: Mittwoch, 1. August 2012 14:25
    An: Scharfer, Ryan
    Betreff: How can our customer edit our Captivate 6 content with Captivate 5?
    Re: How can our customer edit our Captivate 6 content with Captivate 5?
    created by RodWard<http://forums.adobe.com/people/RodWard> in Adobe Captivate - View the full discussion<http://forums.adobe.com/message/4591371#4591371

  • How can I import a class in my program?

    In my program I want to use a class named "WordExtractor" that resides in a jar file named "poi-3.0.1-FINAL-20070705.jar".
    This jar file is stored on my computer under:
    D:\java_projects\Word Reader\poi-bin-3.0.1-FINAL-20070705\poi-3.0.1-FINAL\poi-3.0.1-FINAL-20070705.jar
    How can I import this class WordExtractor into my program?
    import ????????? ;

    In my program I want to use a class named
    "WordExtractor" that resides in a jar file named
    "poi-3.0.1-FINAL-20070705.jar".
    This jar file is stored on my computer under:
    D:\java_projects\Word
    Reader\poi-bin-3.0.1-FINAL-20070705\poi-3.0.1-FINAL\po
    i-3.0.1-FINAL-20070705.jar
    How can I import this class WordExtractor into my
    program?
    import ????????? ;After you add this jar file to the lib , you can use a tools(rar extracter tools) to extract "poi-3.0.1-FINAL-20070705.jar" file and find the position of that class "WordExtractor" .
    write "import XXXX.WordExtractor"into your program,"XXXX" is the position that you have found.

  • How can i know what transaction is handle by the TM?

    How can i know what transaction is handle by the TM?

    Hi;
    Please see below
    E-Business Oracle Trade Management Product Information Center [ID 1297829.1]
    Regard
    Helios

  • How can a customer edit a web page that I have made?

    How can a customer edit a web page that I have made?  The customer should edit the text or pictures by himself. Is this possible? 

    First you can search in this forum "in browser editing".
    Second you may be interested in this video:
    http://tv.adobe.com/de/watch/designtools-in-der-creative-cloud/bearbeitung-im-browser-in-a dobe-muse/

  • How can you custom KM Discussion iView

    How can you custom KM Discussion iView?
    Please send samples.
    Thank you,

    Hi,
    Here you have some useful links, but take into account that in the last patch SAP introduce a new forum similar to use in SDN.
    Also, try to be more clear about your requirements. What do you need to configure ?
    Configuring Discussion Groups
    http://help.sap.com/saphelp_nw2004s/helpdata/en/01/ed0f412d72f323e10000000a155106/frameset.htm
    Editing Discussion Names and Descriptions
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/ea4f16b2c04fcce10000000a422035/frameset.htm
    Configuring Discussions for Documents and Folders
    http://help.sap.com/saphelp_nw2004s/helpdata/en/00/e7d78125e60d4a8f584f58a939f73d/frameset.htm
    Patricio.

  • How can I deal with the "throw exception"?

    A function has the following definition:
    import javax.naming.NamingException;
    public BinRelation readBinRelation() throws BadInputDataException,IOException
    When I use this function as follows:
    BinRelation binRel;
    binRel = readBinRelation();
    then comes the error:
    unreported exception javax.naming.NamingException; must be caught or declared to be thrown.
    So how can use this function correctly?
    Thanks

    So how can use this function correctly?By learning what exceptions are, how they're used, and what you can do to deal with them. There's a tutorial here: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.htmlAnd here's a quick overview:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

  • How to implement custom Model Class in Oracle ADF?

    I am using Oracle ADF for one of my project and i am using Query component of ADF. For given tables the query component creates view objects and maps the relations. ADF uses its own custom model class for this component and it should understand the DB tables. But for my project i have no access to database. All i can do is pass a string or object/query to the existing (custom) Java class/object, and this model class formulates query and queries the database and returns the value to my Java class. I have to display these results using ADF to the front end. Is There a way to achieve this? Can i replace/override the existing Model class of ADF. If so how?
    Thanks in advance for your help.

    Hi, there:
    Best thing to do is to start with the default login.html page, and then modify it. The login screen is fairly complex and it's easy to just miss a JS function you need to call. To get to default page, you would need to do one deploy (to simulator or whatever), and then look for login.html page in the temporary Xcode or Android project generated from the deployment. It should be under the "deploy" directory in your JDev workspace.
    You can also see all the framework JS files and CSS files that way as well.
    We have had customers implementing custom login screen so we know it can work, but they all had to start with the default login screen and then modify it.
    Thanks,
    Joe Huang

  • How can i change the class in the Class Library project to be static or public so i can use it from the windows application project ?

    First i know that when i make any changes to the class library project i need to rebuild the project then to remove the Capture.dll from the TestScreenshot project and then to add again the updated Capture.dll
    The problem for example in this case i'm trying to use a public static variable i add in the DXHookD3D9.
    In the DXHookD3D9 i added this public static variable:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    //using SlimDX.Direct3D9;
    using EasyHook;
    using System.Runtime.InteropServices;
    using System.IO;
    using System.Threading;
    using System.Drawing;
    using Capture.Interface;
    using SharpDX.Direct3D9;
    namespace Capture.Hook
    internal class DXHookD3D9: BaseDXHook
    public DXHookD3D9(CaptureInterface ssInterface)
    : base(ssInterface)
    LocalHook Direct3DDevice_EndSceneHook = null;
    LocalHook Direct3DDevice_ResetHook = null;
    LocalHook Direct3DDevice_PresentHook = null;
    LocalHook Direct3DDeviceEx_PresentExHook = null;
    object _lockRenderTarget = new object();
    Surface _renderTarget;
    public static decimal framesperhourtodisplay = 0;
    protected override string HookName
    get
    return "DXHookD3D9";
    List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>(
    framesperhourtodisplay
    The problem is i can't even get to the Capture.Hook namespace and not to the DXHookD3D9 from the TestScreenshot application window project.
    This is a screenshot:
    For example fro the FramesPerSecond class i can use it get to it from the windows forms application.
    namespace Capture.Hook
    /// <summary>
    /// Used to determine the FPS
    /// </summary>
    public class FramesPerSecond
    int _frames = 0;
    int _lastTickCount = 0;
    float _lastFrameRate = 0;
    Since it's public i guess.
    But if i will change the DXHookD3D9 class from internal to public:
    public class DXHookD3D9: BaseDXHook
    I will get error on the DXHookD3D9: 
    Error 1
    Inconsistent accessibility: base class 'Capture.Hook.BaseDXHook' is less accessible than class 'Capture.Hook.DXHookD3D9'
    And the BaseDXHook class:
    namespace Capture.Hook
    internal abstract class BaseDXHook: IDXHook
    protected readonly ClientCaptureInterfaceEventProxy InterfaceEventProxy = new ClientCaptureInterfaceEventProxy();
    public BaseDXHook(CaptureInterface ssInterface)
    this.Interface = ssInterface;
    this.Timer = new Stopwatch();
    this.Timer.Start();
    this.FPS = new FramesPerSecond();
    Interface.ScreenshotRequested += InterfaceEventProxy.ScreenshotRequestedProxyHandler;
    Interface.DisplayText += InterfaceEventProxy.DisplayTextProxyHandler;
    InterfaceEventProxy.ScreenshotRequested += new ScreenshotRequestedEvent(InterfaceEventProxy_ScreenshotRequested);
    InterfaceEventProxy.DisplayText += new DisplayTextEvent(InterfaceEventProxy_DisplayText);
    ~BaseDXHook()
    Dispose(false);
    How can i solve it so i can use the variable framesperhourtodisplay in the DXHookD3D9 class with the TestScreenshot windows forms application ?

    Hi,
    I dont know if it will work here, since I dont know the complete structure, but the base call must be public, if the derived class is public, so the base class is at least as accessible as the derived class.
    Try make the base class public. (And maybe the base-class IDXHook of the base also...)
    Or use a different approach and make only the properties public that are needed to be public by adding an extra class...
    A structure could look like:(you need to create a class thats public in your dll and expose a property, and set this property in the internal class...)
    In the Accessing class (here Form1)
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    C c = new C();
    MessageBox.Show(B.F.ToString());
    and in the class Lib:
    internal class A
    public A()
    B.F = DateTime.Now.Millisecond;
    public class B
    public static int F { get; set; }
    public class C
    public C()
    A a = new A();
    (add a referenc to the class lib from the accessing project)
    Regards,
      Thorsten

Maybe you are looking for