Exception handling in MI service call

Hi,
I have consumed MI service in web dynpro java.
I created model from local wsdl file etc and its working perfect
But one problem is that even though its succesful execution, it returns exception.
So I am not able to catch genuine failure cases.
I have tried all below three exceptions:
     try{
wdContext.createRequest_MI_UI_BSCS_GL1_OUT_518Element(request_MI_UI_BSCS_GL1_OUT_518).modelObject().execute();
     catch(Exception ex)
     //wdComponentAPI.getMessageManager().reportException(ex.getMessage().toString(),true);
     try {
wdContext.createRequest_MI_UI_BSCS_GL1_OUT_518Element(request_MI_UI_BSCS_GL1_OUT_518).modelObject().execute();
     } catch (WDWSModelExecuteException e)
// TODO Auto-generated catch block
try {
wdContext.createRequest_MI_UI_BSCS_GL1_OUT_518Element(request_MI_UI_BSCS_GL1_OUT_518).modelObject().execute();
                    } catch (RuntimeException e2) {
                         // TODO Auto-generated catch block
                         e2.printStackTrace();

i used runtime exception along with the wdwsmodel exception

Similar Messages

  • Exception handling PI - C# Service

    Hi all,
    I have the following scenario
    Scenario:
    Client                Middleware          Webservice
    ERP system -->       XI              --> C# webservice
    Everything works fine. But now I have one problem.
    In the C# webservice there are different exceptions implemented. (throw new exception xyz...)
    I can see the errors in the transaction SXMB_MONI in PI.
    But is it possible to transfer the errors (exceptions) to the real client application (our ERP system).
    If the call was not successfully I just get a "system error" message.
    Is it possible to get the real exception from the C# service to the ERP system that the user has really the information what was wrong.
    regards

    Hi,
    Are you getting Soap Exceptions in SOAP UI tool for errorful webservice Requests?
    Check if you have same issue in your scenario.
    SAP Note 1055678 - XI 3.0 soap receiver in nosoap mode
    with HTTP status code
    Anurag

  • Exception handling in Web Services

    Hi all,
    I am exposing ejb2-based webservices and am unable to find a way to throw checked Exceptions.
    Could anyone provide resources about how to leverage SOAP/WSDL features of exception handling (i.e. wsdl:fault tag)?
    Thanks, regards
    Vincenzo

    Hi, thanks for replying
    actually on saphelp I found that supported Exceptions are:
    java.lang.Exception -> no fault generated
    java.rmi.RemoteException -> deploy refused with explicit error (RemoteException not allowed in ejb business method signature)
    java.lang.Throwable -> doesn't seem very appropriate to use such a root class
    Any suggestion?
    Thanks, regards
    Vincenzo

  • Calling EJBs from Global Exception Handler

    Hi, I'm using Weblogic Workshop 8.1.4.
    I have a JPF which calls a EJB to set a lock flag (to prevent the JPF being executed twice at the same time.)
    I want to reset the lock flag in the global exception handler, however, if I call an EJB (Entity or Session) in a perform node in the exception handler, I get a NullPointerException.
    Is this because it's being called in the exception handler? Is there any way to work around this (without building a POJO which does all the persistance logic and SQL calling manually?)
    Thanks.

    You can redirect stdout to wherever you want by using
    System.setOut(PrintStream out). Also, you can give
    printStackTrace a PrintStream.
    hth,
    mI think to solve this problem you should call System.setErr(PrintStream err);

  • Exception Handling in Web Center for UI related Errors not working.

    Hi Guys,
    I have implemented Error Handling in ADF Application with Custom Model Exception Handler ( which is "CustomExceptionHandler extends DCErrorHandlerImpl") to catch all Model Layer Exception and to customize those error messages.
    I have implemented Error Handling in ADF Application with Custom View Exception Handler ( which is "CustomViewErrorHandler extends oracle.adf.view.rich.context.ExceptionHandler";) to catch all View Layer Exception and to customize those error messages.
    The design for this is , in Model Custom Exception Handler i find the exception message in "public String getDisplayMessage(BindingContext bindingContext,Exception exception) " method and throw RuntimeException to pass this exception to Custom View Layer Exception , so that i can handle all the exception @ View Layer it self .
    In the View Layer Exception Handler i am navigating to specific error page using
    String contextPath = ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getContextPath();
    ExternalContext ectx = facesContext.getExternalContext();
    ectx.redirect.
    All these things absolutly working in ADF Application for all the exception ( Model , View ) and i am successfully navigating to error page.
    Problem  :
    When i implement the same thing in Webcenter Application ( Model Custom Exception Handler and View Custom Exception Handler), Model Part is working as expected , but View Custom Exception Handler is not all calling .
    i am assuming that ,this View Custom Exception Handler (CustomViewErrorHandler extends oracle.adf.view.rich.context.ExceptionHandler) works only for JSF Life cycle
    "Allows frameworks to intercept otherwise unhandled exceptions thrown during the JSF lifecycle. ExceptionHandlers can be registered by adding a service file with a class name at META-INF/services/oracle.adf.view.rich.context.ExceptionHandler." from http://jdevadf.oracle.com/adf-richclient-demo/docs/apidocs/oracle/adf/view/rich/context/ExceptionHandler.html";
    As Webcenter Portal uses ADF Life Cycle this Exception Handler is not calling , i am not sure.
    if any one has any idea please let me know .
    Thanks
    Annapareddy Srinivasrao
    Edited by: Srinivasrao Annapareddy on May 22, 2013 12:06 PM

    i used runtime exception along with the wdwsmodel exception

  • Custom code as an exception handler not working.

    Hi,
    I worked on Custom Handler for unauthorized access to a taskflow following the link below and it worked. But a special case in this doesn't work.
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/taskflows_complex.htm#ADFFD22602
    Scenario-1: I have a link that opens an unauthorized taskflow as blank page. I tried the solution of custom handler and am able to display message or display error page --- WORKS FINE
    Scenario-2: I have a link that opens an unauthorized taskflow in a pop-up as blank page. The above solution doesn't work. I tried displaying SOPs but nothing gets print --- DOESN'T WORK.
    Details:
    The custom handler doesn't work with Pop-ups. I have an unauthorized taskflow that gets called inside a pop-up using a link. Being an unauthorized user, I click on the link and it pops-up with a blank page. As per the custom handler it is supposed to display error-page. But it doesn't.
    I tried displaying SOPs inside the handleException method and nothing prints. The exception handler is unable to catch the exception. If this use-case throws some exception, my exception handler would have handle it but it doesn't raise any exception.
    Is this something issue that I need to discuss with FMW team?
    Any workaround for this would be of great help.
    Code Sample:
    public void handleException(FacesContext facesContext, Throwable throwable,
    PhaseId phaseId) throws Throwable {
    String errorMessage = throwable.getMessage();
    if (errorMessage != null && errorMessage.indexOf("ADFC-0619") > -1) {
    setEL("#{sessionScope.errorMessage}",
    "You are not authorized to view this page.");
    ExternalContext externalContext =
    facesContext.getExternalContext();
    externalContext.redirect("ErrorPage");
    } else {
    super.handleException(facesContext, throwable, phaseId);
    Thanks
    Raza

    Hi Frank,
    This scenario is not specific to a particular TaskFlow. In General, there are links in some views, that invokes taskflows and a particular user may not have permission to that TaskFlow. In this scenario, I am not sure where I need to define the method or router. And Hence I registered the Custom Exception Handler as a service as per the documentation.
    But the logic in documentation doesn't work with Pop-ups.
    Thanks
    Raza

  • Exception handling issue

    I have a perplexing question.... I am in the midst of developing an APEX 4.0 application. Customer will NOT be going to4.1 for a while....I wish to have exception handling that will handle both APEX based interactions and some back-end Sql Loader activity.
    I have built an Exception handler that has a supporting APEX page to display a more human compatible error page, but am trying to make the exception handler NOT try and call up a page and such if the exception it encounters is a trigger being fired when a # of rows are being bulked loaded..
    Simply put.. In the exception handler, how can I have code branch around the fact I might NOT have an APEX application for it to display the error ...
    What I'd love to find is an object or variable that tells me what I am running the PL/SQL under..
    Thank you,
    Tony Miller
    Dallas, Tx

    Jari,
    If I try running this from SQL Plus, I would assume it would crash due to fact I am NOT running under APEX and can NOT see the Application object that this function is based upon:
    IS_SESSION_VALID Function
    This function is a Boolean result obtained from executing the current application's authentication scheme to determine if a valid session exists. This function returns the Boolean result of the authentication scheme's page sentry.
    Its like trying to figure out which came 1st, the chicken or the egg...
    Thank you,
    Tony Miller
    Dallas, TX

  • URGENT: Service Call Activity Issue

    Hi guys, I have a seriously irritating issue concerning the linking of an activity to service call.
    As of Service Pack 01, Patch 36 (at least as far as I know) I get the following error when attempting to create and link an activity to a service call:
    Error Code: -5002
    Error Description: A service call activity does not exist
    I use the folliwing code;
    If oServ.GetByKey(MRI) Then
                    If DocType = "QT" Then
                        oAct = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oContacts)
                        oAct.Activity = SAPbobsCOM.BoActivities.cn_Task
                        oAct.CardCode = oServ.CustomerCode
                        oAct.DocEntry = DocID
                        oAct.DocType = 23
                        oDoc = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)
                        If oDoc.GetByKey(DocID) Then
                            oAct.Notes = "Sales Quote: " & oDoc.Comments
                        End If
                        oAct.Details = "Sales Quote " & DocID & " auto created by MRI " & MRI & ""
                        If oAct.Add <> 0 Then
                            oApp.SetStatusBarMessage("Error adding Linked Document Activity for Sales Quote " & DocID & " : " & oComp.GetLastErrorDescription)
                            oLog.WriteLog("Error adding Linked Document Activity for Sales Quote " & DocID & " : " & oComp.GetLastErrorCode & oComp.GetLastErrorDescription, EventLogEntryType.Error)
                        Else
                            oServ.Activities.Add()
                            oServ.Activities.ActivityCode = oComp.GetNewObjectKey
                            oServ.Activities.SetCurrentLine(oServ.Activities.Count() - 1)
                        End If
    If oServ.Update <> 0 Then
                        oApp.SetStatusBarMessage("Error linking Expense Document " & DocID & ":" & oComp.GetLastErrorDescription)
                        oLog.WriteLog("Error linking Expense Document " & DocID & ":" & oComp.GetLastErrorCode & "-" & oComp.GetLastErrorDescription, EventLogEntryType.Error)
                    End If
    the Activity is added without any problem, but the error comes when linking it to the Service Call (oServ.Update)
    Can you please help, I'm going insane with this problem.

    this is how i got it to work:
    ServiceCalls sc = null;
    sc = (ServiceCalls)company.GetBusinessObject(BoObjectTypes.oServiceCalls);
    if (!sc.GetByKey(callId))
          throw new Exception("Failed to add service call activity! Service call does not exist!");
    if (sc.Activities.Count == 1)
             sc.Activities.SetCurrentLine(sc.Activities.Count - 1);
             string temp = sc.Activities.ActivityCode.ToString();
             if (!string.IsNullOrEmpty(temp) && !temp.Equals("0"))
                     sc.Activities.Add();
    else
             sc.Activities.Add();
    sc.Activities.SetCurrentLine(sc.Activities.Count - 1);
    sc.Activities.ActivityCode = int.Parse(lastAcctivity);
    if (sc.Update() != 0)
             company.GetLastError(out errorCode, out errorMsg);
              if (null != sc)
                      System.Runtime.InteropServices.Marshal.ReleaseComObject(sc);
                      sc = null;
    throw new Exception(errorCode + " -> " + errorMsg);
    You could either use that piece of code or make an insert in SCL5.

  • TaskFlow Exception Handler Behavior

    Hi all,
    I have a question about taskflow exception handler.
    My customer is using method-call exception handler to display error detail as FacesMessage dialog in their taskflow.
    And they are now trying to find the way to call exception handler but not to show the dialog in case that some sort of exceptions happen.
    To achieve this requirement they delete FacesContext.addMesage() from their exception handler, but when not call addMessage() they always get return code 500 (internal server error).
    From the behavior we've got, do we always need to call addMessage() in it to come back to original page?
    Regards,
    Atsushi

    Hi Frank,
    Thank you for your reply. Please let me ask you another question.
    When method-call error handler is executed it returns an outcome. And the outcome determines the next activity I get to.
    My question is whether it is a designed behavior of method-call error handler that when the below two conditions are met I get back to the original error page to see facesMessage dialog.
    1. The method-call outcome doesn't match any control flow case
    2. addMessage() is called in the method defined at method-call
    If any, I'd like to know how to get back the original page after error handler is executed without faces message.
    Thanks,
    Atsushi

  • Can a BPEL process wait for a second web service call

    Hi,
    My BPEL process is an asynchronous process, so the first web service call kicks off an instance of the process.
    what i want is somewhere down in the process i can put a "receive" shape to pause the process and wait for another web service call to come in, once the "receive" shape gets the second web service call, the process continues on.
    Is that a valid thing to do on BPEL?
    i don't seem to be able to get it working.
    i could change the WSDL for the BPEL process to publish two operations, the default "initiate" and another one called "continue", they both accept the same type of request message.
    but when i test it, the BPEL process just can't accept message at the second operation, it always creates a new instance to handle the web service calls, even when the call is targeting "continue" operation.
    Any ideas?
    Thanks in advance!

    I was just about to give up after the last post but then the "pick" shape hit my eye somehow ("thank God", that's all i can say)
    and it did the trick, the "pick" shape can wait for an incoming call from a partner link.
    so what i can achieve is this,
    the first web service call sends some thing like
    <Root><CorrelationId>1</CorrelationId><Content>first name</Content></Root>
    on the "initiate" operation, just like calling an "initiate" method in java code
    the BPEL instance gets initiated, reaches the "pick" shape and stops
    then a second web service call comes in as
    <Root><CorrelationId>1</CorrelationId><Content>last name</Content></Root>
    on the "continue" operation, again just like calling a "continue" method
    it works!

  • Web service handler could not registered/called in client web service

    Hi Expert,
    I have two web service ServiceA & ServiceB and both implemented in weblogic.
    The ServiceA is SSL enable and protocol is https which is not published by me.
    The ServieB is my web service(wls8.1) and act as client for ServiceA.
    My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.
    My service file:
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import weblogic.webservice.client.SSLAdapterFactory;
    import weblogic.webservice.client.WLSSLAdapter;
    public class HelloService {
    String wsdl = "https://188.122.123.23/RemoetService?WSDL";
    static     {
              SSLAdapterFactory factory =                SSLAdapterFactory.getDefaultFactory();
              WLSSLAdapter adapter = (WLSSLAdapter)     factory.getSSLAdapter();
              adapter.setTrustedCertificatesFile("D:\\lib\\certs\\cacerts");
              factory.setDefaultAdapter(adapter);
              System.setProperty("weblogic.xml.encryption.verbose","true");
              System.setProperty("weblogic.xml.signature.verbose","true");
              System.setProperty("weblogic.webservice.verbose","true");
         public String sayHello(String user) {
              RemoteService_Impl service = new RemoteService_Impl(wsdl);
              RemotePortType port = service.getRemoteServicePort1();
              String namespace = service.getServiceName()
                        .getNamespaceURI();
              QName portName = new QName(namespace,
                        "RemoteServicePortType");
              HandlerRegistry reg = service.getHandlerRegistry();
              List handlerList = new ArrayList();
              Map map = new HashMap();
              map.put("Username", "user1");
              map.put("Password", "pwd1");
              HandlerInfo info = new HandlerInfo();
              info.setHandlerClass(WSClientHandler .class);
              info.setHandlerConfig(map);
              handlerList.add(info);
              reg.setHandlerChain(portName,(List)handlerList);
              RemoteServiceResponse = port.callMe(name);
    My Handler Class:
    package com.test;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.soap.Name;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPHeaderElement;
    public class WSClientHandler implements Handler {
         private HandlerInfo handlerInfo;
         public WSClientAuthenticateHandler(){}
         public void init(HandlerInfo hi) {   
              System.out.println("Handler init");
              handlerInfo = hi;
         public void destroy() {
              System.out.println("Handler destroy method called");
              handlerInfo = null;
         public QName[] getHeaders() {
              System.out.println("Handler Header method called");
              try     {
                   Map map = handlerInfo.getHandlerConfig();
                   QName[] headers = handlerInfo.getHeaders();
                   System.out.println(" Config :"+map);
                   for(int i=0;i<headers.length;i++)     {
                        System.out.println(headers.getLocalPart()+" "+
                        headers[i].toString()+" "+headers[i].getNamespaceURI());
              }catch(Exception e)     {
                   e.printStackTrace();
              return handlerInfo.getHeaders();
         public boolean handleRequest(MessageContext mc) {   
              SOAPMessageContext smc = (SOAPMessageContext) mc;
              System.out.println("Calling handler class.....................");
              try     {
              SOAPEnvelope se =      smc.getMessage().getSOAPPart().getEnvelope();
              System.out.println("Calling handler class.....................");
         SOAPHeader soapHeader = se.getHeader();
         Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
         SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
         SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
         element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
         element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");
         System.out.println("Calling handler class.....................");
                   System.out.println("** Request: \n "+se.toString()+"\n");
              }catch(SOAPException e)     {
                   e.printStackTrace();
              return true;
         /** * Specifies that the SOAP response message be logged to a
         * log file before the
         * * message is sent back to the client application
         * that invoked the Web service.
         public boolean handleResponse(MessageContext mc) {  
              System.out.println("Handler Response method called");
              SOAPMessageContext messageContext = (SOAPMessageContext) mc;
              System.out.println("** Response: \n"+messageContext.getMessage().toString()+"\n");
              return true;
         /** * Specifies that a message be logged to the log file if a SOAP fault is
         * * thrown by the Handler instance.
         public boolean handleFault(MessageContext mc) {   
              SOAPMessageContext messageContext = (SOAPMessageContext) mc;
              System.out.println("** Fault: \n"+messageContext.getMessage().toString()+"\n");
              return true;
    Please need help here.
    Thanks in Advance,
    pps

    I have tested static client calling using handler simple above service and found the issues.
    QName portName = new QName(namespace,
    *"RemoteServicePortType");*
    The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).
    <?xml version="1.0"; encoding="UTF-8"?>
    <definitions name="HelloService"
    targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="SayHelloRequest">
    <part name="firstName" type="xsd:string"/>
    </message>
    <message name="SayHelloResponse">
    <part name="greeting" type="xsd:string"/>
    </message>
    <portType name="*RemoteServicePortType*">
    <operation name="sayHello">
    <input message="tns:SayHelloRequest"/>
    <output message="tns:SayHelloResponse"/>
    </operation>
    </portType>
    <binding name="Hello_Binding" type="tns:*RemoteServicePortType*">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
    <soap:operation soapAction="sayHello"/>
    <input>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </input>
    <output>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </output>
    </operation>
    </binding>
    <service name="Hello_Service">
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType1*">+
    +<soap:address+
    location="http://host1:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType2*">+
    +<soap:address+
    location="http://host2:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType3*">+
    +<soap:address+
    location="http://host3:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType4*">+
    +<soap:address+
    location="http://host4:8080/soap/servlet/rpcrouter"/>
    +</port>+
    </service>
    </definitions>
    From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="*RemoteServicePortType1*) which is not matching with PortType (portType name="*RemoteServicePortType*")
    even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.
    Please guide me here how i specify correct portname which can call Handler class also.
    Thanks in advance,
    pps

  • Exception Handling with OC4J Web Services

    Hi,
    I want to throw some custom exceptions from my web services, based upon my business logic. From the documents I came to know that I can use "javax.xml.rpc.soap.SOAPFaultException" for the same. Following is the sample web service code which I'm trying in my environment.
    import javax.ejb.Stateless;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.soap.SOAPFaultException;
    @WebService
    @Stateless
    public class TestService {
         @WebMethod
         public void greeting()
              throw new SOAPFaultException(new QName("uri", "local"),
         "My Fault String", "My Fault Actor", null);
    Deployment of the web service goes fine and on the invocation of the "greeting" operation the exception is being thrown. But the problem is that, the soap response, which my web service client receives is as of follows,
    <env:Envelope
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns0="http://service.csm.nb.md.inglife.jp.co/">
    <env:Body>
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring>Internal Server Error (Caught exception while handling request: oracle.oc4j.rmi.OracleRemoteException: javax.xml.rpc.soap.SOAPFaultException: My Fault String; nested exception is: javax.xml.rpc.soap.SOAPFaultException: My Fault String)</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    This means that OC4J again wraps the SOAPFaultException thrown by me. Is there any way by which I can avoid the further wrapping of my exceptions? If there is anything wrong in my approach please do let me know.
    Regards,
    Dipu

    This is one of the "classic" design problems in this kind of architecture. And, unfortunately, the answer is "it depends on how you think you need to handle it." And I'm sure there are plenty of "gurus" that will tell you one way or another is the only way to do it.
    I'll be more honest: I'll give you a couple of personal suggestions, based on experience in this architecture. These are suggestions - you may do with them what you will. I will not say this is the best, most correct, or even remotely relevant to what you're doing.
    If it's simple data validation for "typing" (e.g. String, number, Date, etc.), that is taken care of when you attempt to stuff in the information into the appropriate DTO. If it's more "sophisticated" than that (must be in a certain range, etc.), that particular checking should probably be delegated from your Controller to a helper class. That not only saves the "expense" of transmitting the information back and forth across the wire, it's "faster" to the end user so say "Ooopsie" by redirecting back to the form right then. Basically the same thing if the types are wrong.
    That only leaves the "big" problems in the business layer (EJBs), where you have to deal with concurrency, database failures, etc. Generally these kinds of exceptions are thrown back to to the Controller in one of two forms:
    1) a sublass of RuntimeException, which signals that some Very Bad Things have happened in your container. EJBException is one like that and you can see where it's being thrown from.
    2) a subclass of Exception, also called "application exceptions." They are usually something like a "duplicate record" or a validation-like error (which you mentioned) like a missing field. They're used as a signal to a failure in the logic, not the container. That way you have to decide at what layer of your architecture they should be handled and/or passed on to the next.

  • PDFObjectRuntimeException: Service call exception

    Hi,
    i'd like to use Adobe Interactive Forms to let a user to
    fill in data and to merge this information with other generated information into a resulting pdf document.
    When i go to the view (in a java web dynpro) i get the following exception:
    com.sap.tc.webdynpro.pdfobject.core.PDFObjectRuntimeException: Service call exception; nested exception is:
         com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (404) Not Found.
         at com.sap.tc.webdynpro.pdfobject.core.PDFObject.doSoapCall(PDFObject.java:282)
         at com.sap.tc.webdynpro.pdfobject.core.PDFObject.createPDF(PDFObject.java:224)
         at com.sap.tc.webdynpro.clientserver.adobe.AdobeFormHelper.createPDFDocumentForUIElement(AdobeFormHelper.java:483)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:185)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.afterHandleActionEvent(ClientApplication.java:1154)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:402)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
    Caused by: java.rmi.RemoteException: Service call exception; nested exception is:
         com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (404) Not Found.
         at com.sap.tc.webdynpro.adsproxy.ConfigBindingStub.rpData(ConfigBindingStub.java:85)
         at com.sap.tc.webdynpro.adsproxy.ConfigBindingStub.rpData(ConfigBindingStub.java:95)
         at com.sap.tc.webdynpro.pdfobject.core.PDFObject.doSoapCall(PDFObject.java:279)
         ... 27 more
    Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (404) Not Found.
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.handleResponseMessage(MimeHttpBinding.java:834)
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1238)
         at com.sap.tc.webdynpro.adsproxy.ConfigBindingStub.rpData(ConfigBindingStub.java:78)
         ... 29 more
    The mode property of the AIF is set to updateDataInPdf (the same exception occurs using the createPdf mode).
    Product info:
    Server:
    Web Dynpro Runtime Vendor: SAP, Build ID: 6.4014.00.0000.20060719132130.0000 (release=NW04_14_REL, buildtime=2006-07-19:23:04:47[UTC], changelist=19247, host=PWDFM087)
    J2EE Engine 6.40 patchlevel 100381.311
    Java VM Java HotSpot(TM) Server VM, version:1.4.2_07-b05, vendor: Sun Microsystems Inc.
    Operating system Windows 2003, version: 5.2, architecture: x86
    Web Dynpro Code Generation Infos
    SapDictionaryGenerationCore 6.4014.00.0000.20050818151336.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:08:16[UTC], changelist=363802, host=PWDFM026.wdf.sap.corp)
    SapDictionaryGenerationTemplates (unknown)
    SapGenerationFrameworkCore 6.4014.00.0000.20050818152155.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:01:32[UTC], changelist=363812, host=PWDFM026.wdf.sap.corp)
    SapIdeWebDynproCheckLayer 6.4014.00.0000.20050818152737.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:15:40[UTC], changelist=363825, host=PWDFM026.wdf.sap.corp)
    SapMetamodelCommon 6.4014.00.0000.20050818152303.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:02:26[UTC], changelist=363816, host=PWDFM026.wdf.sap.corp)
    SapMetamodelCore 6.4014.00.0000.20050818152303.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:02:18[UTC], changelist=363816, host=PWDFM026.wdf.sap.corp)
    SapMetamodelDictionary 6.4014.00.0000.20050606171352.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:05:38[UTC], changelist=351719, host=PWDFM026.wdf.sap.corp)
    SapMetamodelWebDynpro 6.4014.00.0000.20050818152356.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:11:31[UTC], changelist=363818, host=PWDFM026.wdf.sap.corp)
    SapWebDynproGenerationCTemplates 6.4014.00.0000.20050905165427.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:26:31[UTC], changelist=366934, host=PWDFM026)
    SapWebDynproGenerationCore 6.4014.00.0000.20050818152737.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:16:08[UTC], changelist=363825, host=PWDFM026.wdf.sap.corp)
    SapWebDynproGenerationTemplates 6.4014.00.0000.20050905165427.0000 (release=630_VAL_REL, buildtime=2005-09-09:20:26:31[UTC], changelist=366934, host=PWDFM026)
    sap.com/tcwddispwda
    No information available
    sap.com/tcwdcorecomp
    No information available
    Adobe Document Server version is NW04 SPS 14
    Any comments are appreciated.
    regards
        Dirk

    Apparently the ADS was not configured.
    One can check this using the following URL as
    template:
    http://<server>:<port>/AdobeDocumentServices/Config
    See also the thread Re: ADS Error for interactive forms
    regards
         Dirk

  • Service call Exception : ClassNotFoundException XMLTokenReader

    Hi All,
    I am trying to call a webservice using a StandAloneProxy generated by Netweaver. <b>The call works fine when called from a POJO.</b> But when deployed and called from a jsp page, it returns the following error. I've included sapxmltoolkit.jar that holds XMLTokenReader class but to no avail.
    <i>java.rmi.RemoteException: Service call exception; nested exception is:
         java.lang.ClassNotFoundException: com.sap.engine.lib.xml.parser.tokenizer.XMLTokenReader
    Found in negative cache
    Loader Info -
    ClassLoader name: [rim.com/eSellingWebAppFS]
    Parent loader name: [Frame ClassLoader]
    References:
       common:service:http;service:servlet_jsp
       service:ejb
       common:service:iiop;service:naming;service:p4;service:ts
       service:jmsconnector
       library:jsse
       library:servlet
       common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl
       library:ejb20
       library:j2eeca
       library:jms
       library:opensql
    .........</i>
    <b>Error causing code:</b>
        Z_ES_CUSTOMER_SEARCHResponse custSearchResponse = new Z_ES_CUSTOMER_SEARCHResponse();
        Z_ES_CUSTOMER_SEARCHServiceImpl serviceImpl = new Z_ES_CUSTOMER_SEARCHServiceImpl();
        Z_ES_CUSTOMER_SEARCHPortType servicePort = serviceImpl.getLogicalPort();
        ((Stub)servicePort)._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,authUsername);
        ((Stub)servicePort)._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,authPassword);
        Z_ES_CUSTOMER_SEARCH params = new Z_ES_CUSTOMER_SEARCH();
        ZESCRITERIA zescriteriaArr[] = new ZESCRITERIA[criteriaList.size()];
        Iterator criteriaIter = criteriaList.iterator();
        int index = 0;
        while(criteriaIter.hasNext()) {
         SearchCriteria criteria = (SearchCriteria)criteriaIter.next();
         ZESCRITERIA zescriteria = new ZESCRITERIA();
         zescriteria.setOBJECT(SearchCriteria.CUSTOMER_OBJECT);
         zescriteria.setOPERATION(criteria.getSearchOperation());
         zescriteria.setSEARCH_NAME(criteria.getSearchName());
         zescriteria.setHIGH(criteria.getHighValue());
         zescriteria.setLOW(criteria.getLowValue());
         zescriteriaArr[index++] = zescriteria;
        params.setSEARCH_CRITERIA(zescriteriaArr);
        params.setRESULT_SET(new ZESKUNNRHITS[0]);
        params.setRETURN(new BAPIRET2[0]);
        params.setSEARCH_OBJECT(SearchCriteria.CUSTOMER_OBJECT);
        Z_ES_CUSTOMER_SEARCHResponse response = servicePort.z_ES_CUSTOMER_SEARCH(params); <b><<---- ERROR</b>

    We have come across exactly the same problem, but with a "deployable proxy". We are using stack 16.
    We are calling a web service exposed by BW, and the response seems to generate this documented error.
    (please see error info below)
    Has anyone else come across this problem, and more importantly, the solution?
    If you need more technical specs, I can provide it.
    Thanks in advance !
    HTTP/1.1 500 Internal Server Error
    Connection: close
    Server: SAP J2EE Engine/6.40
    Content-Type: text/xml; charset=UTF-8
    Date: Thu, 04 May 2006 15:36:26 GMT
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Erreur lors de l'appel du proxy BW
    java.rmi.RemoteException: Service call exception; nested exception is:
         java.lang.ClassNotFoundException: com.sap.engine.lib.xml.parser.tokenizer.XMLTokenReader
    Found in negative cache
    Loader Info -
    ClassLoader name: [sap.com/TestBWProxy]
    Parent loader name: [Frame ClassLoader]
    References:
       common:service:http;service:servlet_jsp
       service:ejb
       common:service:iiop;service:naming;service:p4;service:ts
       service:jmsconnector
       library:jsse
       library:servlet
       common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl
       library:ejb20
       library:j2eeca
       library:jms
       library:opensql
       common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:userstore
       interface:resourcecontext_api
       interface:webservices
       interface:cross
       interface:ejbserialization
    Resources:
       /usr/sap/DA1/DVEBMGS91/j2ee/cluster/server0/apps/sap.com/TestBWProxy/webservices_container/wsClients/ws_cl_0/jars/com.hydroquebec.test.bw.proxy.BWProxy.jar
       /usr/sap/DA1/DVEBMGS91/j2ee/cluster/server0/apps/sap.com/TestBWProxy/webservices_container/wsClients/app_jars/TestBWProxy.jar
    Loading model: {parent,references,local}
         at com.hydroquebec.test.bw.proxy.Z_RRW3_GET_QUERY_VIEW_DATASoapBindingStub.RRW3_GET_QUERY_VIEW_DATA(Z_RRW3_GET_QUERY_VIEW_DATASoapBindingStub.java:98)
         at com.hydroquebec.test.bw.ejb.TestBWBean.getQueryData3(TestBWBean.java:93)
         at com.hydroquebec.test.bw.ejb.TestBWLocalLocalObjectImpl0.getQueryData3(TestBWLocalLocalObjectImpl0.java:177)
         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:324)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.ClassNotFoundException: com.sap.engine.lib.xml.parser.tokenizer.XMLTokenReader
    Found in negative cache
    Loader Info -
    ClassLoader name: [sap.com/TestBWProxy]
    Parent loader name: [Frame ClassLoader]
    References:
       common:service:http;service:servlet_jsp
       service:ejb
       common:service:iiop;service:naming;service:p4;service:ts
       service:jmsconnector
       library:jsse
       library:servlet
       common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl
       library:ejb20
       library:j2eeca
       library:jms
       library:opensql
       common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:userstore
       interface:resourcecontext_api
       interface:webservices
       interface:cross
       interface:ejbserialization
    Resources:
       /usr/sap/DA1/DVEBMGS91/j2ee/cluster/server0/apps/sap.com/TestBWProxy/webservices_container/wsClients/ws_cl_0/jars/com.hydroquebec.test.bw.proxy.BWProxy.jar
       /usr/sap/DA1/DVEBMGS91/j2ee/cluster/server0/apps/sap.com/TestBWProxy/webservices_container/wsClients/app_jars/TestBWProxy.jar
    Loading model: {parent,references,local}
         at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:348)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at com.sap.engine.services.webservices.jaxrpc.encoding.SimpleValidator.checkMaxLengthString(SimpleValidator.java:77)
         at com.hydroquebec.test.bw.proxy.types.Char22.deserialize(Char22.java:36)
         at com.sap.engine.services.webservices.jaxrpc.encoding.InstanceBuilder.readElement(InstanceBuilder.java:603)
         at com.sap.engine.services.webservices.jaxrpc.encoding.InstanceBuilder.readSequence(InstanceBuilder.java:829)
         at com.sap.engine.services.webservices.jaxrpc.encoding.InstanceBuilder.readContent(InstanceBuilder.java:955)
         at com.sap.engine.services.webservices.jaxrpc.encoding.GeneratedComplexType.deserialize(GeneratedComplexType.java:1723)
         at com.sap.engine.services.webservices.jaxrpc.encoding.DocumentArrayBuilder.readContent(DocumentArrayBuilder.java:82)
         at com.sap.engine.services.webservices.jaxrpc.encoding.GeneratedComplexType.deserialize(GeneratedComplexType.java:1656)
         at com.sap.engine.services.webservices.jaxrpc.encoding.InstanceBuilder.readElement(InstanceBuilder.java:603)
         at com.sap.engine.services.webservices.jaxrpc.encoding.InstanceBuilder.readSequence(InstanceBuilder.java:829)
         at com.sap.engine.services.webservices.jaxrpc.encoding.InstanceBuilder.readContent(InstanceBuilder.java:955)
         at com.sap.engine.services.webservices.jaxrpc.encoding.GeneratedComplexType.deserialize(GeneratedComplexType.java:1723)
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.getResponseDocument(MimeHttpBinding.java:1104)
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1432)
         at com.hydroquebec.test.bw.proxy.Z_RRW3_GET_QUERY_VIEW_DATASoapBindingStub.RRW3_GET_QUERY_VIEW_DATA(Z_RRW3_GET_QUERY_VIEW_DATASoapBindingStub.java:86)
         ... 27 more
    </faultstring><detail><ns1:getQueryData3_com.hydroquebec.sap.integration.infra.ExceptionTransactionSAP xmlns:ns1='urn:TestBWWsd/TestBWVi'></ns1:getQueryData3_com.hydroquebec.sap.integration.infra.ExceptionTransactionSAP></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

  • Will Service call out return an exception with an object embedded in it

    Hi,
    I have a service callout in a request pipeline.Service will throw an exception with a custom object embedded inside the exception.When i see the response $fault in the service error handler, i dont see the object.Is this something which can be done or not?if yes then guide me through it.

    Hi,
    If you invoke the service call out, and it returns a soap fault (make sure that it returns http 500), so you should be able to access the custom fault element inside $fault/con:details/con1:ReceivedFaultDetail/con1:detail
    Are you sure that your webservice is returning the fault properly?
    Are you not raising a new error after getting the response in the error handler, right?
    Regards,
    Fabio Douek.

Maybe you are looking for

  • PCI-E graphics card and system memory conflict.

      Hello, I have a bit of a strange problem with my new system build. All my parts work fine when used by them selves. MSI KN8 diamond. Athlon 3200 64bit 939 Winchester. Crucial Ballistix PC4000 memory. Inno3D 6800GT PCI-E Thermaltake purepower 680W.

  • Remote database????

    Hihi.. I need to do my application in a way that... the database will be in a remote location (server side) and can be accessed by users from other locations. For example, a user wants to login to the application and to check if he has entered the co

  • Trying to download an app and it keeps saying incorrect password after I changed it

    Hi all I'm trying to download an app. Forgot my password, so reset it. When I go back in to apps and put the new password in it still won't let me download. Keeps saying incorrect password I've powered down. Not sure what else to do

  • DreamViewer CC design theme

    Hello. More than a question this is a sugerence, I'd like that if you could add a pluggin or an update for changing window theme color, to darker one. I heard about this to another webprogrammers. Thank you for considering this possibility.

  • Can't set up my email. I use StartLogic but can only get my mail going to their site.

    SL gave me some numbers for the in and out ports but I only saw one port in Advanced. Thanks