Exceptions - how to access data in stack frames?

Presently when an exception is thrown, the stack trace with line numbers can be printed.
e.printStackTrace().
I feel that it is equally important to be able to print out the state ie. the data at each step of the stack frame.
By data, I mean local and member variables, method parameters. This could be very useful.
Question: is the data in the stack frame (including frames below the current one) accessible from a catch block?
thanks,
Anil Philip
Kansas City, MO
Software Engineer,
Sprint PCS

Hello Anil,
You have my permission to post my reply at the forums. And you are correct that the approach I mentioned (which many developers follow) works only with the current stack frame.
All the best.
Jeff
-----Original Message-----
From: Jeff Friesen [mailto:[email protected]]
Sent: Tuesday, March 04, 2003 1:42 PM
To: Philip, Anil [PCS]
Cc: Jennifer Orr
Subject: Reply to your question
Hello Anil,
Being able to obtain current state values from within a catch clause is helpful in figuring out what a program was doing just
prior to an exception. (When catch clauses are left empty, there's obviously no need to obtain those values.) To obtain the
current state values (found in local variables, method parameters, and member -- field -- variables), developers typically do
the following:
1) Subclass an appropriate exception class (such as Exception for checked exceptions or RuntimeException for unchecked
exceptions).
2) Within the subclass, declare private field variables to hold appropriate state values.
3) Within the subclass, declare some combination of a constructor and setter methods to initialize those field variables to
current state values.
4) Within the subclass, declare getter methods to return those state values.
5) Just before throwing an exception, create an object from the exception subclass and populate that object (via constructor
and setter methods) with current state values found in local variables, method parameters, and fields.
6) From within the appropriate catch clause, call the getter methods to obtain the state values.
What I've just stated is commonly done by developers. Why doesn't Sun provide an automatic means for obtaining all these
values? In other words, why doesn't Sun do much of the above work for you? I personally believe that performance has a lot to
do with the answer. When you think about the potentially infinite number of local variable, method parameter, and field
combinations, an automated mechanism to accomplish this task would be time-consuming -- like garbage collection. For the
many catch clauses that don't require access to state values, the time needed to retrieve such values wouldn't be justified. (I'm
sure better reasons than the performance reason I've given can be stated: I can't think of any other reasons, at the moment.)
In closing, my suggestion is to design appropriate exception classes that capture just the amount of state needed to figure
out why an exception has occurred and properly recover from that exception.
Jeff
P.S.
As to your "is the data in the stack frame (including frames below the current one) accessible from a catch block," my answer
is that it's accessible if you've stored those values in an exception object prior to throwing the exception. Otherwise, I
don't believe it is accessible -- at least not from StackTraceElement or the Reflection API.

