4 Replies Latest reply: Jan 5, 2011 11:54 PM by Justin James RSS

    DSP- ClasscastException Problem in BPM

    662978
      I get the Classcastexception in BPM when i try to call an update method from a dsp web service. It is caused by the XML vlidation that happens on the dsp side before the update process (from the dsp server log). I have used the try catch in the logical data service.
      How do I handle the database errors (or XML validation errors) in DSP and send the reason of the error to the client(BPM).

      Edited by: user1587779 on Oct 3, 2008 9:59 AM
        • 1. Re: DSP- ClasscastException Problem in BPM
          mikereiche
          I get the Classcastexception in BPM when i try to call an update method from a dsp web service
          I believe this problem has been forwarded to me by your Oracle/BEA rep.
          It is caused by...
          I don't think so. I'm still investigating, but it appears the problem is with different class loaders being used. If you remove the generated mediator client classes from your ejb server and ejb client applications, and put it in the server classpath, the problem disappears.
          How do I handle the database errors (or XML validation errors) in DSP and send the reason of the error to the client(BPM).
          The error you are getting is outside of DSP, and certainly there could be other errors that are beyond the control of DSP (the DSP server could be down, for instance). You should put a try/catch in your client (just like you would put a try/catch around a JDBC call).

          - Mike
          • 2. Re: DSP- ClasscastException Problem in BPM
            662978
            Mike,

            Thanks for the response.
            As I said earlier, I am calling the DSP web services in the BPM to update a table. I am doing this update using the NON-SDO custom update in the DSP layer itself. So the BPM is calling the DSP update method and it is passing 2 parameters, original and current elements. (Not the changed-elements).

            Since I am running the DSP services locally, when I try to do the update from the BPM which is calling the DSP services that are running locally, this is the error I could see from the 'Console' in the Workspace studio.

            Caused by: weblogic.xml.query.exceptions.XQueryDynamicException: {err}XQ0027: Validation failed: error: cvc-complex-type.2.4a: Expected element 'RECV_DT' instead of 'REQ_FL' here in element

            But the error I get in the BPM workspace is as below:
            Caused by: java.lang.ClassCastException: org.apache.axis.message.Text
            at org.apache.axis.message.SOAPFaultBuilder.onEndChild(SOAPFaultBuilder.java:299)
            at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1090)
            at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)

            Below is the dsp update method used in BPM:

            declare procedure tns:updateInfo($original as element(csp1:INFO), $current as element(csp1:INFO)) as xs:string? {
                 declare $message as xs:string;
                 set $message :="failed";
                 try{           
                      tns:updateInfo_ORIG(gen:generateChangedElement($original,$current,tns:getKeyList()));
                 } catch (* into $err , $msg, $obj){
                      fn:error(xs:QName("UPDATE_FAILURE"),
            fn:concat("Update failed on due to: ", $err, $msg), $obj);
                      };
            set $message := "success";
            return value $message;     
            };

            As you said we will put try/catch in the client side code. But is there any way to tell the client of the exceptions happening in the DSP side?
            Thanks
            • 3. Re: DSP- ClasscastException Problem in BPM
              mikereiche
              Caused by: weblogic.xml.query.exceptions.XQueryDynamicException: {err}XQ0027: Validation failed: error: cvc-complex-type.2.4a: Expected element 'RECV_DT' instead of 'REQ_FL' here in element
              All that means is that you neglected to set REQ_FL and it is a required element (minOccurs >= 1).
              But is there any way to tell the client of the exceptions happening in the DSP side?
              Yes. The DSP Native Webservice framework wraps exceptions in a SOAPFault. But it seems your Axis client has a problem.


              Caused by: java.lang.ClassCastException: org.apache.axis.message.Text
              at org.apache.axis.message.SOAPFaultBuilder.onEndChild(SOAPFaultBuilder.java:299)
              at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1090)

              Axis doesn't like the SOAPFault from DSP. You might try capturing a SOAPFault it does like and comparing it to this SOAPFault
              • 4. Re: DSP- ClasscastException Problem in BPM
                Justin James
                Hello -

                Can you please check the credentials which is using for this operation.
                I got the same exception with cataloging Webservice in BPM.

                BR,
                Justin.