Raise customized JBO exception from AM to Client

All
I want to raise exception in am, vo or eo to client side when some kind of business rules hit. How can i raise the JBO exception with info to identify the failed root reason?
If execute the binding operation I can call the getErrors() to check if the last execute succeed or not. How can i get this error message when call the operation via web service which exported from am,
follow are the code part in DemoAMServiceImpl for example, the DemoAMServiceImpl is generated by default when export DemoAM to support web service:
public EventsVOSDO updateEventsVO1(EventsVOSDO eventsVO1) throws ServiceException {
return (EventsVOSDO)update(eventsVO1, "EventsVO1");
when call this method to update event via web service to update event in AM, logic in eventEO checks the event property and raise custom event to client to indicate failure.
any one have good ideals on this requirement?

Try something like this in your method:
throw new JboException("Don't do that.", "101", null );

Similar Messages

  • Throwing jbo exception from AppModule class

    If a JBO exception does not appear on the JSF page when thrown from the AppModule class, what are some things that should be checked?

    Jaime,
    I'm not really sure what your question is, but backing beans would generally be considered part of the controller layer, in my opinion.
    JBO exceptions are typically raised from the Model layer.
    What exactly are you trying to do here? Can you share the use case?
    John

  • Throw JBO exception from doDML method-urgent HELP

    Hi,
    I am catching an exception on deleting a parent record without deleting a child record(FK constraint) in doDML delete operation method,when i am throwing a JBOexception with a custom message with in the catch block it is not refelecting in the front end,how can i display the FK contraint as a custom message in the front end?
    however i was able to throw a jbo exception in TP2 with in the doDml method,which was displaying to the front end.
    im using ADf TP3 11g
    -regards

    Hi,
    a similar question was posted last week. I replied saying that TP3 is supposed to work as TP2. If this isn't the case, please wait for TP4 to verify if the problem still exist and if, post another message with a reproducible testcase. TP4 will be out soon
    Frank

  • How to detect JBO Exception from within Apps Module Custom Method ?

    Hi all,
    I have a custom method in apps module (AM) to set "Status" attribute to "A' in an antity, this is for approval.
    Also there is a rule that the transaction cannot be approved if it is already cancelled by another user (in multi user environment).
    The problem is :
    If the AM custom method fail (because it throws JBOException in the entity setter method), How can I know that it fails ?
    and report it back to the backing beans that call the custom method ?
    Thank you for your help,
    xtanto
    Below is the code :
    1. create a custom method in AM to do : setStatus ("A") ;
    public void approve(){
    ViewObject bphVo = findViewObject("BpHView1");
    BpHViewRowImpl vBphViewRow = (BpHViewRowImpl)bphVo.getCurrentRow();
    vBphViewRow.setStatus("A");
    2. Do a validation inside setStatus method of the entity :
    public void setStatus(String value) {
    if (! getCancel() == true )
    setAttributeInternal(STATUS, value);
    else
    throw new JboException("Error ! transaction already cancelled");
    3. On backing beans :
    public String approveButton_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("approve");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    System.out.println("There is JBO Error !!");
    return null;
    else{
    commitButton_action();
    return "back";
    }

    Try this code:
    approveButtonAction()  {
    String navigationString = null;
    try {
    Object result = operationBinding.execute();
    naviagionString = success;
    catch (JboException e) {
       navigationString = null;
       (DCBindingContainer)bc.cacheException(e);
    } finally {
    if(navigationString != null)
      return commitButtonAction();
    else
      return navigationString;
    }

  • Is JBO exception working when using JPA ?

    I am using Jdeveloper 11g R (11.1.2.3) & weblogic 10 G
    In my pages I use JSF & Facelet
    Is JBO exception working when using JPA as data provider?
    I mean can I throw JBO exception from my back end in some business cases?
    thanks
    Mohsen

    You haven't added a resource reference for your web application that gives the application a local name for the global resource "UserDatabase".

  • JBO Exception while running OAF page from Jdev

    Hi All,
    I am using jdev 10.1.3 on R12 instance.
    I am trying to customize a standard OAF page.
    For that I downloaded all the related directories from the server and placed it in the corresponding folders of jdev.
    When I rebuild the page it is rebuilding successfully, but when I run the page it is showing some jbo exception.
    The exception details are attached in word file.
    If anyone faced such issues before please share your thoughts.
    Regards
    Jyothi

    Please paste the error stack and while running the page from Jdev make sure that you have updated DBC file and check the runtime connections in project properties. check the database connection as well.
    Thanks
    Raghav

  • How to transmit an exception from an EJB to a client ?

    I have a deployed EJB with a business method that throws an exception if something goes wrong. When the EJB is called (by a remote Java client) the client is not getting any exception if something goes wrong in the EJB's business method. This is how the EJB's business method is currently coded:
    void m() throws RemoteException
    try { //stuff
      } catch( Exception e ) {
        throw RemoteException(e.getMessage());
      } finally {
        // clean up
    What is wrong with this ? Any help is appreciated.
    Thanks,
    Colm.

    i think have to do something like this
    void m() throws RemoteException
    try { //stuff
      } catch( Exception e ) {
        throw new RemoteException(e.getMessage());
      } finally {
        // clean up
    look the "new", and have to create a custom class exception.
    look here:
    http://www-128.ibm.com/developerworks/library/j-ejbexcept.html
    http://docs.jboss.org/jbossas/javadoc/4.0.2/javax/ejb/EJBException.java.html
    http://docs.jboss.org/jbossas/javadoc/4.0.2/javax/ejb/

  • The version of OLE on the client and server machines does not match. (Exception from HRESULT: 0x80010110)

    Hi,
    I have installed FIM CM Client on one machine and FIM CM update service on another machine. Both are windows server 2008 r2 machines.
    When i try to enroll a permanent smart card for a user, its shows me the following error:-
    The version of OLE on the client and server machines does not match. (Exception from HRESULT: 0x80010110)
    Also there is no logging done for the particular event.
    I am able to change my smart card pin and view my smart card info. through the FIM CM client. 
    Is there a compatibility issue of FIM CM 2010 with Windows server 2008 r2?
    Thanks

    Hi,
    Sorry for the delay in reply.
    Please try the following steps first:
    Open Powershell as Administrator
    Go to Start--> Run and type wbemtest.exe.
    •Click Connect. 
    •In the namespace text box type "root" (without quotes).
    •Click Connect.
    •Click Enum Instances…
    •In the Class Info dialog box enter Superclass Name as "__ProviderHostQuotaConfiguration" (without quotes) and press OK. Note: the Superclass name includes a double underscore at the front.
    •In the Query Result window, double-click "__ProviderHostQuotaConfiguration=@"
    •In the Object Editor window, double-click HandlesPerHost.
    •In the Value dialog, type in 8192
    •Click Save Property.
    •Click Save Object.
    Under properties find the property "MemoryPerHost" or any other ones you need to modify  and double click it
    Change the value from 512 MB which is 536870912 to 1GB which is 1073741824
    Click Save Property
    Click Save Object.
    •Close Wbemtest.
    •Restart the computer.
    And if all nodes are Windows server 2012, install the following update rollup as well:
    Windows RT, Windows 8, and Windows Server 2012 update rollup: August 2013
    http://support.microsoft.com/KB/2862768
    If you have any feedback on our support, please send to [email protected]

  • Customer 9000AAAE : Exception 7 in function module VIEW_KUAG2

    Hi,
    Hi all,
    When I do the intercompany billing for STO (vf01), I got the system message attached below. The customer 9000AAAE is a ship to party and assigned to the ordering plant. It has the partner function SH. So can anybody kindly tell me where is wrong in the custmer master data or somewhere else according to the following message? Or where to find the VIEW_KUAG2? What does it mean?
    Customer 9000AAAE: Exception 7 in function module VIEW_KUAG2
    Diagnosis
    During the attempt to read customer master record 9000AAAE,
    an error occured which is not handled separately.
    System Response
    The billing document for this business transaction was not
    created.
    Procedure
    If the error occured during a background job, you should try
    to create the billing document online. If the error occured
    online, the billing document can be created online. In any
    case, you should check the customer master record. If you
    cannot find any error in the master data, contact SAP.
    Technical data
    Tech. data details
    Client                                                002
    Group Number
    Sales Document Number                  0080100090
    Item Number of the SD Document      000000
    Schedule Line Number                      0083
    Counter in Control Tables                  00
    Message Identification                      VF
    System Message Number                 083
    Output Type                                     E
    Message Variable 01                        9900AAAE
    Message Variable 02
    Message Variable 03                        VIEW_KUAG2
    Message Variable 04
    Group Type                                      F
    In our Intercompany, our ship to party is different from the Sold to, bill to and Payer.  The configuration done as follows -
    a.  Defined Ship to Party as 9000AAAE
    b.  Define Sold to, Bill to, Payer as 9000AAAA
    c.  Assignd Ship to Sold to
    d.  Assigned Ship to customer to plant assignment in STO configuration in MM
    e.  Assigned internal customer of sales organization as 9000AAAA
    Please help in this
    Best Regards
    Goutham

    Hi,
    Thanks for ur reply
    I check the partner determination and the settings are as below -
    a.  Defined new account group for Sold to, Bill to and Payer
    b.  Defined new account group for Ship to
    c.  In the Ship to party account group, system only determine the ship to partner function
    d.  Customer defined in Sold to is assined as interneal customer to sales org
    e.  Customer defined in Ship to is assigned as customer for plant in Shipping data configure for STO in MM Configuration
    Please provide more insights
    Best Regards
    Goutham

  • How to Hide JBO Exceptions in JSF Pages in ADF 10g

    Hi All,
    How to hide the JBO Exceptions in ADF 10g, for example JBO-27122: SQL error during statement preparation. I have been used the same customizing error handler which was specified in bcadfdevguide. But the method reportexception which will call disableappendcodes is not doing anything in my case.
    I want to show some decent errors instead of JBO errors to the user, appreciate if you help me on this.
    thank you.

    Hi Jobinesh,
    Thanks for the reply, actually i am looking to show the user our own customized error instead of JBO errors, i don't know whether the method skipexception will skip it or i can override it to show customized exceptions. and registering the customerrorhandler in databindings is different from registering the customphaselistener class in faces-config.xml which was usually done in 10g.
    But in my case, even though i followed everything what was specified in dev guide, i am not getting the result. Hence this post in forums :)
    Thanks.

  • Unable to extract Customer Master data from MDC

    Hello,
    We creating an MDM-XI-ERP2005 Customer scenario. We want to work with all bussiness scenarios (not customizing scenario).
    First I'm trying to extract Customer Master Data from EP 2005 using MDM_CLNT_EXTR.
    I have created a New Variant which properties are:
    Variant: CUSTOMER_TOTAL
    Description: Send all customer data to MDM
    Extraction Object: CUSTOMER_EXTRACT.
    Target System: PI7.
    But, the display jobs shows the following error: Could not determine recipients for message type MDMRECEIPT. Job cancelled after system exception.
    We need to focus the problem. We have done the following ALE configuration.
    SALE transaction:
    In Basic Settings -> Logical Systems -> Define Logical System we have add the following logical systems:
                  EUS100
                  MDM: Master Data Management
                  PI7: Process Integration 7.0
    WE21:
    Transactional RFC -> PI7, IDOC record types SAP Release 4.x
    RFC destination: SAPSLDAPI
    BD64
    New Model -> PFMC
    Add message type: Model iview: PFMC
                                 Sender: EUS100
                                  Receiver: PI7
                                 Message Type: DEBMDM
    WE20 transaction shows:
    Partner profiles -> Partner Type LS (logical system)
                        PI7: Outbound parmtrs. DEBMDM, SYNCH.
    Any idea will be very helpful,
    Thanks in advance
    Marta.
    Edited by: Marta Sánchez on Jul 9, 2008 12:34 PM

    Sorry because I made a mistake in my previous message. ALE seems to be correctly configured. I'll try to update correctly my current situation:
    In WE02 I can see al IDOCs that I'm trying to send to XI. All them have the IDoc Status = 3 (Data Passed to Port OK) instead of 12 Status Dispatch OK :(. So, It seems an tRFC error.
    SM58 shows me more trails: "Basic type 'DEBMDM06' is unknown"
    before that I have done the following steps at SAP ERP:
        1. WE21: I have created a PI7 port with 700PI70CLNT RFC.
        2. SM59: I have checked successfully 700PI70CLNT RFC connection.
        3. WE20: I have created a PI7 Partner Type LS with the following inbound and outbound parameters: DEBMDM and MDMRECEIPT.
        4. BD64: I have created a Distribution Model with DEBMDM and MDMRECEIPT message types.
    and at SAP PI:
         5.IDX: Port: SAPEUS. Client: 111. RFC Destination: PI7.
         6. technical and business system for sender SAP system(System Landscape Directory)...
    - Maybe some of the previous steps is not correct....
    - Is RFC Destination = PI7 is correct in step #5?
    - Is also necessary to configure more steps in PI system like RFC destinations or Transactional port?
    - I have read that is neccessary to check that the option "transfer idoc immediately" in we20. How?
    Please any idea will be very helpful.......
    Thank you!
    Best regards,
    Marta.

  • VSTO.dll The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

    Hello,
    I'm trying to install a VSTO on a clients machine and get the following error message.
    Could this be something wrong with the .Net Version?
    Application Domain:    AWAddinInstaller.exe
    Assembly Codebase:     update files/AWAddinInstaller.exe
    Assembly Full Name:    AWAddinInstaller, Version=9.2.0.14, Culture=neutral, PublicKeyToken=null
    Assembly Version:      9.2.0.14
    Assembly Build Date:   11/12/2013 12:12:58 PM
    Exception Source:      mscorlib
    Exception Type:        System.IO.FileNotFoundException
    Exception Message:     The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
    Exception Target Site: nLoadFile
    ---- Stack Trace ----
       System.Reflection.Assembly.nLoadFile(path As String, evidence As Evidence)
           AWAddinInstaller.exe: N 00000
       System.Reflection.Assembly.LoadFile(path As String)
           AWAddinInstaller.exe: N 00084
       AWAddinInstaller.AWAddinInstaller.RegisterAddin(forceVSTO As Boolean)
           AWAddinInstaller.exe: N 00602

    Hello AntronD,
    The installer complained that The system cannot find the file specified. However I'm confused that why the VSTO is related to AWAddinInstaller.exe.
    Could you please navigate to your %temp% folder and search for your VSTO logs out and paste it here? I need it to check for details.
    Regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The invoked JCA adapter raised a resource exception.

    Hello,
    I have to use an Oracle apps adapter in Bpel. Thus I created a non-XA datasource and a connection pool for the Oracle Apps Adapter - eis/Apps/DS with its datasource as jdbc/DS. Now when I invoke the Oracle apps adapter, i get the following error in the standalone weblogic server.
    The selected operation ProcessApprove could not be invoked.
    An exception occured while invoking the webservice operation. Please see logs for more details.
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'MyAppAdapter' failed due to: Apps Context Error.
    Error occurred while setting up Apps Context.
    Context parameters should be valid.
    Contact oracle support if error is not fixable.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    How do I resolve?? Any help please.
    Thanks

    Hello,
    I have to use an Oracle apps adapter in Bpel. Thus I created a non-XA datasource and a connection pool for the Oracle Apps Adapter - eis/Apps/DS with its datasource as jdbc/DS. Now when I invoke the Oracle apps adapter, i get the following error in the standalone weblogic server.
    The selected operation ProcessApprove could not be invoked.
    An exception occured while invoking the webservice operation. Please see logs for more details.
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'MyAppAdapter' failed due to: Apps Context Error.
    Error occurred while setting up Apps Context.
    Context parameters should be valid.
    Contact oracle support if error is not fixable.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    How do I resolve?? Any help please.
    Thanks

  • Raising Customer Messages with SAP OSS on BCS issues

    Hi guys,
    I'd be keen to know everyone's opinion on raising customer messages with SAP OSS, in particular on BCS.
    Often I find that my colleagues are hesitant to raise a note with SAP because they think it either takes too long or they don't get a satisfactory answer.
    Whereas as soon as I see something fishy, that I cannot explain I will check my logic once more, check on SDN, check existing OSS notes, then raise a Customer Message immediately (while I continue to investigate/test).
    This is partly due to my experience that half the time I feel like a guinea pig in BCS, perhaps because BCS is not as widespread as other modules and i may be the first to try something so may be first to experience the problem.
    The first line response (often from Shanghai) usually tries to send the message straight back but I find with a little persistence, clear (and irrefutable) documentation , you soon get through to the experts in Germany (or is it Czech Rep?) who actually understand the issue.
    The client has paid a lot of money for the service through their SAP licensing and maintenance fees, so I have no qualms about 'reporting a product error' when I see one.
    Also, I find a lot of BCS documentation is out of date, not updated as new releases/EHPs come out, eg I recently relied on the contents of OSS note 936590, which was wrong for BCS 604. So I raised a customer message and requested that they update it, which has now been done - this is too late for me but might help someone else.
    Raising a Customer Message with OSS is not an excuse to avoid doing your job, but where there is a genuine error in BCS, I encourage others to raise OSS notes and persis with them until a satisfatcory response is received.

    Concur with TheScotsman.
    The situation is almost the same: the 1st line support (India) very often beat back the costomer message without going deep into the problem. However, if we persist and provide additional details (or when the message was made very professionally and bypassed the 1st line) the message was rerouted to consultants from Czeck Rep.). In this case the progress was significant. Since the client do not provide access to the system, in a couple of times we made a remote session: the support guy gave directions what to do in the system and where to look for some details. The problems were solved in a half an hour.

  • How do I call an ejb from a java client?

    I put ejb classes in a jar file along with java client code and deployed it on my OC4J server. Now I am trying to run the ejb by calling the client code on my OC4J server from the command line but I am not having success. Am I doing this the right way? Should I also deploy my client code? Should the client code also be in a directory on my OC4J server?
    Mike

    Hi. Here is a part of the code for a java client. In this particular case it is also an EJB but it is a Message Driven Bean.
    public class MDBEjbMecomsIFSBean implements MessageDrivenBean,
    MessageListener {
    // context
    private MessageDrivenContext m_ctx = null;
    // properties filename
    private String m_propFile = DEF_PROPFILE;
    // application
    private String m_app;
    // callable function from properties
    // private String m_dsJndiName;
    // private String m_dsType;
    // private String m_dsFunc;
    private int m_connRetryMax;
    private int m_connRetryWait;
    // initial stylesheet transformation file
    private String m_xsltFile;
    // web service operation name
    private String m_operationName;
    // trap emitter members from properties
    private String m_trapMbeanURL;
    private String m_trapObjectName;
    private String m_trapAction;
    private String m_trapAppName;
    private Severity m_trapMax = Severity.CRITICAL;
    private int m_trapAfterDelivery;
    private boolean m_trapStart;
    // jmx members for auto shutdown from properties
    private String m_mdbMbeanURL;
    private String m_mdbMbeanAccount;
    private String m_mdbMbeanPassword;
    private String m_mdbObjectName;
    private String m_mdbAutoShutdown;
    // clob allocator to be used by Oracle jdbc call
    // private CLOB m_clob;
    * Remember the context for this MDB.
    * @param ctx the context for this MDB
    public void setMessageDrivenContext(MessageDrivenContext ctx) {
    logger.log(Level.FINEST, "Setting MessageDrivenContext");
    m_ctx = ctx;
    * ejbCreate() is called when the server wants to create a new instance of this MDB.
    * At this time a connection with the target is established and the callable statement
    public void ejbCreate() {
    readProperties();
    // Connection errors are IGNORED, because it seems that raising Exceptions from here
    // does NOT result in a container managed rollback. Instead the dequeue is commited,
    // resulting in AQ message status 2 (success).
    // By ignoring the fault, another Exception will occurr in onMessage(), from where
    // a propagated exception DOES result in a rollback.
    String logStr = "Started TenneT-MDB-" + m_app;
    logger.log(Level.FINEST, prefixLog(logStr));
    if (m_trapStart)
    notify(Severity.NORMAL, logStr);
    * This method is called whenever a message is sent to the queue associated with this MDB.
    * @param msg assumed to be a javax.jms.TextMessage containting an xml string
    public void onMessage(Message msg) {
    * msg id, timestamp and length are logged at info level
    * msg content is logged at debug level
    String msgText = "uninitialized";
    String msgId = "undefined";
    int msgDeliveryCount = 0;
    // this block retrieves msg info from the jms header
    // errors are logged as info and ignored
    try {
    // get msgid first so any subsequent error can be associated with the msg
    msgId = msg.getJMSMessageID();
    logger.log(Level.FINE, prefixLog("MessageID: " + msgId));
    logger.log(Level.FINE,
    prefixLog("Enq_time : " + msg.getJMSTimestamp()));
    // delivery count can be used to send a critical trap only on the last retry
    if (msg.propertyExists(JMS_X_RCV_TIMESTAMP)) {
    logger.log(Level.FINE,
    prefixLog("Deq_time : " + msg.getIntProperty(JMS_X_RCV_TIMESTAMP)));
    // delivery count can be used to send a critical trap only on the last retry
    if (msg.propertyExists(JMS_X_DELIVERY_COUNT)) {
    msgDeliveryCount = msg.getIntProperty(JMS_X_DELIVERY_COUNT);
    logger.log(Level.FINE,
    prefixLog("DeliveryCnt: " + msgDeliveryCount));
    } catch (Exception e) {
    String errStr =
    "Minor exception in JMSConsumeMDBBean.onMessage() receiving msg \"" +
    msgId + "\": " + e.getMessage();
    logger.log(Level.SEVERE, prefixLog(errStr));
    // next the message content is addressed
    try {
    TextMessage message = (TextMessage)msg;
    msgText = message.getText();
    logger.log(Level.FINE,
    prefixLog("MessageLength: " + msgText.length()));
    logger.log(Level.FINEST, prefixLog("Msg: " + msgText));
    } catch (Exception e) {
    String errStr =
    "Error in JMSConsumeMDBBean.onMessage() retrieving msg \"" +
    msgId + "\": " + e.getMessage();
    logger.log(Level.SEVERE, prefixLog(errStr));
    notify(Severity.CRITICAL, errStr);
    throw new EJBException(errStr);
    // From now we can do intial stylesheet transformation if necessary
    try {
    // Prepare input
    XMLDocument xslInput;
    XMLDocument xmlInput;
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(true);
    // Parse XSL
    parser.parse((MDBEjbMecomsIFSBean.class.getResourceAsStream(m_xsltFile)));
    xslInput = parser.getDocument();
    // Parse XML
    parser.parse((Reader)new StringReader(msgText));
    xmlInput = parser.getDocument();
    // Instantiate XSL Processor
    XSLProcessor processor = new XSLProcessor();
    XSLStylesheet stylesheet;
    stylesheet = processor.newXSLStylesheet(xslInput);
    XMLDocumentFragment xmlOutput =
    (XMLDocumentFragment)processor.processXSL(stylesheet,
    xmlInput);
    // Now prepare xml for use with entity bean
    Document xmlDoc = new XMLDocument();
    xmlDoc.appendChild(xmlOutput);
    *// Invoke Entity Bean to perform lookup of destination Web Service*
    Context ctx;
    ctx = new InitialContext();
    EBEjbMecomsIFSLocalHome ebOppIfsLH =
    *(EBEjbMecomsIFSLocalHome)ctx.lookup("java:comp/env/ejb/local/EBEjbopp_ifs");*
    EBEjbMecomsIFSLocal ebOppIfs;
    ebOppIfs = ebOppIfsLH.create();
    *// pass message content to entity bean*
    ebOppIfs.setXMLmessage((Element)xmlDoc.getDocumentElement());
    *// provide correct soap action*
    ebOppIfs.setOperationName(m_operationName);;
    *// do actual work*
    ebOppIfs.doWork();
    } catch (XSLException e) {
    logger.log(Level.INFO,
    prefixLog("XSL Exception during onMessage " +
    e.getMessage()));
    } catch (SAXException e) {
    logger.log(Level.INFO,
    prefixLog("SAX Exception during onMessage " +
    e.getMessage()));
    } catch (CreateException e) {
    logger.log(Level.INFO,
    prefixLog("Create Exception during onMessage " +
    e.getMessage()));
    } catch (NamingException e) {
    logger.log(Level.INFO,
    prefixLog("Naming Exception during onMessage " +
    e.getMessage()));
    } catch (IOException e) {
    logger.log(Level.INFO,
    prefixLog("IO Exception during onMessage " + e.getMessage()));
    private void notify(Severity severity, String message) {
    logger.log(Level.FINEST,
    prefixLog("Started method notify() with severity level " +
    severity));
    try {
    if (m_trapMbeanURL == null || m_trapMbeanURL.equals("")) {
    logger.log(Level.WARNING,
    prefixLog("No MBean URL! Skipping SNMP trap."));
    } else {
    logger.log(Level.INFO,
    prefixLog("Setting up JMX connection with " +
    m_trapMbeanURL));
    ObjectName delegateName = null;
    MBeanServerConnection mbsc = null;
    try {
    JMXServiceURL jmxServiceURL =
    new JMXServiceURL(m_trapMbeanURL);
    JMXConnector connector =
    JMXConnectorFactory.connect(jmxServiceURL);
    mbsc = connector.getMBeanServerConnection();
    delegateName = new ObjectName(m_trapObjectName);
    logger.log(Level.FINEST,
    prefixLog("JMX connection established with " +
    m_trapMbeanURL));
    } catch (Exception ex) {
    logger.log(Level.SEVERE,
    prefixLog("Error while initializing JMX Server connection"),
    ex);
    throw new EJBException("Error while initializing JMX Server connection",
    ex);
    String localHost = null;
    try {
    InetAddress addr = InetAddress.getLocalHost();
    localHost = addr.getCanonicalHostName();
    logger.log(Level.FINEST,
    prefixLog("Localhost=" + localHost));
    } catch (UnknownHostException ex) {
    logger.log(Level.SEVERE, prefixLog(ex.getMessage()), ex);
    throw new EJBException(ex.getMessage(), ex);
    // invoke the trapemitter
    try {
    if (mbsc != null) {
    if (severity.ordinal() > m_trapMax.ordinal()) {
    severity = m_trapMax;
    String severityArg = severityMap.get(severity);
    Object[] arguments =
    { severityArg, message, m_trapAppName, localHost };
    String[] signature =
    { "java.lang.String", "java.lang.String",
    "java.lang.String", "java.lang.String" };
    mbsc.invoke(delegateName, m_trapAction, arguments,
    signature);
    logger.log(Level.INFO,
    prefixLog("TrapEmitter invoked: severity=" +
    severityArg + " - message=" +
    message));
    } else {
    logger.log(Level.SEVERE,
    prefixLog("Error: No MBean server connection established with " +
    m_trapMbeanURL));
    } catch (MBeanException e) {
    logger.log(Level.SEVERE,
    prefixLog("Error occured in invoked method"),
    e);
    } catch (ReflectionException e) {
    logger.log(Level.SEVERE, prefixLog(e.getMessage()),
    e.getCause());
    } catch (IOException e) {
    logger.log(Level.SEVERE,
    prefixLog("A communication problem occurred when talking to the MBean server"),
    e);
    } catch (InstanceNotFoundException e) {
    logger.log(Level.SEVERE,
    prefixLog("The MBean specified is not registered in the MBean server."),
    e);
    } catch (Exception e) {
    logger.log(Level.SEVERE,
    prefixLog("Error in method notify. Handling resumes..."));
    } finally {
    if (severity.equals(Severity.CRITICAL)) {
    stopConsuming();
    private void stopConsuming() {
    logger.log(Level.FINEST, prefixLog("Started method stopConsuming()"));
    if ("true".equals(m_mdbAutoShutdown)) {
    if (m_mdbMbeanURL == null || m_mdbMbeanURL == "") {
    logger.log(Level.WARNING,
    prefixLog("No MDB MBean URL! Skipping stopConsuming()."));
    } else {
    JMXConnector jmxCon = null;
    try {
    Hashtable<String, String> credentials =
    new Hashtable<String, String>();
    credentials.put("login", m_mdbMbeanAccount);
    credentials.put("password", m_mdbMbeanPassword);
    // Properties required to use the OC4J ORMI protocol
    Hashtable env = new Hashtable();
    env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "oracle.oc4j.admin.jmx.remote");
    env.put(JMXConnector.CREDENTIALS, credentials);
    JMXServiceURL serviceUrl =
    new JMXServiceURL(m_mdbMbeanURL);
    jmxCon =
    JMXConnectorFactory.newJMXConnector(serviceUrl, env);
    jmxCon.connect();
    MBeanServerConnection mbs =
    jmxCon.getMBeanServerConnection();
    logger.log(Level.FINEST,
    prefixLog("JMX connection established with " +
    m_mdbMbeanURL));
    ObjectName objectName = new ObjectName(m_mdbObjectName);
    MessageDrivenBeanMBeanProxy MDBMBean =
    (MessageDrivenBeanMBeanProxy)MBeanServerInvocationHandler.newProxyInstance(mbs,
    objectName,
    MessageDrivenBeanMBeanProxy.class,
    false);
    MDBMBean.stop();
    logger.log(Level.WARNING,
    prefixLog("Message consumption suspended"));
    } catch (Exception ex) {
    logger.log(Level.SEVERE,
    prefixLog("Error while initializing JMX Server connection"),
    ex);
    throw new EJBException("Error while initializing JMX Server connection",
    ex);
    } else {
    logger.log(Level.WARNING,
    prefixLog("No AutoShutdown. property=false"));
    * Called when the server no longer wants to keep this MDB instance.
    * Closes the connection and statement objects created in <code>ejbCreate</code>.
    public void ejbRemove() {
    try {
    cleanup();
    } catch (Throwable t) {
    logger.log(Level.SEVERE,
    prefixLog("Error in ejbRemove(): " + t.getMessage()));
    /* Cleanup resources cleanly */
    private void cleanup() {
    logger.log(Level.INFO, prefixLog("TenneTMDB.cleanup() called."));
    // m_dsService = null;
    // m_dsCall = null;
    private String prefixLog(String logText) {
    String logPrefix = "%" + m_app + ": ";
    //System.out.println(logPrefix + logText);
    return logPrefix + logText;
    private void logCause(Throwable e, LogLevel logLevel) {
    int i = 0;
    String causeStr;
    Throwable exception = e.getCause();
    while (exception != null) {
    i++;
    causeStr = "Cause " + i + ": " + exception.getMessage();
    switch (logLevel) {
    case INFO:
    logger.log(Level.INFO, prefixLog(causeStr));
    break;
    case WARN:
    logger.log(Level.WARNING, prefixLog(causeStr));
    break;
    case ERROR:
    logger.log(Level.SEVERE, prefixLog(causeStr));
    exception = exception.getCause();
    }

Maybe you are looking for