Similar Messages

  • How to access the java stack table "xi_af_msg" from the ABAP engine.

    Hello Guys,
    How to access the java stack table "xi_af_msg" from the ABAP engine.
    I need to access this table.

    These 3 are the tables that are for XI Adapter in ABAP Stack.
    SWFRXICNT
    SWFRXIHDR
    SWFRXIPRC
    You can also try the following tables.
    SXMSAEADPMOD                   XI: Adapter and Module Information
    SXMSAEADPMODCHN                XI: Adapter Module Chains
    SXMSAEAGG                      XI: Adapter Runtime Data (Aggregated)
    SXMSAERAW                      XI: Adapter Runtime Data (Raw Data)
    Cheers,
    Sarath.
    Award if helpful.

  • How to access Data Guard option in Oracle 10g OEM

    Hi All,
    I have Oracle 10g ENTERPRISE EDITION on Unix envoirement. I want to setup logical standby Database through Data Guard technology. But when I brows through OEM I do not find Link for DATA GUARD????
    1) How to access Data Guard option from oracle 10g OEM.
    2) Does It come with Enterprise Edition OR I have to install it separately.
    Regards,
    Darshan

    I am managing almost everything through EM Grid Control. It is easy to setup and configure.
    Anyways, if you have read the documentation on
    Oracle® Data Guard Concepts and Administration and setup your environment accordingly then you should not have any problems. Atleast I can assure you that your production database will not be affected by it.
    Just make sure that you follow each step and read thoroughly. If you have spare machines then you can test and record your configuration before performing it on your production db. This link will provide you with the information on DataGuard.
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14239/concepts.htm
    If you think that way then you will never be able to do any new stuff since you will always fear that something might go wrong. Go ahead pal, try it on test machines and you will know that it is not that difficult.
    There are real experts who help people like us in this forum and I know that they are doing a pretty good job.
    All the best.
    Rgds
    Adnan

  • How can access data in rman output file "daily.log"

    Hi All,
    i did use following query for rman out
    output file "daily.log" has been created,but does not exist data.
    how can access data in output file "daily.log"
    bash-3.00$ sh rmant.sh
    Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 30 16:54:16 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: DEV (DBID=45558086)
    RMAN> Spool log to daily.log;
    2> run
    3> {
    4> backup databas;
    5>}
    6> spool log off;
    7>
    Spooling started in log file: daily.log
    Recovery Manager10.2.0.3.0
    Starting backup at 30-JUN-11
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=634 devtype=DISK
    channel ORA_DISK_1: starting compressed incremental level 0 datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00014 name=/u02/proddata/a_int01.dbf
    input datafile fno=00022 name=/u02/proddata/a_txn_data01.dbf
    input datafile fno=00023 name=/u02/proddata/a_txn_data02.dbf
    input datafile fno=00024 name=/u02/proddata/a_txn_data03.dbf
    input datafile fno=00039 name=/u02/proddata/a_txn_data04.dbf
    input datafile fno=00038 name=/u02/proddata/undo02.dbf
    input datafile fno=00027 name=/u02/proddata/a_txn_ind03.dbf
    input datafile fno=00028 name=/u02/proddata/a_txn_ind04.dbf
    input datafile fno=00012 name=/u02/proddata/undo01.dbf
    input datafile fno=00015 name=/u02/proddata/a_media01.dbf
    input datafile fno=00025 name=/u02/proddata/a_txn_ind01.dbf
    input datafile fno=00026 name=/u02/proddata/a_txn_ind02.dbf
    input datafile fno=00029 name=/u02/proddata/a_txn_ind05.dbf
    input datafile fno=00021 name=/u02/proddata/a_summ01.dbf
    input datafile fno=00019 name=/u02/proddata/a_ref01.dbf
    input datafile fno=00020 name=/u02/proddata/a_ref02.dbf
    input datafile fno=00001 name=/u02/proddata/system01.dbf
    input datafile fno=00002 name=/u02/proddata/system02.dbf
    input datafile fno=00003 name=/u02/proddata/system03.dbf
    input datafile fno=00004 name=/u02/proddata/system04.dbf
    input datafile fno=00005 name=/u02/proddata/system05.dbf
    input datafile fno=00006 name=/u02/proddata/system06.dbf
    input datafile fno=00007 name=/u02/proddata/system07.dbf
    input datafile fno=00008 name=/u02/proddata/system08.dbf
    input datafile fno=00009 name=/u02/proddata/system09.dbf
    input datafile fno=00010 name=/u02/proddata/system10.dbf
    input datafile fno=00011 name=/u02/proddata/system11.dbf
    input datafile fno=00013 name=/u02/proddata/a_archive01.dbf
    input datafile fno=00036 name=/u02/proddata/sysaux01.dbf
    input datafile fno=00016 name=/u02/proddata/a_nolog01.dbf
    input datafile fno=00037 name=/u02/proddata/izu01.dbf
    input datafile fno=00017 name=/u02/proddata/a_queue01.dbf
    input datafile fno=00018 name=/u02/proddata/a_queue02.dbf
    input datafile fno=00031 name=/u02/proddata/odm.dbf
    input datafile fno=00034 name=/u02/proddata/portal01.dbf
    input datafile fno=00035 name=/u02/proddata/sfx01.dbf
    input datafile fno=00030 name=/u02/proddata/ctxd01.dbf
    input datafile fno=00032 name=/u02/proddata/olap.dbf
    input datafile fno=00033 name=/u02/proddata/owad01.dbf
    channel ORA_DISK_1: starting piece 1 at 30-JUN-11
    channel ORA_DISK_1: finished piece 1 at 30-JUN-11
    piece handle=/sw/weekly_cum_database_DEV_t755196858_c1_s24_p1 tag=WEEKLY_CUM_DAT
    ABASE comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:32:55
    channel ORA_DISK_1: starting compressed incremental level 0 datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current control file in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: starting piece 1 at 30-JUN-11
    channel ORA_DISK_1: finished piece 1 at 30-JUN-11
    piece handle=/sw/weekly_cum_database_DEV_t755198834_c1_s25_p1 tag=WEEKLY_CUM_DAT
    ABASE comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
    Finished backup at 30-JUN-11
    Spooling for log turned off
    Recovery Manager10.2.0.3.0
    Recovery Manager complete.
    bash-3.00$

    i did try this but it hangs
    bash-3.00$ sh rmant.sh
    Recovery Manager: Release 10.2.0.3.0 - Production on Fri Jul 1 10:52:01 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: DEV (DBID=45558086)
    RMAN> Spool log to 'daily' append;
    2> run
    3> {
    4> backup as backupset
    5> incremental level=0 cumulative
    6> device type disk
    7> tag "weekly_cum_database"
    8> format '/sw/weekly_cum_database_%d_t%t_c%c_s%s_p%p'
    9> database;
    10> }
    11>

  • I am tryin to access old macbookpro harddisk on macbook air,when i connect it via usb i see the folders,but i dont see any files e.g. photos,movies,docs are not there,its shows that 220gb is used,but no data is visible...can u pls adv how to access data?

    i am tryin to access old macbookpro harddisk on macbook air,when i connect it via usb i see the folders,but i dont see any files e.g. my saved photos,movies,docs are not there,its shows that 220gb is used,but no data is visible...all folder are empty.......can someone pls adv how to access data?

    i am tryin to access old macbookpro harddisk on macbook air,when i connect it via usb i see the folders,but i dont see any files e.g. my saved photos,movies,docs are not there,its shows that 220gb is used,but no data is visible...all folder are empty.......can someone pls adv how to access data?

  • How to access data of all users in a page?

    Hi all, I am new to APEX and have a query.
    I have installed APEX on my local machine, created a workspace, and added a few users with roles.
    I am creating an application, similar to a Library app, where I have a table that stores Books information (BOOK_ID, BOOK_NAME, etc). I'd like to create another table BOOK_USER with two columns, BOOK_ID and USER_ID. BOOK_ID would refer to the BOOKS table, and I want USER_ID to refer to the table that stores user details of the workspace that I am using. The data entry would happen from a page that has two LOVs, one for book name (using BOOK_ID as the value) and another for user name (USER_ID, or whatever field APEX uses to store user's ID). Can I do that in APEX? I've found ways to access and authenticate a user for a page, but how to get data of all users in the workspace? In other words, how to get all usernames in a LOV?
    As I am new to APEX, I'd appreciate if someone can guide me through the steps, or post links to tutorial, etc.

    Assuming that you are using the Application Express User Accounts for authentication, in that case you have to use built-in apex views
    selet * from APEX_WORKSPACE_APEX_USERSAnd use USER_NAME column instead of user_id
    See http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/priv_public001.htm#HTMDB25949

  • TS1398 how to access data without Wi-Fi

    My phone will not access data when I am not in . A Wi-Fi area. How can I fix this?

    you may want to try resetting your network settings, found at settings  -> general -> reset -> reset network settings. this will delete your wifi passwords from being stored in the phone, so you will have to input those again

  • How to access data in different server  with flex3 remoteobject

    I am trying to access data from cfc that is in different pc
    through network and coldfusion 8, flex3 and sql server are in diff.
    pcs. So how can I access the cfc file in different pc using remote
    object which will return the data from another server using dsn? I
    can connect to the service if coldfusion and flex are kept in same
    pc. How can I access it in diff. pc?what will be destination and
    source param values?
    Any help is appreciated.

    Hi,
    You should be able to achieve this by changing the end point
    URL of the channel you are using in the services-config.xml. The
    end point URL should point to the server where your CF is deployed.
    Hope this helps.

  • How to access thru java stack

    Hi All
    can anyone pls let me know
    how to access sap thru java stack like what is ipaddress and port etc.
    Thanks in Advance
    Arun

    you can find full java administartion documentation at
    http://help.sap.com/saphelp_nwce10/helpdata/en/c8/cdfacc37efa84d914699ad31eb69b8/frameset.htm
    Also the link for accessing java page is
    http://<full hostname>:<port>
    full hostname- hostname of your SAP JAVA instance
    port no- 50000+100*Instance number
    Instance no- SAP system instance no
    Rohit

  • How to access date and time of compiled forms

    hi all
    i want to access the date ,time and size of compiled forms that are stored in a particular folder.
    can anybody tell me how to access it.
    thanx
    Message was edited by:
    new.oradev

    hi all
    i want to access the date ,time and size of compiled
    forms that are stored in a particular folder.
    can anybody tell me how to access it.
    thanx
    Message was edited by:
    new.oradevIs this an Oracle Forms question???
    You can always use your operating system to check the creation/modification/access dates of a file on your file system.
    If you're looking for versioning, I suggest you read abot OSCM (Oracle Software Configuration Manager)
    Tony

  • How  to access data in AS 400 from Oracle database

    Hi
    Could you please help me on accessing data in AS 400 from Oracle database? what are the main things to do? Any private documentation or any oracle metalink note please...

    Hi
    Please find the details given below....Any body can help me on this please....
    Issue Description: The stock status report to be developed at SATN has some information that is currently calculated and stored in the Fox/pro system. A real time ODBC needs to be done to the AS/400 system to retrieve values for the respective fields. This has never been tested before as it impacts many areas.
    The DBA team need to work to establish such a relationship and a report needs to be written in Oracle to have this tested on a real time basis. Mapping needs to be developed on the Oracle side to grab the correct fields

  • How to Access DATA, Physical Flash Drive from Host machine

    Hello Everyone,
    First i am sorry for My English also if i post wrong place.
    In HyperV, I created 3 VM machines, and i want each machines can access to Data or Flash Drive from Host machine.
    THanks you so much!
    Regards
    VeasnaYim

    Hi,
    The Hyper-V forum is here:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverhyperv
    But, your question is relatively simple.  You will need to use standard Windows networking to access data from the host machine.  Depending on your version of Hyper-V, connecting to it via RDP from the host machine can use the RDP client's ability
    to access the host drives also.

  • Two computers backed up on the same Time machine disk, one computer is dead. How to access data?

    Hi guys,
    I backed up two different computers on the same time machine disk. Now, one of my computer is dead. I can see the backups on my time machine disk. How can I get the backup data that belongs to dead computer. When I enter time machine, I only have access to corresponding backup.  I do not want to  destroy the backups. My timemachine backup structure looks like below:
    -->Backups.backupdb
         -->Computer-1
         -->Computer-2
    Now, my Computer-1 is dead, and I am using Compter-2. If possible I wan to know a way of accessing Computer-1 data without destroying any other backups/files etc. Than you!

    I loathe sending people offsite for information except WRT time machine.  The late James Pond was a master at all things Time Machine related...maybe more....may he rest in peace for his contributions to ASC.
    http://pondini.org/TM/FAQ.html

  • How to access data from node of other view into node of diff view?

    Hi all,
                  My requirement is that I have account defined in 'CLEAR_HEAD' component , view is 'CLEAR_HEAD/ClearAccountsEF'
    context node is 'TARGETVALUE' and attribute is 'ACCOUNT1'. I need to access this account information in the same component but in another view 'CLEAR_HEAD/ClearAddressEL' and the context node is 'DEPLIST' and attribute is 'RADIO1'. I have one custom controller 'CLEAR_HEAD/CuCoHead'  already defined in this component. I checked the above 'TARGETVALUE' node but it is not bind to any Custom controller. And I also checked the above pre-defined custom controller  'CLEAR_HEAD/CuCoHead'  and the context node in this Custom controller is different from those of the above context nodes and the only one context node defined in this custom controller  'CLEAR_HEAD/CuCoHead' is 'LISTNODE'.
    My quesitons are
    1. How to bind the above context node(TARGETVALUE) to the custom controller. Can I bind it to the above existing custom controller  'CLEAR_HEAD/CuCoHead'  , if so then how can I do since the above custom controller doesn't contain this context node(TARGETVALUE) and it contains only  the context node 'LISTNODE'. If I can use the above existing Custom Controller then can I directly do binding by right clicking the context node(TARGETVALUE) -> Create binding. Then what should be the value in Target Contex Node?
    2. Do I need to create another custom controller If so then can I directly follow the steps defined in this link '/people/vikash.krishna/blog/2009/12/28/crm-70-how-to--5d-custom-controller-and-binding-of-context-nodes' ? If so then what should be the Model node and Bol Entity name?
    I appreciate your help..
    Thanks,
    Chinnu.

    HI Chinnu, <br />
    <br />
    Approach 1: <br />
    Bind the context node view1  TARGETVALUE with Component controller.<br />
    and in View2 <br />
    data lr_comp_controller type ref to X----component controller<br />
    lr_entity TYPE REF TO cl_crm_bol_entity.<br />
    lr_comp_controller ?= me-&gt;comp_controller.<br />
    <br />
    lr_entity ?= lr_comp_controller-&gt;typed_context-&gt;Y-&gt;collection_wrapper-&gt;get_current( ). Y---CONTExt node in view1.<br />
    <br />
    Approach 2: <br />
    Declare a static attribute in the View controller of first view.<br />
    Read the attribute D1 value from DO_PREPARE_OUTPUT of first View and pass it to the Static sttribute.<br />
    In your 2nd view u can read this Static Atribute and use it.<br />
    Static Attribute u need to call as follows . Z********IMPL(Implemantation Class)=&gt;ATTR1<br />
    <br />
    Approach 3: <br />
    Creae a custom controller with the same context node used in view 1. <br />
    Bound the custom controller context node to view 1 context node.<br />
    <br />
    Now in view 2, get the custome controller and read data from it.<br />
    <p />
    <br />
    View1 context node: BTADMINH<br />
    <p />
    Custom controller: BT115QH_SLSQ/AdminH   context node: BTADMINH_CUCO<br />
    <p />
    In view 1 context class (CTXT class), go to CREATE_BTADMINH method and append the below code to bind both the context nodes,<br />
    <pre class="jive-pre"><code class="jive-code jive-java">* bind to custom controller
       owner-&gt;do_context_node_binding(
                iv_controller_type = CL_BSP_WD_CONTROLLER=&gt;CO_TYPE_CUSTOM
                iv_name =
                <font color="navy">'BT115QH_SLSQ/AdminH'</font>                         <font color="red">&quot;#EC NOTEXT</font>
                iv_target_node_name = <font color="navy">'BTADMINH_CUCO'</font>
                iv_node_2_bind = BTADMINH ).
    Now in view 2 get the custom controller using the below code,
    Data: lr_cuco type ref to &lt;custom controller class&gt;.
    lr_cuco   ?= me-&gt;get_custom_controller( controller_id = <font color="navy">'BT115QH_SLSQ/AdminH'</font> ).
    lr_entity     = lr_cuco-&gt;typed_context-&gt;BTADMINHCUCO-&gt;collection_wrapper-&gt;get_current( ).
    </code></pre> <br />
    <p />
    If you are just reading a attribute value  from view1, then approach 2 shud b easy one. <br />
    Approach 1 & 3, more or less the same, except we are using component controller vs custom controller. These approaches holds good when the data required to be accessed/updated from either views. <br />
    <br />
    Coming to your specific scenario, I think there is already a context node available in the compoenent controller TARGETBP, which can have the required data for you. Please look into that. <br />
    <br />
    Cheers, Satish<br />
    Edited by: Satish Reddy Palyam on Aug 13, 2011 12:50 PM

  • XML Form Builder-How to access data saved from a form?

    Hi All,
    I created a form in XML Form Builder. This form include checkboxes and input fields.
    Also i include a Save button.
    I used this form in a iView.
    Many users will access this iView and save their input data.
    So, after the user Save this data, in the KM folder , is created a XML form where i can see the inputed data.
    So for every user's Save is created a XML form .
    The question is,
    how can i collect all these data for each created XML form, so as i can process them?
    Please i will appreciate if anybody has any documentation or can give me step-by step instruction .
    I am new in EP  .
    Regards
    Ari

    Hello Avinash,
    You can directly use query in form personalization Conditions like
    select date_probation_end from per_assignments_x where person_id = :PERIOD_OF_SERVICE.PERSON_ID
    and put in your condition like if you want to validate Probation end date is less then sysdate then in condition put in like.
    TRUNC(SYSDATE) < (select TRUNC(date_probation_end) from per_assignments_x where person_id = :PERIOD_OF_SERVICE.PERSON_ID)
    set the error message.
    Regards,
    Saurabh

