TransactionRolledbackException obscuring custom exception

I could use some input on the following issue:
I have an Order SSB that uses a Catalog SSB. When the Catalog SSB encounters an (expected) error condition, it throws a CatalogException that extends RemoteException. The message that's stuffed in the CatalogException needs to be passed back to the client. What happens, however, is that the CatalogException gets nested in a TransactionRolledbackException before the Order SSB can process it, so the message is buried in the nested exception.
A couple questions: 1) Is this always the case, i.e., an exception thrown in an SSB is going to get wrapped in a TransactionRolledbackException?
2) Can I get to the message in the nested exception without complicated parsing?
Any input would be appreciated.

You should never use RemoteException - that's more-or-less "reserved" for the server vendor to signal to the application that the remote protocol is not working correctly. Same for EJBException (but that's more of a "my application server is crashing into smoking ruins" exception). If you want to use an exception, create your own subclass from Exception or RuntimeException. Or use one of the "stock" ones, such as IllegalArgument exception. Don't use NullPointerException - that's not a helpful one for an application to throw by itself.
If you're using Container-managed transactions, a subclass of Exception will not automatically roll-back the CMT, whereas a subclass of RuntimeException will. Neither will directly affect a client-initiated transaction.
Oh, and by the way - Exception is a subclass of Throwable, which already implements Serialiable.

