FORALL Exception handling problem

Hi All,
I have one doubt in forall exception handling. I have gone through the SAVE EXCEPTION for bulk collect but i have one more query
BEGIN
FORALL j IN l_tab.first .. l_tab.last
INSERT INTO exception_test
VALUES (l_tab(i));
EXCEPTION
END;
My requirement is when an exception occurs, i ant to print the values of the collection.
e.g. say l_tab (j).emp_number, l_tab (j).emp_id.
How is that possible?
Thanks
Samarth
Edited by: 950810 on Mar 12, 2013 7:28 PM

>
I have one doubt in forall exception handling. I have gone through the SAVE EXCEPTION for bulk collect but i have one more query
BEGIN
FORALL j IN l_tab.first .. l_tab.last
INSERT INTO exception_test
VALUES (l_tab(i));
EXCEPTION
END;
My requirement is when an exception occurs, i ant to print the values of the collection.
e.g. say l_tab (j).emp_number, l_tab (j).emp_id.
How is that possible?
>
Post the code you are using. You didn't post the FORALL that is using SAVE EXCEPTIONS.
The SQL%BULK_EXCEPTIONS associative array that you get has the INDEX of the collection element that caused the exception.
So you need to use those indexes to index into the original collection to get whatever values are in it.
One index from the exception array is:
SQL%BULK_EXCEPTIONS(i).error_index So if your original collection is named 'myCollection' you would reference that collection value as:
myCollection(SQL%BULK_EXCEPTIONS(i).error_index); See 'Handling FORALL Exceptions (%BULK_EXCEPTIONS Attribute)' in the PL/SQL Language doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/tuning.htm#i49099
>
All exceptions raised during the execution are saved in the cursor attribute %BULK_EXCEPTIONS, which stores a collection of records. Each record has two fields:
%BULK_EXCEPTIONS(i).ERROR_INDEX holds the iteration of the FORALL statement during which the exception was raised.
%BULK_EXCEPTIONS(i).ERROR_CODE holds the corresponding Oracle Database error code.
The values stored by %BULK_EXCEPTIONS always refer to the most recently executed FORALL statement. The number of exceptions is saved in %BULK_EXCEPTIONS.COUNT. Its subscripts range from 1 to COUNT.
The individual error messages, or any substitution arguments, are not saved, but the error message text can looked up using ERROR_CODE with SQLERRM as shown in Example 12-9.
You might need to work backward to determine which collection element was used in the iteration that caused an exception. For example, if you use the INDICES OF clause to process a sparse collection, you must step through the elements one by one to find the one corresponding to %BULK_EXCEPTIONS(i).ERROR_INDEX. If you use the VALUES OF clause to process a subset of elements, you must find the element in the index collection whose subscript matches %BULK_EXCEPTIONS(i).ERROR_INDEX, and then use that element's value as the subscript to find the erroneous element in the original collection.

