Can we extend the Throwable class instead of Exception Class??

Hi all..
Can we extend the Throwable class instead of Exception Class while creating our own custom Exception?If not Why?
Please give your valuble advices..
Ramesh.

I don't want to hijack the thread here, but in a conversational tone...on a related note.. I've thought about this too a bit and wondered if there are some recommended practices about catching and handling Throwable in certain applications. Like the other day I was debugging a web application that was triggering a 500. The only way I could find the problem in an error stack was to write code to catch Throwable, log the stack, and then re-throw it. I considered it "debug" code, and once I solved the problem I took the code out because, my understanding is, we don't want to be handling runtime problems... or do we? Should I have a catch clause for Throwable in my servlet and then pass the message to ServletException?
So along with the OP question, are there separate defined occasions when we should or should not handle Throwable? Or does it just all depend on circumstance?

Similar Messages

  • Can I create the object of an protected inner class of a Base class in to t

    Dear All,
    Can I create the object of an protected inner class of a Base class in to the subclass ?
    e.g.
    public class Base{
         protected class Inner {};
    Public class Sub extends Base{
         Public Inner amethod (){
              Return new Inner(); //here I get an exception as
                                //Inner has protected access
    }Regards,
    Ishan

    @Op. The code that you posted isn't close to compiling. Java is case sensitive. It should be public and not Public, and return instead of Return.
    Kaj

  • How can i use the project code instead of project xml?

    hello
    i use the sessionbean+toplink structure,after i finish the o-r mapping by using the mapping work bench,i generate the project xml file,then in the "session.xml" file,i refer to the project xml,then i can use it from sessionbean.
    i hear that if i use the project code instead of project xml file,it will be more performant,is that true?
    otherwise,how can i use the project code instead of project xml file?i mean, in "session.xml", i can use the "<project-xml>" tag to refer to the project xml file,then in my session bean,i get the server session by read the "session.xml" file.but if i use the project code,how can i refer it from the "session.xml"?the examples that come with the toplink installation only tell me how can i use the project xml file within the session bean,it don't give me any clue about using the project code in the sesion bean,who can give me a step-by-step instruction and code snippet?
    thank you very much?

    There is a slight performance gain during session load at startup but there is no difference at runtime. The choice of which to use is dependent upon you build process. Whether it is easier to submit a new version of the class into the comile build process vs an XML file. In most cases it is just a preference of the development team.
    When you use the project-class you'll need to generate the source code and compile it into your system. Typically it is packaged with the persistent classes. You may need to configure your environment so that the class-loaders have access to these classes (same for the XML case).
    When using the project-class you simply replace the project-xml entry like this:
    <project-class>oracle.toplink.demos.employee.relational.EmployeeProject</project-class>
    The DTD for the session.xml file is found at <TOPLINK_HOME>\core\sessions_4_5.dtd. It is also in the documentation at:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/toplink.903/b10064/a-sessio.htm#634246
    Doug Clarke
    Product Manager
    Oracle9iAS TopLink

  • Can not access the Instance Data of a Singleton class from MBean

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

  • I get a neighbor's wifi on my MacBook in my bedroom.  How can I extend the range to the MacMini in my living room?

    I get a neighbor's wifi on my MacBook in my bedroom.  How can I extend the range to the MacMini in my living room?

    You can't. It's not your network.

  • Can I extend the slideshow horizontal in a straight line but not full page up and down?

    Can I extend the slideshow horizontal in a straight line across the page end to end, but not full page up and down?

    Hi
    Please check these videos for help :
    https://www.youtube.com/watch?v=BDgERSf2a5k
    https://www.youtube.com/watch?v=diUtfwFGI1w
    Thanks,
    Sanjit

  • How can i select the next column instead of next row when press enter key

    I need to know how can i select the next column instead of next row when i press the enter key.By default ,when i press enter key the next row is selected and the column remain unchanged but I wants opposite that is the row should remain unchanged but column index will changed.
    Thanks to all.

    Well, the right arrow key will already move you to the next column, so the easiest way to do this is to modify the InputMap to have the Enter key invoke the same Action as the right arrow key.
    You can search the forum for my "Table Actions" (without the space) example that will show you how to do this.

  • How can i extend the Apple TV storage to get an 1 TB? apple has any external hard disk or similar?

    how can i extend the Apple TV storage to get an 1 TB? apple has any external hard disk or similar?

    Only AppleTV1 has an internal PATA drive. The largest PATA drive available is 250gb.
    Hacks are available to use the USB port on AppleTV1 to access more storage.
    AppleTV2 does not have an internal drive.
    Why do you need more storage in your AppleTV? iTunes streams video to AppleTV so no need to store it locally.

  • How can I extend the range of my chart?

    I've asked this question before on here, and found that shift-clicking for more cells has usually worked, but I have now run into a new problem...
    My chart used to cover the range B5:P50. However, since moving a column it now only covers the cell range H5:P50. My chart is on a separate sheet. Usually if I want to add more to the range it will be downwards, so I just click on the chart, then click on the Main Sheet and shift-click to add more cells. Unfortunately, because the range I want is to the left of the highlighted area this time, I can't use shift-click.
    How can I extend the range of my chart so it includes cells to the left of the currently selected range? In Excel I'd be able to just type the range in a box somewhere, rather than all this GUI-based clicking and dragging which is actually more difficult! Is there somewhere I can just type the range in that I want?
    Thanks!

    "I want to add some series that are missing from the chart. How do I do that?"
    Here's a two step process to do that:
    Select the chart to show the the data selection on the associated chart.
    Click in the leftmost column of the data, and drag left to change (move) the selection (blue arrow) for the result below:
    Grab the control handle (small circle) at the bottom right corner of the selection, and drag  right, as indicated by the blue arrow.
    Result shown below.
    Reassign colours and do other formatting as desired.
    Regards,
    Barry

  • HT1689 How can I extend the number of times my phone rings before going to answerphone

    How can I extend the number of times my Iphone 4s rings before it goes to answerphone

    Call you carrier and ask them how you can change this.  The number of rings before voicemail kicks in is set by your carrier.  Some have the option to do it from your phone if you know the sequence of codes to send, but you need to ask your own carrier how to do it for their system.

  • Upon Removing Ubuntu, How can I Extend the C and D Drive in Windows 7?

    Upon Removing Ubuntu, How can I Extend the C and D Drive in Windows 7?
    Previously, my Computer had Windows 7 and Ubuntu as a dual Boot.  I followed some online instructions on how to Delete Grub (Ubuntu's Startup Boot Menu) and Ubuntu Partitions (<edited>) and it worked.  I wanted to expand my remaining C and
    D Partitions, but I couldn't figure out how to do it. 
    Windows 7's Disk Management shows my Laptop's only Disk divided into 3 logical drives ( i.e., the Recovery Drive, C, and D Drives).  The Order of the Drives is Disk 0 is:
        1.46 GB - Recovery Drive
      53.71 GB - C Drive
      42.79 GB - Free Space
    191.19 GB - Drive for my Personal Data/Files
        8.93 GB - Unallocated
    NOTE:  The Free Space and D Drive have a Green Box around them.
    I would like to take the Free Space and Unallocated Space and apportion it between the C and D Drives., as stated prior, I'm not sure how to do this.  Do you have any reliable and
    preferably free options? 

    Hi Bobby Marlee,
    Please share us a screenshot about disk management.
    If my understanding is right, you want to extend the C and D drive by using the free space and unallocated space.
    If you want to use Disk Management to extend the drive space, I think we need to back up the files and delete Free Space, Drive for my Personal Data/Files, and then extend C: drive and create D: drive by using the Unallocated space.
    For more information, please refer to the following article.
    http://technet.microsoft.com/zh-cn/library/cc771473.aspx#BKMK_WINUI
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • How can i extend the customer  to other  sales area

    how can i extend the customer  to other  sales area

    Hello Harish,
      Once you have a customer (eg. 100002) in one sales area (eg. 0010/10/10), you open XD01 tcode, enter the same  customer number (100002) in customer field and enter sales area (say u want to create in 0020/10/10) in which you want to create the same customer. Now in Reference section, enter the customer number (100002) and sales area in which already the customer exists (0010/10/10). When you press enter, it allows you to modify the sales area data for the customer for new sales area.
    then save it.
    Hope it is clear...

  • How can I extend the time I am timed out on the new Firefox version?

    The new version of Firefox which I recently installed times me out after a very short period of time. I can I extend the time that Firefox times me out to at least one hour of inactivity.
    == This happened ==
    Every time Firefox opened
    == right after I installed the new Firefox version today

    If you have an Exchange account on your iPad for which the admistrator has specified a limit on how long you can set the auto-lock, the only way to change it is to remove the Exchange account. Once you put the Exchange account back on, the restriction will be back in place. Apple has nothing to do with this.
    Exchange admistrator often require that devices be passcode protected and that the device will autolock so they delete the "Never" setting.

  • How can I extend the MRP Areas?

    How can I extend the MRP Areas of a material for different warehouses by LSMW? Is there a specific field for it?

    Ok, this is how my recording is built up (it ends with the same screen from the start):
    RMMDDIBE 1000
        BDC_CURSOR                     SO_WERKS-LOW
        BDC_OKCODE                     =UCOMM4
        SO_MATNR-LOW                                        MATNR                matnr
        SO_WERKS-LOW                                        WERKS                plant
        BDC_SUBSCR                     RMMDDIBE
    RMMDDIBE 1000
        BDC_OKCODE                     =CMDM
        SO_MATNR-LOW                                        MATNR                matnr
        SO_WERKS-LOW                                        WERKS                plant
        BDC_SUBSCR                     RMMDDIBE
        BDC_CURSOR                     SO_BERID-LOW
        PANE                           X
        SO_BERID-LOW                                        MRP_AREA             mrp_area
    RMMDDIBE 0101
        BDC_CURSOR                     SDIBE_MASSFIELDS-XLGP
        BDC_OKCODE                     =SAVE
        SDIBE_MASSFIELDS-XDISGR        X
        MDMA-DISGR                                          DISGR                MRP_group
        SDIBE_MASSFIELDS-XDISMM        X
        MDMA-DISMM                                          DISMM                planningskenmerk
        SDIBE_MASSFIELDS-XMINBE        X
        MDMA-MINBE                                          MINBE                bestelpunt
        SDIBE_MASSFIELDS-XDISPO        X
        MDMA-DISPO                                          DISPO                Mrp controller
        SDIBE_MASSFIELDS-XDISLS        X
        MDMA-DISLS                                          DISLS                lotzsize
        SDIBE_MASSFIELDS-XBSTFE        X
        MDMA-BSTFE                                          BSTFE                fixed lotsize
        SDIBE_MASSFIELDS-XSOBSL        X
        MDMA-SOBSL                                          SOBSL                special procurement key
        SDIBE_MASSFIELDS-XLGPRO        X
        MDMA-LGPRO                                          LGPRO                issueing storage loc
        SDIBE_MASSFIELDS-XLGFSB        X
        MDMA-LGFSB                                          LGFSB                stor location external procurement
        SDIBE_MASSFIELDS-XPLIFZ        X
        MDMA-PLIFZ                                          PFLITZ               planlevertrijd
        MDMA-PLIFZX                    X
    RMMDDIBE 1000
        BDC_CURSOR                     PA_PROSA
        BDC_OKCODE                     =ONLI
        SO_MATNR-LOW                                        MATNR                Matnr
        SO_WERKS-LOW                                        WERKS                plant
        PA_PROSA                       X
        BDC_SUBSCR                     RMMDDIBE
        PANE                           X
        SO_BERID-LOW                                        MRP_AREA             mrp_area

  • How can I extend the 2-year search window of Calendar search

    How can I extend the 2-year search window of Calendar search in iPhone 5s ? I basically want 'Search' to search everything in the phone, not just restricted to a 2-year window.

    See my link above... it's a documented limitation...
    Calendar and Reminder search
    Spotlight searches for the title of calendar events and reminders in a two-year window—it will reveal results from one year in the past and one year in the future. If an event has recurrences that fall in this range, it will find the event that is closest to the current date.
    If multiple events have similar details (title, notes, location, and so on) and you search for these details, Spotlight will show the most recent event. To see more results, use search in Calendar or Reminders.

Maybe you are looking for