JVM critical exception handler changes between 1.4.2_06 and later?

The Java program I support uses a large amount of C++ code (via JNI). Our user base is large, uses Windows, and is slow to take on new JVM releases. They have been using 1.4.2_06 until last year when they started using 1.4.2_10 (and will soon update to 1.5.x).
The DLL I include with the program is built debug (/MTd) and I include the PDB file with the Java program. I used to get (w/ 1.4.2_06 and before) function and line number information when the DLL caused an exception outside the VM. Example contents of hs_pidxxx.log file below:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_INT_DIVIDE_BY_ZERO (0xc0000094) occurred at PC=0x3468CFC8
Function=QCTestDeviceHandler::StartDevice+0x98
Library=C:\dpdm2\4.3Beta2\dmLite.dll
Source file = d:\sources\datapro\dvl\wmc\datapro\sources\lib_serialio\qctestdevicehandler.cpp : 599
Current Java thread:
     at dmLite.QCTestHandler.startDevice(Native Method)
     at dmLite.QCTestHandler.startSelf(QCTestHandler.java:895)
     at dmLite.DmLite.startDataCollection(DmLite.java:4687)
     at dmLite.DpdmGUI.startDataCollection(DpdmGUI.java:1332)
     at dmLite.DpdmGUI.toggleStart(DpdmGUI.java:1394)
     at dmLite.DpdmCommand.actionPerformed(DpdmCommand.java:521)
     at java.awt.Button.processActionEvent(Unknown Source)
     at java.awt.Button.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)
With 1.4.2_10 and several 1.5 variants, I don't get function and line number information. Example contents of hs_pid_xxx.log file below (generated from the same deployed file set as above):
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_INT_DIVIDE_BY_ZERO (0xc0000094) at pc=0x0311cfc8, pid=1888, tid=1772
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing)
# Problematic frame:
# C [dmLite.dll+0x5cfc8]
--------------- T H R E A D ---------------
Current thread (0x0300f608): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=1772]
siginfo: ExceptionCode=0xc0000094
Registers:
EAX=0x00000004, EBX=0x26af9628, ECX=0x00000000, EDX=0x00000000
ESP=0x0415f678, EBP=0x0415f6d4, ESI=0x00000004, EDI=0x0300f608
EIP=0x0311cfc8, EFLAGS=0x00010246
Top of Stack: (sp=0x0415f678)
0x0415f678: 0300f608 26af9628 26af9628 0300f608
0x0415f688: 26af9628 26af9628 0300f608 26af9628
0x0415f698: 26af9628 00000002 00000001 0415f6d8
0x0415f6a8: 80000000 6d72b6dc 00000029 0415f6d8
0x0415f6b8: 6d6a5acf 00000000 6d70b51d 00236140
0x0415f6c8: 6d6bda93 00a6b54d 039c8258 0415f73c
0x0415f6d8: 0329a87a 02fa53b8 00000000 0300f608
0x0415f6e8: 26af9628 26af9628 00001528 00000000
Instructions: (pc=0x0311cfc8)
0x0311cfb8: 88 04 0a 00 00 e8 06 a1 fa ff 8b c8 8b c6 33 d2
0x0311cfc8: f7 f1 89 45 f8 8b 4d fc e8 88 6a fb ff 83 f8 01
Stack: [0x04120000,0x04160000), sp=0x0415f678, free space=253k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [dmLite.dll+0x5cfc8]
C [dmLite.dll+0x1da87a]
j dmLite.QCTestHandler.startDevice(Ljava/lang/String;)Z+0
The 1.4.2_06 feature allowed easier post-mortem diagnosis of end-user detected bugs (because the log file contained exact location of the problem). The new dump format requires me to keep map files, and hand locate the function and line number based on the offsets in the log file.
Is there any way to get function name and line number information dumped to the log file with the more recent versions?

The Java program I support uses a large amount of C++ code (via JNI). Our user base is large, uses Windows, and is slow to take on new JVM releases. They have been using 1.4.2_06 until last year when they started using 1.4.2_10 (and will soon update to 1.5.x).
The DLL I include with the program is built debug (/MTd) and I include the PDB file with the Java program. I used to get (w/ 1.4.2_06 and before) function and line number information when the DLL caused an exception outside the VM. Example contents of hs_pidxxx.log file below:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_INT_DIVIDE_BY_ZERO (0xc0000094) occurred at PC=0x3468CFC8
Function=QCTestDeviceHandler::StartDevice+0x98
Library=C:\dpdm2\4.3Beta2\dmLite.dll
Source file = d:\sources\datapro\dvl\wmc\datapro\sources\lib_serialio\qctestdevicehandler.cpp : 599
Current Java thread:
     at dmLite.QCTestHandler.startDevice(Native Method)
     at dmLite.QCTestHandler.startSelf(QCTestHandler.java:895)
     at dmLite.DmLite.startDataCollection(DmLite.java:4687)
     at dmLite.DpdmGUI.startDataCollection(DpdmGUI.java:1332)
     at dmLite.DpdmGUI.toggleStart(DpdmGUI.java:1394)
     at dmLite.DpdmCommand.actionPerformed(DpdmCommand.java:521)
     at java.awt.Button.processActionEvent(Unknown Source)
     at java.awt.Button.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)