Maybe you are looking for

  • My iPhone isn't recognized by iTunes on my Mac.

    I recently migrated to a new iMac. My iPad and old classic iPod are recognized and sycnhronizing. I de-authorized my other iMac and authorized my new one. My iPhone makes the connection beep but does not connect to iTunes. I've rebooted, hard restart

  • How do I get a driver for Deskjet D4360 to operate on Windows 7?

    I've tried down loading new drivers for my Deskjet D4360 printer on my new laptop with Windows 7 and I can't complete the down load. What am I doing wrong? The print worked great on my old laptop using XP.

  • Import multiple info records for 1 material item in repository

    Hi Guys, I have got sort of a puzzle I can not solve at the moment, maybe some one can help me to solve it. The situation in our system landscape is as follows: Systems: SRM 5.0 (Classic implementation scenario) ECC 6.0 SRM-MDM 2.0 PI 2005 Material m

  • How to Attach a Payment Method to all employees automatically?

    Dear All, I have created a Payment Method (NACHA), this payment method has to be attached to all the employees? Is there any ways, Payment Method can be attached to all employees automatically? Or we should go to each employee and attach manually?? P

  • Query related to B1DE

    Hi, I have just started using B1DE which i found to good. Now what i have done is Loaded my ".XML" form. Now i dont know where to place this function to catch all events of ".XML" form. <i>Private Sub SBO_Application_ItemEvent(ByVal FormUID As String