Similar Messages

  • 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

  • Pls help..Constructor,setter, getter and Exception Handling Problem

    halo, im new in java who learning basic thing and java.awt basic...i face some problem about constructor, setter, and getter.
    1. I created a constructor, setter and getter in a file, and create another test file which would like to get the value from the constructor file.
    The problem is: when i compile the test file, it come out error msg:cannot find symbol.As i know that is because i miss declare something but i dont know what i miss.I post my code here and help me to solve this problem...thanks
    my constructor file...i dont know whether is correct, pls tell me if i miss something...
    public class Employee{
         private int empNum;
         private String empName;
         private double empSalary;
         Employee(){
              empNum=0;
              empName="";
              empSalary=0;
         public int getEmpNum(){
              return empNum;
         public String getName(){
              return empName;
         public double getSalary(){
              return empSalary;
         public void setEmpNum(int e){
              empNum = e;
         public void setName(String n){
              empName = n;
         public void setSalary(double sal){
              empSalary = sal;
    my test file....
    public class TestEmployeeClass{
         public static void main(String args[]){
              Employee e = new Employee();
                   e.setEmpNum(100);
                   e.setName("abc");
                   e.setSalary(1000.00);
                   System.out.println(e.getEmpNum());
                   System.out.println(e.getName());
                   System.out.println(e.getSalary());
    }**the program is work if i combine this 2 files coding inside one file(something like the last part of my coding of problem 2)...but i would like to separate them....*
    2. Another problem is i am writing one simple program which is using java.awt interface....i would like to add a validation for user input (something like show error msg when user input character and negative number) inside public void actionPerformed(ActionEvent e) ...but i dont have any idea to solve this problem.here is my code and pls help me for some suggestion or coding about exception. thank a lots...
    import java.awt.*;
    import java.awt.event.*;
    public class SnailTravel extends Frame implements ActionListener, WindowListener{
       private Frame frame;
       private Label lblDistance, lblSpeed, lblSpeed2, lblTime, lblTime2, lblComment, lblComment2 ;
       private TextField tfDistance;
       private Button btnCalculate, btnClear;
       public void viewInterface(){
          frame = new Frame("Snail Travel");
          lblDistance = new Label("Distance");
          lblSpeed = new Label("Speed");
          lblSpeed2 = new Label("0.0099km/h");
          lblTime = new Label("Time");
          lblTime2 = new Label("");
          lblComment = new Label("Comment");
          lblComment2 = new Label("");
          tfDistance = new TextField(20);
          btnCalculate = new Button("Calculate");
          btnClear = new Button("Clear");
          frame.setLayout(new GridLayout(5,2));
          frame.add(lblDistance);
          frame.add(tfDistance);
          frame.add(lblSpeed);
          frame.add(lblSpeed2);
          frame.add(lblTime);
          frame.add(lblTime2);
          frame.add(lblComment);
          frame.add(lblComment2);
          frame.add(btnCalculate);
          frame.add(btnClear);
          btnCalculate.addActionListener(this);
          btnClear.addActionListener(this);
          frame.addWindowListener(this);
          frame.setSize(100,100);
          frame.setVisible(true);
          frame.pack();     
        public static void main(String [] args) {
            SnailTravel st = new SnailTravel();
            st.viewInterface();
        public void actionPerformed(ActionEvent e) {
           if (e.getSource() == btnCalculate){
              SnailData sd = new SnailData();
           double distance = Double.parseDouble(tfDistance.getText());
           sd.setDistance(distance);
                  sd.setSpeed(0.0099);
              sd.setTime(distance/sd.getSpeed());
              String answer = Double.toString(sd.getTime());
              lblTime2.setText(answer);
              lblComment2.setText("But No Exception!!!");
           else
           if(e.getSource() == btnClear){
              tfDistance.setText("");
              lblTime2.setText("");
       public void windowClosing(WindowEvent e){
                   System.exit(1);
        public void windowClosed (WindowEvent e) { };
        public void windowDeiconified (WindowEvent e) { };
        public void windowIconified (WindowEvent e) { };
        public void windowActivated (WindowEvent e) { };
        public void windowDeactivated (WindowEvent e) { };
        public void windowOpened(WindowEvent e) { };
    class SnailData{
       private double distance;
       private double speed;
       private double time;
       public SnailData(){
          distance = 0;
          speed = 0;
          time = 0;
       public double getDistance(){
          return distance;
       public double getSpeed(){
          return speed;
       public double getTime(){
          return time;
       public void setDistance(double d){
          distance = d;
       public void setSpeed(double s){
          speed = s;
       public void setTime(double t){
          time = t;
    }Pls and thanks again for helps....

    What i actually want to do is SnailTravel, but i facing some problems, which is the
    - Constructor,setter, getter, and
    - Exception Handling.
    So i create another simple contructor files which name Employee and TestEmployeeClass, to try find out the problem but i failed, it come out error msg "cannot find symbol".
    What i want to say that is if i cut below code (SnailTravel) to its own file(SnailData), SnailTravel come out error msg "cannot find symbol".So i force to put them in a same file(SnailTravel) to run properly.
    I need help to separate them. (I think i miss some syntax but i dont know what)
    And can somebody help me about Exception handling too pls.
    class SnailData{
       private double distance;
       private double speed;
       private double time;
       public SnailData(){
          distance = 0;
          speed = 0;
          time = 0;
       public double getDistance(){
          return distance;
       public double getSpeed(){
          return speed;
       public double getTime(){
          return time;
       public void setDistance(double d){
          distance = d;
       public void setSpeed(double s){
          speed = s;
       public void setTime(double t){
          time = t;

  • Flow Activity Exception Handling Problem

    Hi,
    I am using Flow Activity in my Bpel Process, i am getting some exception in one of flow, but other flows are working fine. Even i have included Catch block for other flow still i am getting fault response.
    Please suggest me how to do exception handling in Flow Activity.
    Thanks in advance.

    Hi,
    just restructure your BPEL process. The 'Flow' activity contains several 'Sequence' activities. Simply ... put a 'Scope' activity inside of each 'Sequence' activity. Then put another 'Sequence' activity inside of each 'Scope' activity ... and put there required logic/activities.
    After that you can create fault handling on these 'Scope' activities. In this way you can handle faults in each flow-sequence.
    Regards,
    Martin

  • JSP Exception Handler problem

    I have set up an errorPage handler (ExceptionHandler.jsp) for my JSP page, Main.jsp. If the Main.jsp throws an exception from some of its early code, ExceptionHandler.jsp shows correctly.
    But if Main.jsp throws an exception later on in its code, its previous ouput to the client isn't cleared and gets sent to the client along with the ExceptionHandler.jsp output - usually resulting in the user seeing a blank screen.
    So how can I make it so that when ExceptionHandler.jsp is called, none of Main.jsp output is sent to the client?
    Cheers,
    James

    Don't handle business logic in JSPs, but in Servlets. Use JSPs for presentation only. With other words: move all those scriptlets out of the JSP file to a real Java class.

  • Exception handling problem

    Hi, i have a database whereby people can look up customer records based on their order numbers. If the order number does not exist, an error should appear.
    Code:
    SET SERVEROUTPUT ON;
    DECLARE
    v_ordNum NUMBER(8) := &sv_odNum;
    v_fname VARCHAR2 (30);
    v_lname VARCHAR2 (30);
    v_add VARCHAR2 (30);
    v_num VARCHAR2 (10);
    BEGIN
    SELECT first, last, cadd, dphone
    INTO v_fname, v_lname, v_add, v_num
    FROM CUSTOMER c, ORDERS o
    WHERE c.custid = o.custid
    AND v_ordNum = o.orderid;
    DBMS_OUTPUT.PUT_LINE(' The name, address and telephone number of the customer follow: '
    ||v_fname|| ' ' ||v_lname ||' ' ||v_add||' ' ||v_num);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE(v_ordNum 'was not found. Please try again');
    END;
    When i enter a order number that does not exist i get this instead, y:
    SQL> @q1.sql
    Enter value for sv_odnum: 2331
    old 2: v_ordNum NUMBER(8) := &sv_odNum;
    new 2: v_ordNum NUMBER(8) := 2331;
    DBMS_OUTPUT.PUT_LINE(v_ordNum 'was not found. Please try again');
    ERROR at line 18:
    ORA-06550: line 18, column 33:
    PLS-00103: Encountered the symbol "was not found. Please try again" when
    expecting one of the following:
    . ( ) , * @ % & | = - + < / > at in mod not range rem => ..
    <an exponent (**)> <> or != or ~= >= <= <> and or like as
    between from using is null is not || is dangling
    The symbol "." was substituted for "was not found. Please try again" to
    continue.

    Hi,
    you were careful in using "||" while writing the previous DBMS_OUTPUT.PUT_LINE statement.
    do the same now aslo...
    DBMS_OUTPUT.PUT_LINE(v_ordNum || ' was not found. Please try again');
    Try now and tell me. Simple Errors you should be careful... you just have to read the error carefull and see what it says and why it is wrong.
    Regards
    Jagan

  • Exception handling problems

    hi folks,
    i have developed one web service in which i have thrown a SoapFault
    exception.i want it to see what happens on the client.i get an exception
    thrown but ,theres some thing called SaxParseException that also appears on
    the client console.also while running the web service i get a message on the
    server console which is like this
    Unable to deploy EJB: Hello from Hellodeepuu.jar:
    Unable to bind a cluster-aware stateless session EJBObject to the name:
    HelloHome_EO. Please ensure
    that the jndi-name in the weblogic-ejb-jar.xml is correct. The error was:
    javax.naming.NameAlreadyBoundException: Can't rebind anything but a
    replica-aware stub to a name tha
    t is currently bound to a replica-aware stub; remaining name ''
    <<no stack trace available>>
    what is this?
    and on the cline side console the xml and the exception is like this
    ------------- RECEIVING XML -------------
    <?xml version="1.0"?>
    <definitions
    targetNamespace="java:com.chase.ccs.webservice.transaction"
    xmlns:tns="java:com.chase.ccs.webservice.transaction"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <types>
    <schema targetNamespace='java:com.chase.ccs.webservice.transaction'
    xmlns='http://www.w3.org/1999/XMLSchema'>
    </schema>
    </types>
    <message name="helloRequest">
    </message>
    <message name="helloResponse">
    <part name="return" type="xsd:string" />
    </message>
    <portType name="HelloPortType">
    <operation name="hello">
    <input message="tns:helloRequest"/>
    <output message="tns:helloResponse"/>
    </operation>
    </portType>
    <binding name="HelloBinding" type="tns:HelloPortType"><soap:binding
    style="rpc" transport="http://sc
    hemas.xmlsoap.org/soap/http/"/>
    <operation name="hello">
    <soap:operation soapAction="urn:hello"/>
    <input><soap:body use="encoded" namespace='urn:Hello'
    encodingStyle="http://schemas.xmlsoap.org/soap
    /encoding/"/></input>
    <output><soap:body use="encoded" namespace='urn:Hello'
    encodingStyle="http://schemas.xmlsoap.org/soa
    p/encoding/"/></output>
    </operation>
    </binding>
    <service name="Hello"><documentation>todo</documentation><port
    name="HelloPort" binding="tns:HelloBi
    nding"><soap:address
    location="http://localhost:7001/Hello/Hellouri"/></port></service></definiti
    ons
    >
    -------------- SENDING XML --------------
    <?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope
    xmlns:SOAP-ENV='http://schemas.xmlsoap.org/
    soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.
    org/1999/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/1999/XMLSchema'><SOAP-ENV:Body><ns0:hello
    xmlns:ns0='urn:Hello'
    SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'></ns0:hel
    lo
    </SOAP-ENV:Body></SOAP-ENV:Envelope>------------- RECEIVINGXML -------------
    <?xml version="1.0" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>
    Client
    </faultcode>
    <faultstring>
    java.rmi.RemoteException
    </faultstring>
    <detail>
    Application fault:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    weblogic.soap.SoapFault: faultstring
    ------------- Remote Stack Trace ------------
    detail------------- Local Stack Trace ------------
    weblogic.soap.SoapFault: faultstring
    <<no stack trace available>>
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    Scanner has tokens:
    [CHARDATA] (detail------------- Local Stack
    race ------------)
    [SPACE] (
    [CHARDATA] (weblogic.soap.SoapFault: faultstring)
    [SPACE] (
    lt: faultstring
    <n <-- bad character
    ur in exceptionclass org.xml.sax.SAXParseException
    Error at line:18 col:4 '<' expected [?! -- [CDATA[ ]
    at
    weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseException(SAXE
    lementFactory
    .java:60)
    at
    weblogic.xml.babel.parsers.StreamParser.streamParseSome(StreamParser.java:13
    0)
    at
    weblogic.xml.babel.parsers.BabelXMLEventStream.parseSome(BabelXMLEventStream
    .java:46)
    at
    weblogicx.xml.stream.SubEventStream.parseSome(SubEventStream.java:48)
    at
    weblogicx.xml.stream.SubElementEventStream.parseSome(SubElementEventStream.j
    ava:38)
    at
    weblogicx.xml.stream.SubEventStream.parseSome(SubEventStream.java:48)
    at
    weblogicx.xml.stream.SubElementEventStream.parseSome(SubElementEventStream.j
    ava:38)
    at
    weblogicx.xml.stream.XMLEventStreamBase.hasNext(XMLEventStreamBase.java:135)
    at
    weblogicx.xml.stream.helpers.TextBuilder.process(TextBuilder.java:23)
    at
    weblogic.soap.codec.SoapEncodingCodec.decode(SoapEncodingCodec.java:194)
    at
    weblogic.soap.codec.SoapEncodingCodec.decode(SoapEncodingCodec.java:145)
    at weblogic.soap.codec.CodecFactory.decode(CodecFactory.java:66)
    at weblogic.soap.codec.Operation.read(Operation.java:97)
    at
    weblogic.soap.codec.SoapMessage.readOperation(SoapMessage.java:200)
    at weblogic.soap.codec.SoapMessage.read(SoapMessage.java:130)
    at weblogic.soap.WebServiceProxy.receive(WebServiceProxy.java:480)
    at weblogic.soap.WebServiceProxy.invoke(WebServiceProxy.java:431)
    at weblogic.soap.SoapMethod.invoke(SoapMethod.java:186)
    at CountClient.main(CountClient.java:60)
    i am using wl6.1 and rpc style message service.i would appreacite if anyone
    would tell me why i am getting the SaxParse Exception even though i am not
    parsing anything.
    thanx in advance
    deepuu

    hi manoj,
    thanx for the instant reply.
    but in my condition if i want it make it work ,is there any way that i can
    do it.
    deepuu
    "manoj cheenath" <[email protected]> wrote in message
    news:[email protected]...
    In 6.1 the fault->details element in the response is not wrapped in
    CDATA. In some situation (like the one you found) the serialization
    of stack trace to fault->details produce invalid XML. Hence, the
    parser failed.
    This is a bug and i have filed a CR on WSL 6.1.
    regards,
    manoj
    "deepuu" <[email protected]> wrote in message
    news:[email protected]...
    hi folks,
    i have developed one web service in which i have thrown a SoapFault
    exception.i want it to see what happens on the client.i get an
    exception
    thrown but ,theres some thing called SaxParseException that also appearson
    the client console.also while running the web service i get a message onthe
    server console which is like this
    Unable to deploy EJB: Hello from Hellodeepuu.jar:
    Unable to bind a cluster-aware stateless session EJBObject to the name:
    HelloHome_EO. Please ensure
    that the jndi-name in the weblogic-ejb-jar.xml is correct. The error
    was:
    javax.naming.NameAlreadyBoundException: Can't rebind anything but a
    replica-aware stub to a name tha
    t is currently bound to a replica-aware stub; remaining name ''
    <<no stack trace available>>
    what is this?
    and on the cline side console the xml and the exception is like this
    ------------- RECEIVING XML -------------
    <?xml version="1.0"?>
    <definitions
    targetNamespace="java:com.chase.ccs.webservice.transaction"
    xmlns:tns="java:com.chase.ccs.webservice.transaction"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <types>
    <schema targetNamespace='java:com.chase.ccs.webservice.transaction'
    xmlns='http://www.w3.org/1999/XMLSchema'>
    </schema>
    </types>
    <message name="helloRequest">
    </message>
    <message name="helloResponse">
    <part name="return" type="xsd:string" />
    </message>
    <portType name="HelloPortType">
    <operation name="hello">
    <input message="tns:helloRequest"/>
    <output message="tns:helloResponse"/>
    </operation>
    </portType>
    <binding name="HelloBinding" type="tns:HelloPortType"><soap:binding
    style="rpc" transport="http://sc
    hemas.xmlsoap.org/soap/http/"/>
    <operation name="hello">
    <soap:operation soapAction="urn:hello"/>
    <input><soap:body use="encoded" namespace='urn:Hello'
    encodingStyle="http://schemas.xmlsoap.org/soap
    /encoding/"/></input>
    <output><soap:body use="encoded" namespace='urn:Hello'
    encodingStyle="http://schemas.xmlsoap.org/soa
    p/encoding/"/></output>
    </operation>
    </binding>
    <service name="Hello"><documentation>todo</documentation><port
    name="HelloPort" binding="tns:HelloBi
    nding"><soap:address
    location="http://localhost:7001/Hello/Hellouri"/></port></service></definiti
    ons
    >
    -------------- SENDING XML --------------
    <?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope
    xmlns:SOAP-ENV='http://schemas.xmlsoap.org/
    soap/envelope/'xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.
    org/1999/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/1999/XMLSchema'><SOAP-ENV:Body><ns0:hello
    xmlns:ns0='urn:Hello'
    SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'></ns0:hel
    lo
    </SOAP-ENV:Body></SOAP-ENV:Envelope>------------- RECEIVINGXML -------------
    <?xml version="1.0" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>
    Client
    </faultcode>
    <faultstring>
    java.rmi.RemoteException
    </faultstring>
    <detail>
    Application fault:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    weblogic.soap.SoapFault: faultstring
    ------------- Remote Stack Trace ------------
    detail------------- Local Stack Trace ------------
    weblogic.soap.SoapFault: faultstring
    <<no stack trace available>>
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    Scanner has tokens:
    [CHARDATA] (detail------------- Local Stack
    race ------------)
    [SPACE] (
    [CHARDATA] (weblogic.soap.SoapFault: faultstring)
    [SPACE] (
    lt: faultstring
    <n <-- bad character
    ur in exceptionclass org.xml.sax.SAXParseException
    Error at line:18 col:4 '<' expected [?! -- [CDATA[ ]
    at
    weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseException(SAXE
    lementFactory
    .java:60)
    at
    weblogic.xml.babel.parsers.StreamParser.streamParseSome(StreamParser.java:13
    0)
    at
    weblogic.xml.babel.parsers.BabelXMLEventStream.parseSome(BabelXMLEventStream
    .java:46)
    at
    weblogicx.xml.stream.SubEventStream.parseSome(SubEventStream.java:48)
    at
    weblogicx.xml.stream.SubElementEventStream.parseSome(SubElementEventStream.j
    ava:38)
    at
    weblogicx.xml.stream.SubEventStream.parseSome(SubEventStream.java:48)
    at
    weblogicx.xml.stream.SubElementEventStream.parseSome(SubElementEventStream.j
    ava:38)
    at
    weblogicx.xml.stream.XMLEventStreamBase.hasNext(XMLEventStreamBase.java:135)
    at
    weblogicx.xml.stream.helpers.TextBuilder.process(TextBuilder.java:23)
    at
    weblogic.soap.codec.SoapEncodingCodec.decode(SoapEncodingCodec.java:194)
    at
    weblogic.soap.codec.SoapEncodingCodec.decode(SoapEncodingCodec.java:145)
    at weblogic.soap.codec.CodecFactory.decode(CodecFactory.java:66)
    at weblogic.soap.codec.Operation.read(Operation.java:97)
    at
    weblogic.soap.codec.SoapMessage.readOperation(SoapMessage.java:200)
    at weblogic.soap.codec.SoapMessage.read(SoapMessage.java:130)
    atweblogic.soap.WebServiceProxy.receive(WebServiceProxy.java:480)
    atweblogic.soap.WebServiceProxy.invoke(WebServiceProxy.java:431)
    at weblogic.soap.SoapMethod.invoke(SoapMethod.java:186)
    at CountClient.main(CountClient.java:60)
    i am using wl6.1 and rpc style message service.i would appreacite ifanyone
    would tell me why i am getting the SaxParse Exception even though i am
    not
    parsing anything.
    thanx in advance
    deepuu

  • ADF Exception Handle Problem

    Hi All,
    1) created a class with "execute" method in ADF model project, and exposed it as a data control.
    2) bind the "execute" method into a JSF page in ADF viewController project.
    3) tried to run "execute" method from JSF page.
    4) some exception thrown from "execute" method, but ADF application didn't show the real exception message but following, why?
    <Utils><buildFacesMessage> ADF: Adding the following JSF error message: tried to access class oracle.j2ee.util.TraceLogger$TraceLoggerHandler from class oracle.j2ee.util.CustomerLogger
    java.lang.IllegalAccessError: tried to access class oracle.j2ee.util.TraceLogger$TraceLoggerHandler from class oracle.j2ee.util.CustomerLogger
         at oracle.j2ee.util.CustomerLogger.getCompatibleHandler(CustomerLogger.java:248)
         at oracle.j2ee.util.CustomerLogger.getLogger(CustomerLogger.java:231)
         at oracle.j2ee.rmi.RMIMessages.<clinit>(RMIMessages.java:21)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:125)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:571)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:515)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy3.getObject(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.agile.api.pc.EJBRemoteProxy$1.invoke(EJBRemoteProxy.java:40)
         at $Proxy130.getObject(Unknown Source)
         at com.agile.api.pc.Session$GetObjectAction.doSdkAction(Session.java:1452)
         at com.agile.api.common.SDKAction.run(SDKAction.java:23)
         at com.agile.api.common.OracleAuthenticator.doAs(OracleAuthenticator.java:131)
         at com.agile.api.common.Security.doAs(Security.java:54)
         at com.agile.api.common.Security.doAs(Security.java:109)
         at com.agile.api.pc.Session.getObject(Session.java:448)
         at model.Test.execute(Test.java:113)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:567)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2134)
         at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3020)
         at oracle.adf.model.bean.DCBeanDataControl.invokeMethod(DCBeanDataControl.java:440)
         at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:257)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1625)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2141)
         at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:468)
         at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:307)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:730)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:185)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    <Utils><buildFacesMessage> ADF: Adding the following JSF error message: tried to access class oracle.j2ee.util.TraceLogger$TraceLoggerHandler from class oracle.j2ee.util.CustomerLogger
    java.lang.IllegalAccessError: tried to access class oracle.j2ee.util.TraceLogger$TraceLoggerHandler from class oracle.j2ee.util.CustomerLogger
         at oracle.j2ee.util.CustomerLogger.getCompatibleHandler(CustomerLogger.java:248)
         at oracle.j2ee.util.CustomerLogger.getLogger(CustomerLogger.java:231)
         at oracle.j2ee.rmi.RMIMessages.<clinit>(RMIMessages.java:21)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:125)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:571)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:515)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy3.getObject(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.agile.api.pc.EJBRemoteProxy$1.invoke(EJBRemoteProxy.java:40)
         at $Proxy130.getObject(Unknown Source)
         at com.agile.api.pc.Session$GetObjectAction.doSdkAction(Session.java:1452)
         at com.agile.api.common.SDKAction.run(SDKAction.java:23)
         at com.agile.api.common.OracleAuthenticator.doAs(OracleAuthenticator.java:131)
         at com.agile.api.common.Security.doAs(Security.java:54)
         at com.agile.api.common.Security.doAs(Security.java:109)
         at com.agile.api.pc.Session.getObject(Session.java:448)
         at model.Test.execute(Test.java:113)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:567)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2134)
         at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3020)
         at oracle.adf.model.bean.DCBeanDataControl.invokeMethod(DCBeanDataControl.java:440)
         at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:257)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1625)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2141)
         at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:468)
         at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:307)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:730)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:185)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Hi All,
    if i called the "execute" method from a pure Java client application, i got the following exception message,
    com.agile.util.exception.CMAppException: Invalid parameter.
         at com.agile.apibean.Generic.createError(Generic.java:29)
         at com.agile.apibean.Generic.checkParameter(Generic.java:41)
         at com.agile.apibean.objects.DataObjectOperations.getObject(DataObjectOperations.java:264)
         at com.agile.apibean.objects.DataObjectOperations.getObject(DataObjectOperations.java:294)
         at com.agile.apibean.APISessionBean.getObject(APISessionBean.java:367)
         at sun.reflect.GeneratedMethodAccessor309.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxSupportsInterceptor.invoke(TxSupportsInterceptor.java:37)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at com_agile_apibean_APISession_RemoteProxy_2fc2dp8.getObject(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor399.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
         at com.evermind.server.rmi.RMICall.warningExceptionOriginatesFromTheRemoteServer(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:129)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:571)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:515)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy3.getObject(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.agile.api.pc.EJBRemoteProxy$1.invoke(EJBRemoteProxy.java:40)
         at $Proxy1.getObject(Unknown Source)
         at com.agile.api.pc.Session$GetObjectAction.doSdkAction(Session.java:1452)
         at com.agile.api.common.SDKAction.run(SDKAction.java:23)
         at com.agile.api.common.OracleAuthenticator.doAs(OracleAuthenticator.java:131)
         at com.agile.api.common.Security.doAs(Security.java:54)
         at com.agile.api.common.Security.doAs(Security.java:109)
         at com.agile.api.pc.Session.getObject(Session.java:448)
         at model.Test.execute(Test.java:113)
         at model.TestClient.main(TestClient.java:16)
    com.agile.util.exception.CMAppException: Invalid parameter.
         at com.agile.apibean.Generic.createError(Generic.java:29)
         at com.agile.apibean.Generic.checkParameter(Generic.java:41)
         at com.agile.apibean.objects.DataObjectOperations.getObject(DataObjectOperations.java:264)
         at com.agile.apibean.objects.DataObjectOperations.getObject(DataObjectOperations.java:294)
         at com.agile.apibean.APISessionBean.getObject(APISessionBean.java:367)
         at sun.reflect.GeneratedMethodAccessor309.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxSupportsInterceptor.invoke(TxSupportsInterceptor.java:37)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at com_agile_apibean_APISession_RemoteProxy_2fc2dp8.getObject(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor399.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
         at com.evermind.server.rmi.RMICall.warningExceptionOriginatesFromTheRemoteServer(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:129)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:571)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:515)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy3.getObject(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.agile.api.pc.EJBRemoteProxy$1.invoke(EJBRemoteProxy.java:40)
         at $Proxy1.getObject(Unknown Source)
         at com.agile.api.pc.Session$GetObjectAction.doSdkAction(Session.java:1452)
         at com.agile.api.common.SDKAction.run(SDKAction.java:23)
         at com.agile.api.common.OracleAuthenticator.doAs(OracleAuthenticator.java:131)
         at com.agile.api.common.Security.doAs(Security.java:54)
         at com.agile.api.common.Security.doAs(Security.java:109)
         at com.agile.api.pc.Session.getObject(Session.java:448)
         at model.Test.execute(Test.java:113)
         at model.TestClient.main(TestClient.java:16)
    Error code : 60018
    Error message : Invalid parameter.
    Root Cause exception : com.agile.util.exception.CMAppException: Invalid parameter.
         at com.agile.api.pc.Session.createError(Session.java:1723)
         at com.agile.api.pc.Session$GetObjectAction.doSdkAction(Session.java:1457)
         at com.agile.api.common.SDKAction.run(SDKAction.java:23)
         at com.agile.api.common.OracleAuthenticator.doAs(OracleAuthenticator.java:131)
         at com.agile.api.common.Security.doAs(Security.java:54)
         at com.agile.api.common.Security.doAs(Security.java:109)
         at com.agile.api.pc.Session.getObject(Session.java:448)
         at model.Test.execute(Test.java:113)
         at model.TestClient.main(TestClient.java:16)
    Process exited with exit code 0.

  • Exception handle problem.

    I'd like to return a value in method doDelete(),but it saids that "finally block dose not complete normally",why? I use Ecplise3.0.1.
    Any advice is highly appreciated!
    Code:
    public int doDelete(String a, String b)
    int state = 0;
    String filter = "num != 1"
    OneDAO oneDAO = new OneDAO ( );
    try
    ArrayList list = oneDAO .query (filter);//get the record to be delete
    oneDAO .deleteDS(list );//delete record from table A
    oneDAO .deleteCom (a, b);//delete record from table B
    state = 0; //success
    catch (OPException e)
    state = 6; //meet exception
    throw new SystemException (e);
    finally
    return state;
    }

    You can not both return a value and throw an excepton, which is what you are tring to do above. If a Throwable is throw, the method never "returns", and the calling blocks "trys" catch block is executed.
    When you post code, please use [code] and [/code] tags as described in Formatting Tips on the message entry page. It makes it much easier to read.

  • Problem in Exception Handling...URGENT

    hi, actually i am trying to make a program using Lucene Api and Using NGramSpeller...
    the information about NGramSpeller is here
    http://www.marine-geo.org/services/oai/docs/javadoc/org/apache/lucene/spell/NGramSpeller.html#suggestUsingNGrams(org.apache.lucene.search.Searcher,%20java.lang.String,%20int,%20int,%20int,%20float,%20float,%20float,%20int,%20java.util.List,%20boolean)
    and here is my code..
    package org.apache.lucene.spell;
    import java.io.IOException;
    import java.io.File;
    import java.io.*;
    import java.io.FileInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.BufferedReader;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.queryParser.ParseException;
    import org.apache.lucene.search.Query;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.spell.NGramSpeller;
    import org.apache.lucene.store.Directory;
    import org.apache.lucene.store.FSDirectory;
    import org.apache.lucene.analysis.*;
    import org.apache.lucene.index.*;
    import org.apache.lucene.store.*;
    import org.apache.lucene.document.*;
    import org.apache.lucene.search.*;
    import org.apache.lucene.search.BooleanClause.Occur;
    import java.lang.*;
    public class spell1 {
         public static void main(String args[]) throws IOException {     
         try{
         System.out.println("enter the keyword");
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));//USER INPUT KEYWORDS
        String the_query = in.readLine();               
         //String spellIndex = "C:/opt/lucene/didyoumean/indexes/spell";
         String spellIndex1 = "C:/Documents and Settings/sumit-i/Desktop/ngramspell/ngramspell";
         Searcher spellIndex = new IndexSearcher(spellIndex1);
         NGramSpeller spellChecker = new NGramSpeller();
         float a=2.0f, b=1.0f, c=0.0f;
         try{
         String[] similarWords = spellChecker.suggestUsingNGrams(spellIndex, "jva", 3, 3, 10, a, b, c, 0, null, true);
         System.out.println("DO YOU MEAN.........");
         for(int i=0;i<similarWords.length;i++)
         System.out.println(similarWords);
         catch (IOException e) {
    throw e;
         in.close();
         catch (IOException ioe)
         ioe.printStackTrace();
    the error i am getting is due to some exception handling problem, which is as follows:package org.apache.lucene.spell;
    import java.io.IOException;
    import java.io.File;
    import java.io.*;
    import java.io.FileInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.BufferedReader;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.queryParser.ParseException;
    import org.apache.lucene.search.Query;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.spell.NGramSpeller;
    import org.apache.lucene.store.Directory;
    import org.apache.lucene.store.FSDirectory;
    import org.apache.lucene.analysis.*;
    import org.apache.lucene.index.*;
    import org.apache.lucene.store.*;
    import org.apache.lucene.document.*;
    import org.apache.lucene.search.*;
    import org.apache.lucene.search.BooleanClause.Occur;
    import java.lang.*;
    public class spell1 {
         public static void main(String args[]) throws IOException {     
         try{
         System.out.println("enter the keyword");
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));//USER INPUT KEYWORDS
    String the_query = in.readLine();               
         //String spellIndex = "C:/opt/lucene/didyoumean/indexes/spell";
         String spellIndex1 = "C:/Documents and Settings/sumit-i/Desktop/ngramspell/ngramspell";
         Searcher spellIndex = new IndexSearcher(spellIndex1);
         NGramSpeller spellChecker = new NGramSpeller();
         float a=2.0f, b=1.0f, c=0.0f;
         try{
         String[] similarWords = spellChecker.suggestUsingNGrams(spellIndex, "jva", 3, 3, 10, a, b, c, 0, null, true);
         System.out.println("DO YOU MEAN.........");
         for(int i=0;i<similarWords.length;i++)
         System.out.println(similarWords[i]);
         catch (IOException e) {
    throw e;
         in.close();
         catch (IOException ioe)
         ioe.printStackTrace();
    any idea....plzzz                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    what about this??
    try{
         String[] similarWords = spellChecker.suggestUsingNGrams(spellIndex, "jva", 3, 3, 10, a, b, c, 0, null, true);
         System.out.println("DO YOU MEAN.........");
         for(int i=0;i<similarWords.length;i++)
         System.out.println(similarWords);
         catch (ArrayIndexOutOfBoundsException e) {
    System.out.println("exception: " + e.getMessage());
    e.printStackTrace();

  • Forall exception

    Hi all,
    What would heppen if forall statement fails in procedure.
    How to handle it in the exception handling section.
    Kindly help me .
    thank you
    regards
    P Prakash

    Hi friend,
    May be it is related to Collections Exception Handler Problem.Please check once using Collections Exception Handlers.
    Internally it maintain collections while inserting the data.I am not sure just try it.
    Thanks,
    Sanjeev.

  • Exception Handling related problem

    Can anybody tell me why it is not giving ArithmeticException.
    package pckg1;
    * @author anil_saini
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    import java.io.FileNotFoundException;
    public class Average7 {
         public static void main(String[] args) throws InterruptedException,FileNotFoundException {
         try {                                                      // (1)            System.out.println(printAverage(100, 0));                                  // (2)
         } catch (ArithmeticException ae) {                         // (3)
         Thread.sleep(1000);
              ae.printStackTrace(); // (4)
    System.out.println("Exception handled in " + // (5)
         "main().");
         finally {
         System.out.println("Finally in main()."); // (6)
         System.out.println("Exit main()."); // (7)
    public static int printAverage(int totalSum, int totalNumber) {
         int average=0;
         try {                                                      // (8)
    average = computeAverage(totalSum, totalNumber); // (9)
         System.out.println("Average = " + // (10)
         totalSum + " / " + totalNumber + " = " + average);
         return average;
         } catch (IllegalArgumentException iae) {                   // (11)
              iae.printStackTrace(); // (12)
    System.out.println("Exception handled in " + // (13)
         "printAverage().");
         } finally {
    System.out.println("Finally in printAverage()."); // (14)
         return average;
         }     // (15)
    public static int computeAverage(int sum, int number) {
         System.out.println("Computing average.");
         if (number == 0) // (16)
    throw new ArithmeticException("Integer division by 0");// (17)
         return sum/number; // (18)
    Output
    =======================
    Computing average.
    Finally in printAverage().
    0
    Finally in main().
    Exit main().

    Because return statements in finally blocks are evil!
    int average = 0;
    try
    { // (8)
         average = computeAverage(totalSum, totalNumber); // (9)
         System.out.println("Average = " + // (10)
                   totalSum + " / " + totalNumber + " = " + average);
         return average;
    catch (IllegalArgumentException iae)
    { // (11)
         iae.printStackTrace(); // (12)
         System.out.println("Exception handled in " + // (13)
                   "printAverage().");
         throw new IllegalArgumentException();
    finally
         System.out.println("Finally in printAverage()."); // (14)
         return average; // (15)
    }You get an exception at (9), but finally is guaranteed to be executed, so the JVM executes it. Now you return in your finally block (15), and the JVM is left with the choice of executing your return statement or propagating the exception. Since, as said, finally is guaranteed to be executed, it returns and swallows the exception.
    That's why IMHO return statements in finally blocks should not be allowed.
    (Some compilers issue warnings)
    If you move your return statement out of the finally block, it will work as you'd expect it.

  • Problems with Custom Exception Handler

    Hi,
    I have defined a custom exception handler for my workflow (WebLogic Platform
    7).
    I have a workflow variable called 'count' , which gets incremented for every
    time an exception occurs.
    The exception handler checks if the count is less than 3(using evaluate
    condition),
    if yes then it executes the action "Exit Execption Handler and retry"
    else
    it executes the action "Exit Execption Handler and continue"
    The Workflow simply hangs, nothing on the console , the worklist from which
    i call it hangs too.
    Has anyone managed to use this kind of exception handling?
    Thanks in advance,
    Asif

    bill0 wrote:
    > Thanks for all the help but still no luck.
    >
    > The directory is d:\wSites\GBMain\html\CFMS> and I am
    mapped to it as x:\CFMS.
    > Most of the cfm files are in CFMS but Application.cfm is
    1 directory up in
    > html. I have tried misscfm.cfm in both html and CFMS but
    had no luck having it
    > find a non existant template referred to in a cfinclude
    or a form's action
    > attribute. The default ColdFusion error handler is what
    shows. The missing
    > template handler box says /misscfm.cfm. Misscfm.cfm is
    text followed by a
    > <cfabort>. We use ColdFusion MX6.1
    >
    > I hope that is enough information to figure what am I
    missing and/or doing
    > wrong.
    >
    >
    Is the 'misscfm.cfm' file somewhere in the
    'd:\wSites\GBMain\html\CFMS\'
    directory. I will presume this is the 'web root' as defined
    in your web
    server (IIS or Apache or built-in or ???). The missing
    template handler
    file needs to be in the ColdFusion root. This is going to be
    a
    directory such as
    '{drive}:\JRun4\servers\{server}\cfusion-ear\cfusion-war\misscfm.cfm'
    for J2EE flavors OR '{drive}:\CFusionMX\wwwroot' for Standard
    I think.
    It has been a very long time since I have dealt with
    Standard.
    This is probably completely different from the above web
    root. That is
    the point I am trying to get across. ColdFusion has TWO roots
    where it
    will look for a CFML file. But the Missing and Sitewide
    templates can
    only be in the ColdFusion root listed above, they will not
    work in the
    web root.
    HTH
    Ian

  • 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

  • Delete Statement Exception Handling

    Hi guys,
    I have a problem in my procedure. There are 3 parameters that I am passing into the procedure. I am matching these parameters to those in the table to delete one record at a time.
    For example if I would like to delete the record with the values ('900682',3,'29-JUL-2008') as parameters, it deletes the record from the table but then again when I execute it with the same parameters it should show me an error message but it again says 'Deleted the Transcript Request.....' Can you please help me with this?
    PROCEDURE p_delete_szptpsr_1 (p_shttran_id IN saturn.shttran.shttran_id%TYPE,
    p_shttran_seq_no IN saturn.shttran.shttran_seq_no%TYPE,
    p_shttran_request_date IN saturn.shttran.shttran_request_date%TYPE) IS
    BEGIN
    DELETE FROM saturn.shttran
    WHERE shttran.shttran_id = p_shttran_id
    and shttran.shttran_seq_no = p_shttran_seq_no
    and trunc(shttran_request_date) = trunc(p_shttran_request_date);
    DBMS_OUTPUT.PUT_LINE('Deleted the Transcript Request Seq No (' || p_shttran_seq_no || ') of the Student (' || p_shttran_id ||') for the requested date of (' || p_shttran_request_date ||')');
    COMMIT;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Error: The supplied Notre Dame Student ID = (' || p_shttran_id ||
    '), Transcript Request No = (' || p_shttran_seq_no || '), Request Date = (' || p_shttran_request_date || ') was not found.');
    END p_delete_szptpsr_1;
    Should I have a SELECT statement to use NO_DATA_FOUND ???

    A DELETE statement that deletes no rows (just like an UPDATE statement that updates no rows) is not an error to Oracle. Oracle won't throw any exception.
    If you want your code to throw an exception, you'll need to write that logic. You could throw a NO_DATA_FOUND exception yourself, i.e.
    IF( SQL%ROWCOUNT = 0 )
    THEN
      RAISE no_data_found;
    END IF;If you are just going to catch the exception, though, you could just embed whatever code you would use to handle the exception in your IF statement, i.e.
    IF( SQL%ROWCOUNT = 0 )
    THEN
      <<do something about the exception>>
    END IF;In your original code, your exception handler is just a DBMS_OUTPUT statement. That is incredibly dangerous in real production code. You are relying on the fact that the client has enabled output, that the client has allocated a large enough buffer, that the user is going to see the message, and that the procedure will never be called from any piece of code that would ever care if it succeeded or failed. There are vanishingly few situations where those are safe things to rely on.
    Justin

Maybe you are looking for

  • Exiting form after being in query mode

    Hi guys, Having an issue with some forms after migrating from forms version 6i to 10g. Learning as I go along. Forms which startup in query-mode seem to have an issue when closing - all have two blocks - one block is utilised through user query and t

  • JTree - Color setting of linestyle

    Between the root and the node elements there are lines to show the connection between the element/levels. How can I change the color of these lines and/or how can I hide these lines?

  • Issues downloading firefox 4 for mac osx

    I updated my firefox and downloaded your firefox 4. I have a mac osx and the icon has a circle and a strike over it, and firefox no longer opens telling me that I can't open the application "firefox" because it is not supported on this architecture.

  • In what versions are contacts stored in PST file?

    Currently doing migrations to the Cloud from multiple exchange servers. How are contacts and autocomplete lists stored in the different 2003/2007/2010/2013 versions? If I remember correctly I need to export contacts from Outlook 2003 and also the .n2

  • Error installing Oracle Excel client.

    Hello All, I was wondering if anyone could help me with the following... It would be easier if I could show some screen shots but here goes. I was trying to follow the following instructions http://blog.mclaughlinsoftware.com/microsoft-excel/how-to-q