With 1.4.2_10 and several 1.5 variants, I don't get function and line number information. Example contents of hs_pid_xxx.log file below (generated from the same deployed file set as above):
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_INT_DIVIDE_BY_ZERO (0xc0000094) at pc=0x0311cfc8, pid=1888, tid=1772
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing)
# Problematic frame:
# C [dmLite.dll+0x5cfc8]
--------------- T H R E A D ---------------
Current thread (0x0300f608): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=1772]
siginfo: ExceptionCode=0xc0000094
Registers:
EAX=0x00000004, EBX=0x26af9628, ECX=0x00000000, EDX=0x00000000
ESP=0x0415f678, EBP=0x0415f6d4, ESI=0x00000004, EDI=0x0300f608
EIP=0x0311cfc8, EFLAGS=0x00010246
Top of Stack: (sp=0x0415f678)
0x0415f678: 0300f608 26af9628 26af9628 0300f608
0x0415f688: 26af9628 26af9628 0300f608 26af9628
0x0415f698: 26af9628 00000002 00000001 0415f6d8
0x0415f6a8: 80000000 6d72b6dc 00000029 0415f6d8
0x0415f6b8: 6d6a5acf 00000000 6d70b51d 00236140
0x0415f6c8: 6d6bda93 00a6b54d 039c8258 0415f73c
0x0415f6d8: 0329a87a 02fa53b8 00000000 0300f608
0x0415f6e8: 26af9628 26af9628 00001528 00000000
Instructions: (pc=0x0311cfc8)
0x0311cfb8: 88 04 0a 00 00 e8 06 a1 fa ff 8b c8 8b c6 33 d2
0x0311cfc8: f7 f1 89 45 f8 8b 4d fc e8 88 6a fb ff 83 f8 01
Stack: [0x04120000,0x04160000), sp=0x0415f678, free space=253k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [dmLite.dll+0x5cfc8]
C [dmLite.dll+0x1da87a]
j dmLite.QCTestHandler.startDevice(Ljava/lang/String;)Z+0
The 1.4.2_06 feature allowed easier post-mortem diagnosis of end-user detected bugs (because the log file contained exact location of the problem). The new dump format requires me to keep map files, and hand locate the function and line number based on the offsets in the log file.
Is there any way to get function name and line number information dumped to the log file with the more recent versions?