Similar Messages

  • What factors should be taken into account for Custom Exceptions

    hi,
    I just want to know that What factors should be taken into account for making Custom Exceptions.
    any examples will appreciated.
    regards,
    vjoy

    Do you want this to be checked exception? If so extend it from Exception or subclass of it. If it is unchecked exception (not forced by javac to be caught by callers), then extend it from RuntimeException or subclass of it. Exceptions are serializable objects and so have serialVersionID field. Also, to allow for exception chaining, define a constructor that accepts "cause" (http://java.sun.com/j2se/1.4.2/docs/guide/lang/chained-exceptions.html)

  • How to access custom exception in client side in web services?

    I have an interface and implementation of a java web services. One method in it throws a custom exception indicating the error type (authrization fails, db connection lost, etc...). But in the generated proxy file, the catched exception for the correspondent method becames java.lang.Exception. I check the code and found the actual thrown exception is com.apache.soap.SOAPExcetion. In the client code, I printed out all the SOAPExcetion and related Fault messages but could not find my original custom exception info. I need this custom exception to be accessed to the client so the client knows what's wrong.

    for current user, SPGroup.ContainsCurrentUser
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spgroup.containscurrentuser.aspx
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Native C++ Custom Exception Not Recognized

    Hi,
    I'm having a problem with the native part of my code when throwing a custom exception. It is never caught when the exception is thrown in a separate class, it always falls in the generic catch(...) section. I know this problem has something to do with JNI and Java since running a C++ test program doing the same thing recognizes the exception and catches it.
    My Program is something like this
    Java Part:
    public class RunException {
      public static void main(String args[]) {
         doSomething();
    }C++ Part:
    class CustomException: public exception {
       public :
           exception() {};
    class CatchException: public exception {
       public:
          doSomething() {
            try {
               throwException->throwException();
               throw CustomException(); //this would have been caught in catch(CustomException)
            }catch(CustomException e) {
             //never goes in here
            catch(int e) {
             //this works
            catch(...) {
            //always goes ends up here here
    class ThrowException {
      public:
        throwException() {
           throw CustomException(); //this ends up in catch(...)
           //throw 1 - throwing an integer would work
    } I'm not sure what's causing this but I'm guessing it has something to do with loading and linking or maybe some sort of JVM security policy/behavior? Any help would be greatly appreciated.
    Edited by: z3n3r on Nov 13, 2008 7:51 PM

    Never seen this. Some comments on your C++:
    class CustomException: public exception {
    public :
    exception() {};That should be CustomException() {}
    }catch(CustomException e) {That should be catch (CustomException &e). Never catch exceptions by value.
    throwException() {That should be throwException() throw(CustomException) {}, although good old MSVC still ignores it 15 years later ...

  • Webservices and custom exception handling

    hi all,
    I have one ejb method which promote as webservices.
    @WebMethod
    @Oneway
    public void test(String arg) throws STARS21BOException{
    my Custom Exception class STARS21BOException extends from EjbException and it has no-arg constructor.
    but when i deploy on server i get following exception.
    if i remove throws clause from method, it is working fine.
    javax.xml.ws.WebServiceException: Unable to create JAXBContext
         at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)
         at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
         at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:271)
         at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:351)
         at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:201)
         Truncated. see log file for complete stacktrace
    Caused By: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.lang.StackTraceElement does not have a no-arg default constructor.
         this problem is related to the following location:
              at java.lang.StackTraceElement
              at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
              at java.lang.Throwable
              at java.lang.Exception
              at public java.lang.Exception sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean.causedByException
              at sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:148)
         at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
         at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:271)
         at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:351)
         Truncated. see log file for complete stacktrace
    Caused By: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.lang.StackTraceElement does not have a no-arg default constructor.
         this problem is related to the following location:
              at java.lang.StackTraceElement
              at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
              at java.lang.Throwable
              at java.lang.Exception
              at public java.lang.Exception sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean.causedByException
              at sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean
         at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
         at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
         Truncated. see log file for complete stacktrace
    >
    <Apr 23, 2010 10:51:33 AM SGT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1271991082383' for task '2'. Error is: 'weblogic.application.ModuleException: Exception activating module: EJBModule(ejb-showcaseEJB.jar)

    newt.mm wrote:
    @WebMethod
    @Oneway
    public void test(String arg) throws STARS21BOException{
    }As per method signature it is asynchronous web service however you are trying to throw soap fault. Isn't the soap fault is also a kind of response?
    Do you really want your web method to be asynchronous?

  • Custom exceptions and carrying forward stack trace

    Hi, I have a question on exception handling.
    I have written an application which has several custom exceptions. When an exception occurs, sometimes I throw it and then when its caught, wrapping it in another exception like so:
    } catch (Exception e){
    throw new CollectionFailedException(this.getName() + " could not get collection", e);
    This works fine, but when I output the stacktrace, it only goes as far as the new exception, making things more difficult to debug. Is there any way of incrementing the stack trace using the first exception?
    Many thanks for any help offered!
    Marc

    Marc, this is expected behaviour. When you throw a new exception, the stacktrace starts off at the new one. A really nice explanation and sample code for creating new Exceptions and extending the Exception class is located at:
    http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions.html
    Good luck, fstream

  • Raise custom exception

    Hi experts,
    I have synchronous scenario and in response inbound message I have Fault type ft_my_error_message.
    My question is: how I can raise my custom exception ft_my_error_message in mapping.
    I would like to send some information in my custom exception and catch it in ABAP proxy. With
    throw new StreamTransformationException("my message"); 
    I’m losing response message and in ABAP proxy I don’t know is my custom error occurred or something else.
    Thanks
      Vedran

    Hi Vedran
    Based on the discussion above, it looks like the JDBC call returns the error on the RESPONSE message and do not have a FAULT message type, is that right? Also, you mentioned ABAP proxy, so I'm guessing your scenario is synchronous Proxy to JDBC.
    If the JDBC call does not have a FAULT message, AFAIK I don't think you can map this back to the Proxy fault message.
    An alternative approach would be to map back the JDBC response to the Proxy response, and handle this in the ABAP proxy.
    In the proxy coding, you can check for the values in the response for an indicator of the error. If an error happens, you can raise an exception there. You can check out the link below on how to raise fault messages in the proxy.
    https://help.sap.com/saphelp_nw04/helpdata/en/5d/a45c3cff8ca92be10000000a114084/content.htm
    If you use the application log, or have access to error information from a BAPI return table, you can also use these directly to complete the fault message. In this case, you only need to call the methodCL_PROXY_FAULT=>RAISE of the proxy runtime to trigger the error:
    CALL METHOD cl_proxy_fault=>raise
      EXPORTING
       exception_class_name   = <Name of Exception Class>  
       application_log_handle = < Application Log: Handle of a Protocol>  
       bapireturn_tab         = < Table with BAPI Return Information>.
    The exception class name would be the proxy generated class based on the custom fault type that you declared for the proxy service interface.
    Once the exception is raised in the ABAP proxy, you will see this as an "Application Error" in SXMB_MONI of your ECC system.
    Rgds
    Eng Swee

  • How to use customized exception

    Hi all,
    I have a problem using struts-action-mappings.
    I have a method for update in my app module, and i'm using that method with data action.
    In that method, I have to throw my customized exception to user if there is error. I just don't know how to catch the exception and display it in page.
    I've read about struts page flow diagram elements and know there are Exceptions and Global Exceptions. But i still don't know how to use them.
    What i want to know is can I relate my custom exception with Exceptions/Global Exceptions in struts diagram? And if so, can anybody show me an example for it?
    Thanks

    1.Create a method GET_ACTORS using RH_GET_ACTORS,
    2.Create a container element 'Actors' type string with multiline.
    3.Create Task, where you can call the Method GET_ACTORS  and pass the Container values of 'Actors' from Method->Task->Workflow
    4.Create a Step type before creating the Step mail and include the previous Task.
    5.Now you can create the step Mail. Give the Recipient Type as 'Expression'-> Select the Container Element 'Actors' from WF container
    But remember the values should be Passed from the task to Workflow in Binding correctly.
    Regards,
    Sriyash

  • Raising Custom Exceptions in RMI

    hi all,
    i have a problem. i have an RMI server that makes use of some classes. in those classes, i am raising exceptions.
    problem is that the first time that those classes are called, the correct custom exception is raised.
    all the following times, i receive a java.util.EmptyStackException, and looking at the log file that i write, it seems that the call never reaches the inteded class.
    All the custom exceptions that i use extends the java.lang.Exception class
    can anyone explain me why i got this weird behaviour??
    thanx in advance and regards
    marco

    What was the resolution to this. I am getting an EmptyStackException running a application with 50 threads. I get this exception in one thread and recover OK. I get the exception in another thread and the whole process hangs! Any thoughts?

  • Mapping custom faults to custom exceptions

    Hello all,
    I defined a web service that could thow for some operations custom faults. These custom faults were manually defined in the WSDL file of the web service. I sent some request messages to the web service and I received the result and everything seems to be fine.
    I automatically generated the Java stub/client, but it seems that the client doesn't receive custom exceptions for the corresponding custom faults defined in the WSDL file. I would like that, in the Java client, for the custom faults defined in the WSDL for the operations exposed, the client to receive corresponding custom exceptions. I work with JDev 9.0.5, OC4J 10g 9.0.4. release. Is this possible in that release? I knew that there were limitations regarding JAX-RPC in that release... If not, will this be available in 10.1.3 release?
    As an additional info, I tried to generate the Java client stub with AXIS WSDL2Java tool. Also, I received a generic exception for the custom faults, due to the fact that for the custom exceptions (from code generated by axis tools) to work, you need axis both on client and the server.
    Many thanks in advance!
    Regards,
    Marinel

    Hi,
    I'm uncertain about 9.0.4/10.1.2 (I will investigate further), but 10.1.3 supports fault to exception and exception to fault mappings.

  • EDT custom exception handler

    Hi,
    Is there any posibility to add custom exception handler to EDT? I'm thinking to implement an automatic feed-back from a client aplication. When an exception occurs in EDT it will automatically send to server. The problem is that unsigned webstart application have no permissions to call Thread.setUncaughtExceptionHandler() on EDT.
    Is there any workaround?
    Anton

    Hi,
    Is there any posibility to add custom exception handler to EDT? I'm thinking to implement an automatic feed-back from a client aplication. When an exception occurs in EDT it will automatically send to server. The problem is that unsigned webstart application have no permissions to call Thread.setUncaughtExceptionHandler() on EDT.
    Is there any workaround?
    Anton

  • Throwing MbeanException wrapping custom exception

    Iam throwing a mbean exception which wraps a custom exception from mbean.
    Iam invoking this mbean from wlst(python script) and Iam trying to catch this MBeanException
    When i try to use the getCause method i get the following exception .
    "java.rmi.UnmarshalException: Problem finding error class; nested exception is:
    java.lang.ClassNotFoundException: Failed to load class oracle.webcenter.lifecycle.exception.LifecyclePortalGuidMisMatchException"
    Please note that the python script is aware of the custom exception (LifecyclePortalGuidMisMatchException).
    For testing purpose, to confirm this, i have also created an instance of LifecyclePortalGuidMisMatchException in python (before invoking the mbean)
    The complete exception stack
    java.rmi.UnmarshalException: Problem finding error class; nested exception is:
    java.lang.ClassNotFoundException: Failed to load class oracle.webcenter.lifecycle.exception.LifecyclePortalGuidMisMatchException
    javax.management.MBeanException
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:223)
    at javax.management.remote.rmi.RMIConnectionImpl_1035_WLStub.invoke(Unknown Source)
    at weblogic.management.remote.common.RMIConnectionWrapper$16.run(ClientProviderBase.java:919)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.security.Security.runAs(Security.java:61)
    at weblogic.management.remote.common.RMIConnectionWrapper.invoke(ClientProviderBase.java:917)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:993)
    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 org.python.core.PyReflectedFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyObject.invoke(Unknown Source)
    at ora_mbs$py.invoke$8(/ade/aimmanue_pt/oracle/oracle_common/common/wlst/lib/ora_mbs.py:56)
    at ora_mbs$py.call_function(/ade/aimmanue_pt/oracle/oracle_common/common/wlst/lib/ora_mbs.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyObject.invoke(Unknown Source)
    at LifecycleHandler$py._doScopeImport$26(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/LifecycleHandler.py:892)
    at LifecycleHandler$py.call_function(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/LifecycleHandler.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at ExpImpHandler$py.importGroupSpaces$9(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/ExpImpHandler.py:113)
    at ExpImpHandler$py.call_function(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/ExpImpHandler.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    Could you let me who why iam not able to get the cuase of the exception when the client is aware of the exception
    Edited by: user510156 on Aug 20, 2012 6:43 AM
    Edited by: user510156 on Aug 20, 2012 6:49 AM

    Hi,
    There is no API to provide this functionality. The reason is the XI message processing is through pipeline as you know. And this is nothing but SAP specific services. So you can not alter them as they are. For the request that you are asking, you will have to edit the pipeline step that populates the SAP:ERROR node. For this, we need to identify which service does this and then if it is possible to write a user exit, etc...So in this case, I would suggest you go with raising an OSS note.
    However, can you please tell us why is this required? I can understand to send a message/mail if you get an error or something like that. But I am not able to figure out in what scenarios would you require this kind of error display.
    Thanks and Regards,
    Sarath.

  • Customer : Exception 7 in function module VIEW_KUxxV

    Hi,
    While Billing facing this problem
    00 Customer : Exception 7 in function module VIEW_KUxxV
    10 The bill-to party could not be determined
    10 The payer could not be determined
    tx in advance
    Bhushan Kolte

    Hello Colleague;
    Please check the account group assignment to the partner functions in   
    transaction VOPA click on partner function button then environment      
    then Account group assignment. Please ensure that this is all configured
    correctly for the partners.                                                                               
    Please also review the note                                    
    -> 80233   Debit-side settlement: Customizing, error messages                                                                               
    In particular the section:                                              
    VF083: 'Customer &: Exception & in function module VIEW_KUAGV'                                                                               
    The error message is generated because of a program error that          
    has since been corrected. The correct error message is VP304,           
    'Customer belongs to customer group & and thus cannot be the            
    sold-to party'.                                                                               
    The partner roles in the customer master are incorrectly set, see       
    below.                                                                               
    Recommendation: Assign the customer an account group which              
    already fulfills these criteria. (In the standard system, this is       
    Account group '0001).                                                                               
    I hope this helps resolve the error.
    Regards
    Ruy Castro

  • Is Custom Exception is memory consuming????

    Hi Friends,
    Somebody saying that having custom exception is very costlier. Is it correct????. I found some article says that custom exception will increasing the memory footprint of code.
    can anybody explain me how this cusom exception is costlier.......
    Rgds,
    Venkatesh P.

    Hi Friends,
    Somebody saying that having custom exception is
    very costlier. Is it correct????. No.
    Every class you load and every object you instantiate, including custom exceptions, consumes some memory, but "very costlier"? No.
    At any given moment, your program will probably have thousands--maybe millions--of live objects and dozens or hundreds of classes. The handful of custom exception objects that might be live at once will not add noticeably to that.

  • Custom Exceptions

    Hi all,
    Is it possible to throw custome exceptions from web services that can be caught in the clients of the Web service? If so, how can this be done?
    I have a java class exposed as a web service that throws custom exceptions, but the client gets these exceptions as SOAP Fault. I see that the client proxy, that is generated by 9iAS, has the method signature for all my methods as throwing Exceptions. Does this need to be changed manually in the client proxy??
    Any ideas would be greatly appreciated.
    Regards,
    Vijay

    I see a problem with how OC4J 10.1.3 handles custom exceptions in a bottom-up web service. I think the DP4 version handled this better unless I 'm missing something.
    I have a bottom-up web service whose methods throw a custom exception declared as:
    public class RemoteWebServiceException extends Exception implements Serializable {
    // 4 attributes
    The WSDL generated by OC4J 10.1.3DP4 (works better for me) looks like this:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <complexType name="RemoteWebServiceException">
    <sequence>
    <element name="faultActor" type="string" nillable="true"/>
    <element name="faultCode" type="QName" nillable="true"/>
    <element name="faultString" type="string" nillable="true"/>
    <element name="localizedMessage" type="string" nillable="true"/>
    <element name="message" type="string" nillable="true"/>
    </sequence>
    </complexType>
    The WSDL generated by OC4J 10.1.3 (creates problems for me) looks like this:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <complexType name="RemoteWebServiceException">
    <sequence/>
    </complexType>
    My exception class has not changed. My build process has not changed. I use oracle.j2ee.ws.tools.wsa.cli.ant.GenProxy task. Do I need to pass some extra flags with the OC4J 10.1.3 production version to get the same behavior as DP4?

Maybe you are looking for

  • How to create a slideshow at homepage

    how to create a slideshow at homepage like this http://www.thinkfa.com/ if I have to using java script, how do I can get started to use javascript for iweb? Thanks before R.E

  • Email input xml as body of mail

    Dear all I need to provide the input xml in the body of the mail. The body of the mail should be the input xml. I understand that in order to provide the content in the email body we need to use the XIMail30  package. However this is only for the tex

  • Cover flow Scrollbar and mouse wheel issue?

    When I scroll my podcasts in cover flow view using the mouse wheel it skips some of the podcast album art. What I mean is when moving the scrollbar left or right with the mouse wheel the scrollbar skips like half way instead of being able to scroll e

  • Startup Chimes with audio cable connected?

    My Mini has started to sound it's healthy startup chime even when there is an audio cable connected to the audio/headphone output. The output works fine and sends audio to the speakers, but how can I mute the chime at startup? Previously it always mu

  • Internal - External Number Range in OM

    Hi Expert, Could you help me with node of configuring number range in OM. What is Internal number range - when is it used? What is external number range - when is it used? Thanks in Advance for your reply