Similar Messages

  • How to implement Exception Handling error in IDoc to File and RFC to File

    Hi,
    We are implementing the two below scenarios :
    1. IDOC to File
    2. RFC to File
    We have to implement the Exception Handling for the above two cases. Kindly could you provide the inputs to implement the Exception Handling for the above two cases.
    Please provide the precious inputs to implement this.
    Thanks,
    Ramesh

    Hi Ramesh,
    The exception handling for idocs
    http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7f1543d711d1893e0000e8323c4f/frameset.htm
    Exception handling in File to IDoc Scenario
    For RFCs
    Re: Passing SAP Exceptions to a sync SOAP Call
    Error Handling when using RFC
    Exception Handling while Calling RFC - BPM
    handle exceptions in remote function modules
    Regards,
    Prateek

  • What changed between 2.6.16 and 2.6.17?

    I recently acquired a laptop and installed Arch without problems via the 0.7.2 CD. This installed the 2.6.16 kernel which runs fine on the system. However, upgrading to 2.6.17 results in system hang-ups at boot no matter what I try. It always locks up at the message "ACPI: PCI Host Bridge [(some garbage I can't remember)]"
    I have the latest and greatest up-to-date Arch running fine on two desktops, but it doesn't agree with my lappy at all. Does anyone know what exactly changed between the two kernel versions that could cause this?
    P.S. I've tried everything from a custom vanilla kernel, custom Arch kernel, custom Beyond kernel, enabling and disabling everything I could think of. I've tried countless GRUB arguments (nolapic, noapic, acpi=off, acpi=noirq, nosmp, pci=nommconfig, and a bunch of other that have been suggested to me) and I've tried several combinations of hooks and modules when running mkinitcpio. Damn frustrating, it is.  :evil:

    badger wrote:
    One change with regards to ACPI and the kernel26 package was in the kernel config: changing the ACPI video component to be compiled as a module (I'm not saying this is the reason for the problem, just that this was a change). Original thread: http://bbs.archlinux.org/viewtopic.php?t=24376 and associated feature request http://bugs.archlinux.org/task/5281 I'm grateful the change was made.
    cheers
    Thanks for the lead. I'll check it out.

  • Print as Image changes between Adobe Reader ver7 and ver8+

    Hi,
    We have customers that upgraded to Adobe Reader ver8+ and are now experiencing printing issues with our printer driver (operating system is Windows XP/Vista). When they use Adobe Reader ver8 and above to print their PDF files, with "Print as Image" option selected, the print output is smaller. It looks like the latest version of Adobe Reader output the images using a square DPI. Our printer (line matrix) does not handle square DPI (for example: printer resolution are 120x48, 120x72, 120x144, and 180x96).
    Our printer driver just takes the output from the Microsoft print spooler and just encapsulate it with our printer language. We don't do any image manipulation. So, I would like to know was there a change in the way Adobe Reader version 8 and above create the output image? If so, is there a backward compatibility switch our driver can issue during the printing function?
    I tried talking to Adobe Tech support (bronze support), but they only handle end user issues. Is there a tech support option that I can purchase that will allow me to get to the root of this driver compatibility issue? Any suggestion would be appreciated.

    Adobe doesn't apparently care. I get this problem all the time on our work network. There's a lot of questions in this forum and elsewhere on the internet.
    The best answer I've seen is that there's something wrong with the PDF or you don't have the right font, or you did something wrong, or here try this ridiculously complicated workaround. I wish they would just fix their program!
    Suggestions: go through all the "standard" things like updating printer drivers, printing the document as an image, updating Adobe (yeah, like "it works now" is a new feature in the latest version), etc. It's possible that could fix the problem. Otherwise, wait until Adobe releases a version of Reader that doesn't have this issue.

  • Changes between a RAC(Objects) and NON RAC

    Hi all,
    I want to findout what all the different things to be considered when an application is made to run on RAC env.
    For eg: I found there is a difference between the way the Sequences are used in a RAC env from Non RAC.
    Are there any guidelines for the Objects used in RAC?
    Also can you point me to any doc related to tuning the interconnect as we are identifying wait events related to cluster "Cluster was consuming significant database time"
    Thanks.

    Hi hyddba,
    Absolutely, at database level for application has no changes at objects.
    At application code has changes to benefit aplications from failover TAF and FAN events.
    http://www.oracle.com/pls/db102/to_toc?pathname=rac.102%2Fb28759%2Ftoc.htm&remark=portal+%28Getting+Started%29
    Regards,
    Rodrigo Mufalani
    http://mufalani.blogspot.com

  • Tab page label color changes between 9.0.4 and 11.1.2

    In Forms 9.0.4, all of my Tab Page Labels were in a black font. When I migrated to version 11.1.2, they are now in a white font. How can I force the font on the tab page labels to be black?
    I tried setting foreground color on the Tab Page to be black, but that didn't help.
    I also tried setting a visual attribute on the Tab Page to one that had a black foreground color, but that also didn't help.
    Any suggestions will be much appreciated.

    I was able to solve the problem by changing the text color directly in the Layout Editor (with the color pickers at the bottom of the left hand toolbar), rather than using the property palette to set this.
    Edited by: cindyconlin on Mar 21, 2013 10:43 AM

  • URL rewriting format changed between WL 6.1 and WL 4.5.1

              WL 4.5.1 URL rewriting format:
              http://localhost:7001/servlet/testServlet?param1=value&jsessionid=PEahG4NSx011A7rL7wFHln8UUZrxKfBqnrJaFzrSJUFUCVUu6B9j|5623210349542547250/-2126769903/5/7001/7001/7002/7002/-1
              WL 6.1 URL rewriting format:
              http://localhost:7001/servlet/testServlet;jsessionid=PEahG4NSx011A7rL7wFHln8UUZrxKfBqnrJaFzrSJUFUCVUu6B9j|5623210349542547250/-2126769903/5/7001/7001/7002/7002/-1?param1=value
              Our applet has problems with the new format.
              Is it possible to configure the format of 6.1 to the format like in 4.5.1?
              Thanks for your help
              Michael
              

    perhaps you could implement a filter that intercepts the applet call to your
              servlet and change the url in the filter to the wl6.1 format?
              If this worked you wouldnt have to change your applet code
              "Michael Koch" <[email protected]> wrote in message
              news:[email protected]...
              >
              > The applet-problem is not a general problem with the spec. In some cases
              our applet
              > creates a URL encoded string, mean it appends the session id as a
              key/value. With
              > this changes we must change this and so a new applet must be delivered to
              our
              > customers.
              >
              > Michael
              >
              > "Eric Gross" <[email protected]> wrote:
              > >This new format is what is needed to be compliant with the spec.
              > >
              > >The spec says that the jsessionid needs to be PATH encoded, which means
              > >using the ";".
              > >
              > >How is this causing problems with your applet?
              > >
              > >Eric
              > >
              > >"Michael Koch" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> WL 4.5.1 URL rewriting format:
              > >> ------------------------------
              > >>
              >
              >http://localhost:7001/servlet/testServlet?param1=value&jsessionid=PEahG4NSx
              0
              >
              >11A7rL7wFHln8UUZrxKfBqnrJaFzrSJUFUCVUu6B9j|5623210349542547250/-2126769903/
              5
              > >/7001/7001/7002/7002/-1
              > >>
              > >> WL 6.1 URL rewriting format:
              > >> ----------------------------
              > >>
              >
              >http://localhost:7001/servlet/testServlet;jsessionid=PEahG4NSx011A7rL7wFHln
              8
              >
              >UUZrxKfBqnrJaFzrSJUFUCVUu6B9j|5623210349542547250/-2126769903/5/7001/7001/7
              0
              > >02/7002/-1?param1=value
              > >>
              > >> Our applet has problems with the new format.
              > >> Is it possible to configure the format of 6.1 to the format like in
              > >4.5.1?
              > >>
              > >> Thanks for your help
              > >> Michael
              > >
              > >
              >
              

  • PL/SQL 101 : Exception Handling

    Frequently I see questions and issues around the use of Exception/Error Handling in PL/SQL.  More often than not the issue comes from the questioners misunderstanding about how PL/SQL is constructed and executed, so I thought I'd write a small article covering the key concepts to give a clear picture of how it all hangs together. (Note: the examples are just showing examples of the exception handling structure, and should not be taken as truly valid code for ways of handling things)
    Exception Handling
    Contents
    1. Understanding Execution Blocks (part 1)
    2. Execution of the Execution Block
    3. Exceptions
    4. Understanding Execution Blocks (part 2)
    5. How to continue exection of statements after an exception
    6. User defined exceptions
    7. Line number of exception
    8. Exceptions within code within the exception block
    1. Understanding Execution Blocks (part 1)
    The first thing that one needs to understand is almost taking us back to the basics of PL/SQL... how a PL/SQL execution block is constructed.
    Essentially an execution block is made of 3 sections...
    +---------------------------+
    |    Declaration Section    |
    +---------------------------+
    |    Statements  Section    |
    +---------------------------+
    |     Exception Section     |
    +---------------------------+
    The Declaration section is the part defined between the PROCEDURE/FUNCTION header or the DECLARE keyword (for anonymous blocks) and the BEGIN keyword.  (Optional section)
    The Statements section is where your code goes and lies between the BEGIN keyword and the EXCEPTION keyword (or END keyword if there is no EXCEPTION section).  (Mandatory section)
    The Exception section is where any exception handling goes and lies between the EXCEPTION keyword at the END keyword. (Optional section)
    Example of an anonymous block...
    DECLARE
      .. declarative statements go here ..
    BEGIN
      .. code statements go here ..
    EXCEPTION
      .. exception handlers go here ..
    END;
    Example of a procedure/function block...
    [CREATE OR REPLACE] (PROCEDURE|FUNCTION) <proc or fn name> [(<parameters>)] [RETURN <datatype>] (IS|AS)
      .. declarative statements go here ..
    BEGIN
      .. code statements go here ..
    EXCEPTION
      .. exception handlers go here ..
    END;
    (Note: The same can also be done for packages, but let's keep it simple)
    2. Execution of the Execution Block
    This may seem a simple concept, but it's surprising how many people have issues showing they haven't grasped it.  When an Execution block is entered, the declaration section is processed, creating a scope of variables, types , cursors, etc. to be visible to the execution block and then execution enters into the Statements section.  Each statment in the statements section is executed in turn and when the execution completes the last statment the execution block is exited back to whatever called it.
    3. Exceptions
    Exceptions generally happen during the execution of statements in the Statements section.  When an exception happens the execution of statements jumps immediately into the exception section.  In this section we can specify what exceptions we wish to 'capture' or 'trap' and do one of the two following things...
    (Note: The exception section still has access to all the declared items in the declaration section)
    3.i) Handle the exception
    We do this when we recognise what the exception is (most likely it's something we expect to happen) and we have a means of dealing with it so that our application can continue on.
    Example...
    (without the exception handler the exception is passed back to the calling code, in this case SQL*Plus)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3  begin
      4    select ename
      5    into   v_name
      6    from   emp
      7    where  empno = &empno;
      8    dbms_output.put_line(v_name);
      9* end;
    SQL> /
    Enter value for empno: 123
    old   7:   where  empno = &empno;
    new   7:   where  empno = 123;
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 4
    (with an exception handler, we capture the exception, handle it how we want to, and the calling code is happy that there is no error for it to report)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3  begin
      4    select ename
      5    into   v_name
      6    from   emp
      7    where  empno = &empno;
      8    dbms_output.put_line(v_name);
      9  exception
    10    when no_data_found then
    11      dbms_output.put_line('There is no employee with this employee number.');
    12* end;
    SQL> /
    Enter value for empno: 123
    old   7:   where  empno = &empno;
    new   7:   where  empno = 123;
    There is no employee with this employee number.
    PL/SQL procedure successfully completed.
    3.ii) Raise the exception
    We do this when:-
    a) we recognise the exception, handle it but still want to let the calling code know that it happened
    b) we recognise the exception, wish to log it happened and then let the calling code deal with it
    c) we don't recognise the exception and we want the calling code to deal with it
    Example of b)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3    v_empno NUMBER := &empno;
      4  begin
      5    select ename
      6    into   v_name
      7    from   emp
      8    where  empno = v_empno;
      9    dbms_output.put_line(v_name);
    10  EXCEPTION
    11    WHEN no_data_found THEN
    12      INSERT INTO sql_errors (txt)
    13      VALUES ('Search for '||v_empno||' failed.');
    14      COMMIT;
    15      RAISE;
    16* end;
    SQL> /
    Enter value for empno: 123
    old   3:   v_empno NUMBER := &empno;
    new   3:   v_empno NUMBER := 123;
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 15
    SQL> select * from sql_errors;
    TXT
    Search for 123 failed.
    SQL>
    Example of c)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3    v_empno NUMBER := &empno;
      4  begin
      5    select ename
      6    into   v_name
      7    from   emp
      8    where  empno = v_empno;
      9    dbms_output.put_line(v_name);
    10  EXCEPTION
    11    WHEN no_data_found THEN
    12      INSERT INTO sql_errors (txt)
    13      VALUES ('Search for '||v_empno||' failed.');
    14      COMMIT;
    15      RAISE;
    16    WHEN others THEN
    17      RAISE;
    18* end;
    SQL> /
    Enter value for empno: 'ABC'
    old   3:   v_empno NUMBER := &empno;
    new   3:   v_empno NUMBER := 'ABC';
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 3
    SQL> select * from sql_errors;
    TXT
    Search for 123 failed.
    SQL>
    As you can see from the sql_errors log table, no log was written so the WHEN others exception was the exception that raised the error to the calling code (SQL*Plus)
    4. Understanding Execution Blocks (part 2)
    Ok, so now we understand the very basics of an execution block and what happens when an exception happens.  Let's take it a step further...
    Execution blocks are not just a single simple block in most cases.  Often, during our statements section we have a need to call some reusable code and we do that by calling a procedure or function.  Effectively this nests the procedure or function's code as another execution block within the current statement section so, in terms of execution, we end up with something like...
    +---------------------------------+
    |    Declaration Section          |
    +---------------------------------+
    |    Statements  Section          |
    |            .                    |
    |  +---------------------------+  |
    |  |    Declaration Section    |  |
    |  +---------------------------+  |
    |  |    Statements  Section    |  |
    |  +---------------------------+  |
    |  |     Exception Section     |  |
    |  +---------------------------+  |
    |            .                    |
    +---------------------------------+
    |     Exception Section           |
    +---------------------------------+
    Example... (Note: log_trace just writes some text to a table for tracing)
    SQL> create or replace procedure a as
      2    v_dummy NUMBER := log_trace('Procedure A''s Declaration Section');
      3  begin
      4    v_dummy := log_trace('Procedure A''s Statement Section');
      5    v_dummy := 1/0; -- cause an exception
      6  exception
      7    when others then
      8      v_dummy := log_trace('Procedure A''s Exception Section');
      9      raise;
    10  end;
    11  /
    Procedure created.
    SQL> create or replace procedure b as
      2    v_dummy NUMBER := log_trace('Procedure B''s Declaration Section');
      3  begin
      4    v_dummy := log_trace('Procedure B''s Statement Section');
      5    a; -- HERE the execution passes to the declare/statement/exception sections of A
      6  exception
      7    when others then
      8      v_dummy := log_trace('Procedure B''s Exception Section');
      9      raise;
    10  end;
    11  /
    Procedure created.
    SQL> exec b;
    BEGIN b; END;
    ERROR at line 1:
    ORA-01476: divisor is equal to zero
    ORA-06512: at "SCOTT.B", line 9
    ORA-06512: at line 1
    SQL> select * from code_trace;
    TXT
    Procedure B's Declaration Section
    Procedure B's Statement Section
    Procedure A's Declaration Section
    Procedure A's Statement Section
    Procedure A's Exception Section
    Procedure B's Exception Section
    6 rows selected.
    SQL>
    Likewise, execution blocks can be nested deeper and deeper.
    5. How to continue exection of statements after an exception
    One of the common questions asked is how to return execution to the statement after the one that created the exception and continue on.
    Well, firstly, you can only do this for statements you expect to raise an exception, such as when you want to check if there is no data found in a query.
    If you consider what's been shown above you could put any statement you expect to cause an exception inside it's own procedure or function with it's own exception section to handle the exception without raising it back to the calling code.  However, the nature of procedures and functions is really to provide a means of re-using code, so if it's a statement you only use once it seems a little silly to go creating individual procedures for these.
    Instead, you nest execution blocks directly, to give the same result as shown in the diagram at the start of part 4 of this article.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure b (p_empno IN VARCHAR2) as
      2    v_dummy NUMBER := log_trace('Procedure B''s Declaration Section');
      3  begin
      4    v_dummy := log_trace('Procedure B''s Statement Section');
      5    -- Here we start another execution block nested in the first one...
      6    declare
      7      v_dummy NUMBER := log_trace('Nested Block Declaration Section');
      8    begin
      9      v_dummy := log_trace('Nested Block Statement Section');
    10      select empno
    11        into   v_dummy
    12        from   emp
    13       where  empno = p_empno; -- Note: the parameters and variables from
                                         parent execution block are available to use!
    14    exception
    15      when no_data_found then
    16        -- This is an exception we can handle so we don't raise it
    17        v_dummy := log_trace('No employee was found');
    18        v_dummy := log_trace('Nested Block Exception Section - Exception Handled');
    19      when others then
    20        -- Other exceptions we can't handle so we raise them
    21        v_dummy := log_trace('Nested Block Exception Section - Exception Raised');
    22        raise;
    23    end;
    24    -- ...Here endeth the nested execution block
    25    -- As the nested block handled it's exception we come back to here...
    26    v_dummy := log_trace('Procedure B''s Statement Section Continued');
    27  exception
    28    when others then
    29      -- We'll only get to here if an unhandled exception was raised
    30      -- either in the nested block or in procedure b's statement section
    31      v_dummy := log_trace('Procedure B''s Exception Section');
    32      raise;
    33* end;
    SQL> /
    Procedure created.
    SQL> exec b(123);
    PL/SQL procedure successfully completed.
    SQL> select * from code_trace;
    TXT
    Procedure B's Declaration Section
    Procedure B's Statement Section
    Nested Block Declaration Section
    Nested Block Statement Section
    No employee was found
    Nested Block Exception Section - Exception Handled
    Procedure B's Statement Section Continued
    7 rows selected.
    SQL> truncate table code_trace;
    Table truncated.
    SQL> exec b('ABC');
    BEGIN b('ABC'); END;
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at "SCOTT.B", line 32
    ORA-06512: at line 1
    SQL> select * from code_trace;
    TXT
    Procedure B's Declaration Section
    Procedure B's Statement Section
    Nested Block Declaration Section
    Nested Block Statement Section
    Nested Block Exception Section - Exception Raised
    Procedure B's Exception Section
    6 rows selected.
    SQL>
    You can see from this that, very simply, the code that we expected may have an exception was able to either handle the exception and return to the outer execution block to continue execution, or if an unexpected exception occurred then it was able to be raised up to the outer exception section.
    6. User defined exceptions
    There are three sorts of 'User Defined' exceptions.  There are logical situations (e.g. business logic) where, for example, certain criteria are not met to complete a task, and there are existing Oracle errors that you wish to give a name to in order to capture them in the exception section.  The third is raising your own exception messages with our own exception numbers.  Let's look at the first one...
    Let's say I have tables which detail stock availablility and reorder levels...
    SQL> select * from reorder_level;
       ITEM_ID STOCK_LEVEL
             1          20
             2          20
             3          10
             4           2
             5           2
    SQL> select * from stock;
       ITEM_ID ITEM_DESC  STOCK_LEVEL
             1 Pencils             10
             2 Pens                 2
             3 Notepads            25
             4 Stapler              5
             5 Hole Punch           3
    SQL>
    Now, our Business has told the administrative clerk to check stock levels and re-order anything that is below the re-order level, but not to hold stock of more than 4 times the re-order level for any particular item.  As an IT department we've been asked to put together an application that will automatically produce the re-order documents upon the clerks request and, because our company is so tight-ar*ed about money, they don't want to waste any paper with incorrect printouts so we have to ensure the clerk can't order things they shouldn't.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6      from stock s join reorder_level r on (s.item_id = r.item_id)
      7      where s.item_id = p_item_id;
      8    --
      9    v_stock cur_stock_reorder%ROWTYPE;
    10  begin
    11    OPEN cur_stock_reorder;
    12    FETCH cur_stock_reorder INTO v_stock;
    13    IF cur_stock_reorder%NOTFOUND THEN
    14      RAISE no_data_found;
    15    END IF;
    16    CLOSE cur_stock_reorder;
    17    --
    18    IF v_stock.stock_level >= v_stock.reorder_level THEN
    19      -- Stock is not low enough to warrant an order
    20      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    21    ELSE
    22      IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    23        -- Required amount is over-ordering
    24        DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                     ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    25      ELSE
    26        DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    27        -- Here goes our code to print the order
    28      END IF;
    29    END IF;
    30    --
    31  exception
    32    WHEN no_data_found THEN
    33      CLOSE cur_stock_reorder;
    34      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    35* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(10,100);
    Invalid Item ID.
    PL/SQL procedure successfully completed.
    SQL> exec re_order(3,40);
    Stock has not reached re-order level yet!
    PL/SQL procedure successfully completed.
    SQL> exec re_order(1,100);
    Quantity specified is too much.  Max for this item: 70
    PL/SQL procedure successfully completed.
    SQL> exec re_order(2,50);
    Order OK.  Printing Order...
    PL/SQL procedure successfully completed.
    SQL>
    Ok, so that code works, but it's a bit messy with all those nested IF statements. Is there a cleaner way perhaps?  Wouldn't it be nice if we could set up our own exceptions...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6      from stock s join reorder_level r on (s.item_id = r.item_id)
      7      where s.item_id = p_item_id;
      8    --
      9    v_stock cur_stock_reorder%ROWTYPE;
    10    --
    11    -- Let's declare our own exceptions for business logic...
    12    exc_not_warranted EXCEPTION;
    13    exc_too_much      EXCEPTION;
    14  begin
    15    OPEN cur_stock_reorder;
    16    FETCH cur_stock_reorder INTO v_stock;
    17    IF cur_stock_reorder%NOTFOUND THEN
    18      RAISE no_data_found;
    19    END IF;
    20    CLOSE cur_stock_reorder;
    21    --
    22    IF v_stock.stock_level >= v_stock.reorder_level THEN
    23      -- Stock is not low enough to warrant an order
    24      RAISE exc_not_warranted;
    25    END IF;
    26    --
    27    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    28      -- Required amount is over-ordering
    29      RAISE exc_too_much;
    30    END IF;
    31    --
    32    DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    33    -- Here goes our code to print the order
    34    --
    35  exception
    36    WHEN no_data_found THEN
    37      CLOSE cur_stock_reorder;
    38      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    39    WHEN exc_not_warranted THEN
    40      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    41    WHEN exc_too_much THEN
    42      DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                  ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    43* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(10,100);
    Invalid Item ID.
    PL/SQL procedure successfully completed.
    SQL> exec re_order(3,40);
    Stock has not reached re-order level yet!
    PL/SQL procedure successfully completed.
    SQL> exec re_order(1,100);
    Quantity specified is too much.  Max for this item: 70
    PL/SQL procedure successfully completed.
    SQL> exec re_order(2,50);
    Order OK.  Printing Order...
    PL/SQL procedure successfully completed.
    SQL>
    That's better.  And now we don't have to use all those nested IF statements and worry about it accidently getting to code that will print the order out as, once one of our user defined exceptions is raised, execution goes from the Statements section into the Exception section and all handling of errors is done in one place.
    Now for the second sort of user defined exception...
    A new requirement has come in from the Finance department who want to have details shown on the order that show a re-order 'indicator' based on the formula ((maximum allowed stock - current stock)/re-order quantity), so this needs calculating and passing to the report...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6            ,(((r.stock_level*4)-s.stock_level)/p_quantity) as finance_factor
      7      from stock s join reorder_level r on (s.item_id = r.item_id)
      8      where s.item_id = p_item_id;
      9    --
    10    v_stock cur_stock_reorder%ROWTYPE;
    11    --
    12    -- Let's declare our own exceptions for business logic...
    13    exc_not_warranted EXCEPTION;
    14    exc_too_much      EXCEPTION;
    15  begin
    16    OPEN cur_stock_reorder;
    17    FETCH cur_stock_reorder INTO v_stock;
    18    IF cur_stock_reorder%NOTFOUND THEN
    19      RAISE no_data_found;
    20    END IF;
    21    CLOSE cur_stock_reorder;
    22    --
    23    IF v_stock.stock_level >= v_stock.reorder_level THEN
    24      -- Stock is not low enough to warrant an order
    25      RAISE exc_not_warranted;
    26    END IF;
    27    --
    28    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    29      -- Required amount is over-ordering
    30      RAISE exc_too_much;
    31    END IF;
    32    --
    33    DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    34    -- Here goes our code to print the order, passing the finance_factor
    35    --
    36  exception
    37    WHEN no_data_found THEN
    38      CLOSE cur_stock_reorder;
    39      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    40    WHEN exc_not_warranted THEN
    41      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    42    WHEN exc_too_much THEN
    43      DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                  ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    44* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(2,40);
    Order OK.  Printing Order...
    PL/SQL procedure successfully completed.
    SQL> exec re_order(2,0);
    BEGIN re_order(2,0); END;
    ERROR at line 1:
    ORA-01476: divisor is equal to zero
    ORA-06512: at "SCOTT.RE_ORDER", line 17
    ORA-06512: at line 1
    SQL>
    Hmm, there's a problem if the person specifies a re-order quantity of zero.  It raises an unhandled exception.
    Well, we could put a condition/check into our code to make sure the parameter is not zero, but again we would be wrapping our code in an IF statement and not dealing with the exception in the exception handler.
    We could do as we did before and just include a simple IF statement to check the value and raise our own user defined exception but, in this instance the error is standard Oracle error (ORA-01476) so we should be able to capture it inside the exception handler anyway... however...
    EXCEPTION
      WHEN ORA-01476 THEN
    ... is not valid.  What we need is to give this Oracle error a name.
    This is done by declaring a user defined exception as we did before and then associating that name with the error number using the PRAGMA EXCEPTION_INIT statement in the declaration section.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6            ,(((r.stock_level*4)-s.stock_level)/p_quantity) as finance_factor
      7      from stock s join reorder_level r on (s.item_id = r.item_id)
      8      where s.item_id = p_item_id;
      9    --
    10    v_stock cur_stock_reorder%ROWTYPE;
    11    --
    12    -- Let's declare our own exceptions for business logic...
    13    exc_not_warranted EXCEPTION;
    14    exc_too_much      EXCEPTION;
    15    --
    16    exc_zero_quantity EXCEPTION;
    17    PRAGMA EXCEPTION_INIT(exc_zero_quantity, -1476);
    18  begin
    19    OPEN cur_stock_reorder;
    20    FETCH cur_stock_reorder INTO v_stock;
    21    IF cur_stock_reorder%NOTFOUND THEN
    22      RAISE no_data_found;
    23    END IF;
    24    CLOSE cur_stock_reorder;
    25    --
    26    IF v_stock.stock_level >= v_stock.reorder_level THEN
    27      -- Stock is not low enough to warrant an order
    28      RAISE exc_not_warranted;
    29    END IF;
    30    --
    31    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    32      -- Required amount is over-ordering
    33      RAISE exc_too_much;
    34    END IF;
    35    --
    36    DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    37    -- Here goes our code to print the order, passing the finance_factor
    38    --
    39  exception
    40    WHEN exc_zero_quantity THEN
    41      DBMS_OUTPUT.PUT_LINE('Quantity of 0 (zero) is invalid.');
    42    WHEN no_data_found THEN
    43      CLOSE cur_stock_reorder;
    44      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    45    WHEN exc_not_warranted THEN
    46      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    47    WHEN exc_too_much THEN
    48      DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                  ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    49* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(2,0);
    Quantity of 0 (zero) is invalid.
    PL/SQL procedure successfully completed.
    SQL>
    Lastly, let's look at raising our own exceptions with our own exception numbers...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6            ,(((r.stock_level*4)-s.stock_level)/p_quantity) as finance_factor
      7      from stock s join reorder_level r on (s.item_id = r.item_id)
      8      where s.item_id = p_item_id;
      9    --
    10    v_stock cur_stock_reorder%ROWTYPE;
    11    --
    12    exc_zero_quantity EXCEPTION;
    13    PRAGMA EXCEPTION_INIT(exc_zero_quantity, -1476);
    14  begin
    15    OPEN cur_stock_reorder;
    16    FETCH cur_stock_reorder INTO v_stock;
    17    IF cur_stock_reorder%NOTFOUND THEN
    18      RAISE no_data_found;
    19    END IF;
    20    CLOSE cur_stock_reorder;
    21    --
    22    IF v_stock.stock_level >= v_stock.reorder_level THEN
    23      -- Stock is not low enough to warrant an order
    24      [b]RAISE_APPLICATION_ERROR(-20000, 'Stock has not reached re-order level yet!');[/b]
    25    END IF;
    26    --
    27    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    28      -- Required amount is over-ordering
    29     

    its nice article, have put up this one the blog
    site,Nah, I don't have time to blog, but if one of the other Ace's/Experts wants to copy it to a blog with reference back to here (and all due credit given ;)) then that's fine by me.
    I'd go for a book like "Selected articles by OTN members" or something. Does anybody have a list of links of all those mentioned articles?Just these ones I've bookmarked...
    Introduction to regular expressions ... by CD
    When your query takes too long ... by Rob van Wijk
    How to pipeline a function with a dynamic number of columns? by ascheffer
    PL/SQL 101 : Exception Handling by BluShadow

  • Exception Handling Problem In BPM

    All
    I am facing an exception handling problem I am using BPM and , I have caught exception in the transformation step but when there is any data problem in that mapping(mentioned in the transformation)
    it is not throwing the exception . is there any option to collect these type of system exception in  the bpm and give a alert thru mail
    is there any way to collect these type of exception happened in the BPE and raise alert thru generic alert
    Thanks
    Jayaraman

    Hi Jayaraman,
        When you say there is any data problem, does that fail the message mapping that you have defined?
    If the message mapping used in the tranformation fails, it should raise an exception in the BPM.
    Did you test the message mapping using the payload and see if it really fails or not?
    Regards,
    Ravi Kanth Talagana

  • Exception Handling for Array Binding

    Hi
    1)
    I am using a Stored Procedure.
    I am using array binding and if i am sending an array of count 10 to be inserted in a table and only 9 got inserted,i deliberatly inserted one errorneous record in array, the count returned by ExecuteNonQuery() is 10.Why ?
    How can i come to know exact number of rows inserted in table, how can i use Output variables, because the array bind count is 10 so if i add an output parameter it gives error ArrayBind count is wrong....
    2)
    Is it possible to roll back all the inserts if error occurs in any of the insert by Oracle engine.What it does is it inserts all correct records and leaves the errorneous record and doesn't even throw any exception or any message.
    Answer - This can be achieved by using OracleTransaction and don't use Exception handling in procedure otherwise there wont be any exception thrown by procedure which is necessary to detect if an error occured during insert.If you use exception handling OracleEngine will insert correct rows and leave errorneous record and return count of inserted + non inserted records which is wrong.
    Please help.
    Message was edited by:
    user556446
    Message was edited by:
    user556446

    You'll need to encapsulate your validation within it's own block as described below:
    -- this will die on the first exception
    declare
      TYPE T_BADDATA_TEST IS TABLE OF VARCHAR2(1000) INDEX BY binary_integer ;
      tbt T_BADDATA_TEST ;
      aBadTypeFound exception ;
    begin
       tbt(0) := 'a';
       tbt(1) := 'b';
       tbt(2) := 'c';
        for idx in tbt.first..tbt.last loop
          if tbt(idx) =  'b' then
              raise aBadTypeFound ;     
          else
              dbms_output.put_line(tbt(idx));     
          end if  ;
        end loop ;
    end ;--encapsulate the exception area in a begin/end block to handle the exception but continue on
    declare
      TYPE T_BADDATA_TEST IS TABLE OF VARCHAR2(1000) INDEX BY binary_integer ;
      tbt T_BADDATA_TEST ;
      aBadTypeFound exception ;
    begin
       tbt(0) := 'a';
       tbt(1) := 'b';
       tbt(2) := 'c';
        for idx in tbt.first..tbt.last loop
          BEGIN
          if tbt(idx) =  'b' then
              raise aBadTypeFound ;     
          else
              dbms_output.put_line(tbt(idx));     
          end if  ;
          EXCEPTION
            WHEN aBadTypeFound THEN
                dbms_output.put_line(tbt(idx) || ' is bad data');       
            WHEN OTHERS THEN
                dbms_output.put_line('exception');       
          END ;
        end loop ;
    end ;
    output:
    a
    b is bad data
    c
    ***/

  • Color changes between library/develop and web module

    Hi there,
    when changing between modules library/develop and web the color of the pictures changes. That means, pictures become darker and the red/orange colors become more intensive. Back to the library, everything is o.k. Webgaleries also change, but not normal exports.
    Until yesterday everything worked wonderful, but then I updated from 3.0 to 3.3 and now there´s no more WISYWYG for the webgaleries!
    Somedbody out ther who can help?
    Thank´s,  Tom

    First up, Develop is the most current preview. Library previews depend on the preview settings and if they've been zoomed into recently. Web exports sRGB Jpegs and I believe the webcache files that are generated for preview are also. If you're using a Flash Gallery, then there is no colour management happening.
    Is your monitor calibrated?

  • Query to calculate chg & precent change between current record & record b4

    Greetings SQL Guru's
    I know that Oracle has analitical functions that can produce the results I need.
    I have a view that will return four rows. I need to find the change and precent change between
    the current number and the number before it.
    The following is a example:
    Year     EndOfYearRSF      ProjectedRent      Change           %change
    2006     70000             1179226         -                    -
    2007     75000             491015     -688210               41%
    2008     80000             1188947     697931               42%
    2009     90000             198502     9554                  .6%
    [pre]
    The operation is being performed on the ProjectedRent Column. I'm currently using Oracle 9.2
    Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    may be somthing like this
    1  WITH t AS (SELECT 2006     year,70000 EOFYear,     1179226  rent from dual
    2               union all
    3               SELECT 2007   year,75000 EOFYear, 491015 rent from dual
    4               union all
    5               SELECT 2008   year,80000 EOFYear, 1188947  rent from dual
    6               union all
    7               SELECT 2009   year,90000 EOFYear, 198502  rent from dual)
    8   select year,EOFYear,rent,rent-lag(rent,1,null)over(order by year )Change
    9*  from t
    10  /
         YEAR    EOFYEAR       RENT     CHANGE
         2006      70000    1179226
         2007      75000     491015    -688211
         2008      80000    1188947     697932
         2009      90000     198502    -990445

  • Very simple exception handling

    I know next to nothing about exceptions, I am still only in 3rd week of class, but I already ran into one.
    I was using the Scanner Class, and the nextInt() function (method ?) to get some numbers to do simple math on. Program worked fine. But if I put a letter in when it asks for a number, it crashs to commandline with exception error. I just added text that told the user only to put in the right var type. Integers in this case. How would I make an exception handler ? is that right, exception handler ? that would simply say "wrong data type, please reenter", then ask again ? or something ?
    Getting used to the forum here, bit different than I'm used to. Hope my question was clear.

    ok, I scanned through all and read thoroughly some of that. I have been working my way through the series as I can. we will be covering this in some detail later in the semester. That article (chapter?) is great, but it is too broad for me right now, I will post some code, and add some comments that try to do some of what I got from that article.
    This is a stupid hello world type thing idid, we had worked with Scanner nextInt(), but not Scanner next, so I looked up how to get strings on my own... first week first prog i did anything on besides follow along :)
    // Java Document
    import java.util.Scanner; // uses Scanner Class
    public class sparkle     //main method
         public static void main( String args[] )
              Scanner input = new Scanner( System.in );
              String  name;
    //so here I would add a try statement ?
              System.out.print( "Enter Your Name:" );
              name = input.next();
              // and end it here ?
              System.out.printf( "%s\t%s\t%s\n\t\t%s",
              "***", "Java Programming!", "***", name);
    // then I would put a catch here ? that tested to see if it was a string ?
    //and if not then what ?
    }maybe that is a bad example... I get that you have to wrap a block of code in a try statement, then you put catch statements, that see if the can do something about watever exception it is, but what do they do, the examples in that article use stuff way past where I am now... libraries I'm not familiar with to know what is happening. What does finally do ? what should happen instead, or what should happen either way ? I will go over more of that article, but most of it is meant to be read after I am further along... I think I am getting the basics though. Do I seem to be on the right track..?
    I will post some more code about this later, I really don't expect to solve this overnight, but i know good exception handling hardens a program to faults, and provides stability. So I want to get a grasp of what to expect now. really, we wont be covering this in class for another month or two... but I want to prepare now, so I will be programming well by then.
    Edited by: lord_midnight on Feb 15, 2008 4:02 PM

  • Changes between V:3 & V:4

    Is there a page somewhere within the mozilla.com site that lists the changes between Firefox V:3 and V:4?
    It seemed like a obvious thing to list somewhere with all the videos pushing the new and improved version of Firefox, but I haven't found it anywhere.

    Well, if that is all that is available, so be it.
    But I had already seen that Features page, and it lists all (or at least, most) of the features in Firefox, regardless of when they were added.
    For example, the first thing the Feature page lists is that self-proclaimed 'AweSome' Bar from version three.

  • Generic Exception Handler/Listener

    All,
    I have a web application and I want to create a generic exception handler/listener which will listen to all the exception(checked and runtime) which are thrown by web application.
    Any idea how can I do this?
    Regards.

    797836 wrote:
    Hi,
    I want to build a generic exception handler which can be reused in any java j2ee applications. Unlikely. Probably impossible.
    I have java application which is communicating with other 3rd party applications like webservices, webmethods , etc from where we are getting an errorcode which will be used in our java application to do a lookup to get the respestive error message from the resource bundle. Please clarify in such case how I can go with a generic exception handler which will be build separately and will be integrated with Java applications to handle the exceptions and errors.An excellent example of why a universal exception handler wouldn't work.
    At some point a call tree looks like A->B->C, where C (or beyond) that is where your communications problem occurs. The impact of that depends on the application.
    For example if a user types in a url (at A) and the server (C) fails to resolve it then that is a user problem.
    However if nightly batch process expects to download an update file every night from one location and it can't connect then that is an operations error (or notification/alert.)

Maybe you are looking for

  • Synchronizing photo corrections to multiple back-ups in Lightroom 5

    Hi, I have backed up my images on three different external Hard drives, and have "ADDED" each to the Lightroom catalogue so that I can access the images from any of the Hard drives.  I make most of my image corrections and adjustments using  my main

  • Outlook '07 Doesn't Open PDF Links

    I am running Outlook 2007 on Windows XP Pro. I have also got Adobe 9.1 Reader and the latest Adobe Flash installed. If I receive a link to a PDF in Outlook and I double click it tries to open the file in IE8, even then it come back with a blank grey

  • Is style sheet in XSQL cached?

    My question is whether the style sheet used by xsql file is cached. There are several times that after I made some changes to the style sheet that included in xsql file and reloaded the xsql file, the browser didn't reflect the change at all until I

  • Is my mic broken? Or is it a technology problem?

    My phone's speaker phone has stopped working. The other day I noticed that when I recorded a video...there was no sound. My phone works fine when talk on it regular. I've had the same phone for about 13 months now.

  • Are volume manager commands available inside non-global zones

    My application requires usage of volume manager commands to create new filesystem, expand an existing file system inside the non-global zone. Is this supported? Or the only option is to create filesystem in global zone and assign to non-global zones?