Cannot capture the exception generated by EJB components.

Hi, All:
I got a strange problem when developing EJB application under SAP WAS server. I developed an EJB as below:
public class UserAccountBean implements SessionBean{
     String getUserEmail(String accountID) throws SAPSystemException{
          if(error){
               throw new SAPSystemException("Specified user not found.");
Exception I defined as below.
public class SAPSystemException extends Exception {
@param message
     public SAPSystemException(String message) {
          super(message);
In client side I code as below:
public String getUserMail(String accountID){
     UserAccount bean = home.create();
     try{
          String email = bean.getUserEmail(accountID);
     }catch(SAPSystemException e){
          // do something here;
     }catch(Exception e){
          // do some other thing here;
It is strange that the SAPSystemException I throw out in the bean cannot be caught by the block catch(SAPSystemException e), it is only captured as general exception and it is said as UndeclaredThrowableException.
When I deployed EJB components and Web components together, the exception can be captured successfully. But when I deployed them separately, it has problem for exception capture. I think it must be the protocol problem. Before I only use RMI-IIOP but SAP WAS server using RMI-P4. Is anything I can do to solve this problem?
I packed the remote and home interface for the EJB and common classes like value objects and exceptions in both components. Is there anything I forgot to set for the deployment?
Thanks in advance.
Message was edited by: Weimin Guo
Message was edited by: Weimin Guo

Thank you very much Gregor. In fact, I already defined this throws exception in the remote object interface.
public interface UserAccount extends EJBObject {
     public String getUserEmail(String accountID) throws RemoteException, SAPSystemException;
This is application-specific interface and this mechanism works well in my previous in other application server.
I checked the SAP document and found if you using RMI-IIOP, you need to get the client package for your deployed EJBs and put in the path accessible by the WEB components. Based on this suggestion, I put the EJB jar file together with WEB application (Sure the EJB application still deployed in other host and JNDI point to that host. I remembered one book mentioned that if you don't want generate the client package from EJB containter, you can do it this way. For me, I just haven't found the way to get the client package with Administrator Tool it said.), It works!!!. I checked the remote object generated by home object, it is different with EJB jar file there or not. But in the document SAP said that only if you use RMI-IIOP you need do this way, for RMI-P4, you don't need that. Anyway, it seems that RMI-P4 use same way as RMI-IIOP(You only don't need narrow the home object after lookup).
I'll try to find how to get EJB client package from WAS server. For this is my first time to use SAP WAS Server, things a little strange.
Thank you very much for your great help.
Cheers.

Similar Messages

  • Cannot capture the expense claim

    Hi all,
    I wondered if someone could possibly help me with the following issue I'm having:I have been paid an advance for as trip; however, I cannot capture the expense claim for the trip. Please can someone advise me on how I can do this?
    Kind regards

    Thank you very much Gregor. In fact, I already defined this throws exception in the remote object interface.
    public interface UserAccount extends EJBObject {
         public String getUserEmail(String accountID) throws RemoteException, SAPSystemException;
    This is application-specific interface and this mechanism works well in my previous in other application server.
    I checked the SAP document and found if you using RMI-IIOP, you need to get the client package for your deployed EJBs and put in the path accessible by the WEB components. Based on this suggestion, I put the EJB jar file together with WEB application (Sure the EJB application still deployed in other host and JNDI point to that host. I remembered one book mentioned that if you don't want generate the client package from EJB containter, you can do it this way. For me, I just haven't found the way to get the client package with Administrator Tool it said.), It works!!!. I checked the remote object generated by home object, it is different with EJB jar file there or not. But in the document SAP said that only if you use RMI-IIOP you need do this way, for RMI-P4, you don't need that. Anyway, it seems that RMI-P4 use same way as RMI-IIOP(You only don't need narrow the home object after lookup).
    I'll try to find how to get EJB client package from WAS server. For this is my first time to use SAP WAS Server, things a little strange.
    Thank you very much for your great help.
    Cheers.

  • The application, C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe, generated an application error The error occurred on 10/01/2009 @ 11:31:59.964 The exception generated was c0000005 at address 7C81BD02 (ntdll!ExpInterlockedPopEntrySListFault)

    Hi,
    I get this error randomly when i run my VB 6.0 application which calls Photoshop CS2 actions. I went through many forums, but could not manage to get the right solution for this.
    "The application, C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe, generated an application error The error occurred on 10/01/2009 @ 11:31:59.964 The exception generated was c0000005 at address 7C81BD02 (ntdll!ExpInterlockedPopEntrySListFault)
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp."
    OS: WIndows Server 2003 SP2
    Photoshop CS2
    ANy help on this will be highly appreciated.
    Thanks in advance,
    Smiley

    I see this sort of error notice in Bridge and Photoshop, preceded by the message " Photoshop (or Bridge) has encountered a problem and must close. Tell MS.
    Yes or No."
    It most frequently happens in PS when running Dfine 2.0. I have no clue what triggers the Bridge closure. It happens randomly.
    CS3, so nobody gives a tinkers dam, I suppose.
    I see this kind of message in software testing on a regular basis. Of course, when the test is under way, the software is generating a detailed log file which we package up as part of a bug report. Then at the bug scrubs, lively discussions ensue as to who has to fix what!
    I can only image what would happen if the Dfine people and the PS people had to sit through one of those!

  • Capture the exceptions from BW Bex Report in a class/interface

    Hi....
    I am trying to capture the exceptions defined in the BW BEx Reports in a class (superclass - CL_RSR_WWW_MODIFY_TABLE) in a variable or something.
    This is actually to change the properties of a table in Web Applcn. acc to the exceptions by altering the cell content in the class(Transaction - SE80).
    Is it possible to store the exceptions in a variable in the class???

    Hi Smriti,
    Exception and Exception Handling can be based on classes in ABAP Objects. In an exception situation, an exception is represented by an exception object –
    i.e. an instance of an exception class. Its attributes contain information about the
    error situation. Exception classes can be defined both locally and globally. When a class based exception is raised, the system interrupts normal   program flow and tries to navigate to the suitable handler.
    An exception can only be handled if the causing statement(s) is enclosed in a TRY-ENDTRY block. If a exception occurs in a TRY block, the system first searches for a CATCH statement (which will handle the exception) in the same block and then step by step upwards in all enclosing TRY-ENDTRY blocks. If it finds one, it navigates to this handler, else if TRY-ENDTRY block is in a procedure, it then tries to propagate the exception to the calling program. After exception occurs, system searches through the listed exception handlers in specified order and executes first handler whose CATCH statement contains the relevant exception class or one of its superclasses.
    PARAMETERS: p_num1 TYPE i,
                p_num2 TYPE i.
    DATA: gv_result TYPE i,
          gv_text   TYPE string,
    Defining reference variables  with reference to the common superclass *
    CX_ROOT of all exception classes.                                     *
          z_ref_exc TYPE REF TO cx_root.
    TRY.
        gv_result = p_num1 / p_num2.
        WRITE / gv_result.
    For division by zero, the runtime system raises the exception         *
    cx_sy_zerodivide. This is handled in the CATCH block. The reference   *
    to the appropriate instance is stored in the data object z_ref_exc.   *  
      CATCH cx_sy_zerodivide INTO z_ref_exc.
    Handler can access the instance's exception text using the functional *
    method GET_TEXT.                                                      *   
        gv_text = z_ref_exc->get_text( ).
        MESSAGE gv_text TYPE 'I'.
    ENDTRY.
    Award points if found useful.
    Regards
    Indrajit

  • PO Lead Time cannot capture the time taken for shipping!

    Dear All
    I understand that we have PO lead time = PO Processing Time (Working Day) + Planned Delivery Time (Calendar Day) + GR processing time (working day).
    And this PO lead time will be added on top of my PO Creation Date to defer the actual goods availability date.
    My question:
    1. Planned delivery time is the time taken from vendor place to send out the goods to my warehouse. What if it is overseas purchase where goods leaving vendor's Port will first arrive in my country custom, and it will take 3 days to do clearance. once it is cleared, forwarding agent will delivery goods from my country custom to my warehouse. In this case, how do I capture it in SAP system for the planned delivery time as it has 4 periods of time now
    a. Time taken from vendor's port to reach my country's port
    b. Time taken for my country custom to do clearing
    c. Time taken for forwarding agent to fetch goods from custom to my warehouse
    d. Time taken for unpack, take out , count, inspect and put for use (GR processing time)
    Do I need to use user Exit?
    Thanks
    Edited by: Daimos on Apr 27, 2009 6:52 PM

    Dear dogboy.
    I think we must use feature on the PO Confirmation Control (CC) Key at PO Item Level:
    ED - Estimated Time of Departure from Overseas Port.
    EA - Actual Time of Departure from Overseas Port.
    EA - Estimated Time of Arrival
    AA - Actual Time of Arrival
    And the purchaser will maintain the value of each of the CC Key each time they are notified by the vendor.
    And we need to come out with a Customised Report to capture those CC dates entered so that finance is able to prepare $ in advance if the moment the EA is maintained, meaning the estimated date of arrival at the Custom there.
    But the problem is that PO User Exit is only at the header of Confirmation Control Key but not capture the DATE field we entered for each CC.
    That was the problem I last encountered.

  • Support for xs:date types in web services generated from EJB components

    I need to generate a Web Service from an EJB session bean based upon EJB entities generated from the Oracle 11g database that contain DATE type columns.
    JDeveloper creates java.sql.Timestamp types in the EJB Session bean and this results in an exception error when I try to generate a web service from this bean via webservice annotations:
    java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.sql.Timestamp does not have a no-arg default constructor
    I expected the web service wizard to generate argument types xs:dateTime or xs:date so this was an unwelcomed surprise.
    I tried manually adding a method to the session bean with java.util.date arguments and had no problems with the web service wizard that correctly created xs:dateTime arguments. Is there any particular reason why the EJB wizard does not generate java.util.date arguments or handle java.sql.Timestamp without failing with an exception?
    Since I begin with database tables and generate EJB entity classes and then web services with the Jdeveloper wizards it seems to me that there is a problem here in JDeveloper. Would you agree?
    There are several possible more or less appealing workarounds, such as doing manually adding methods to the EJB facade with java.util.date arguments and doing the conversion from/to java.sql.timestamp manually. Is this a reasonable approach or does JDeveloper support date/time for Date columns in some other way that I have missed?
    Very Grateful for any comments or suggestions.
    Edited by: user10601664 on May 2, 2009 1:14 PM
    Edited by: user10601664 on May 2, 2009 1:43 PM

    Checkout this example:
    http://www.manojc.com/?sample3
    public class HelloWorldService{
    * @wlws:exclude
    public void dontExpose(){
    Regards,
    -manoj
    http://manojc.com
    "Jacob Anderson" <[email protected]> wrote in message
    news:4036581e$[email protected]..
    >
    hello,
    I created the descriptor file for a web service that had a protectedmethod in
    it and noticed the protected method showed up in the descriptor file!Should
    the "source2wsdd" task only output PUBLIC methods as service actions? Isthere
    any way to specify methods to be 'ignored' when generating the webservices descriptor
    file?
    here was the generated descriptor XML:
    <web-service name="BindingService"
    protocol="https"
    style="document"
    targetNamespace="http://www.foo.com/ws/BindingService/"
    portName="BindingServicePort"
    uri="/BindingService"
    portTypeName="BindingServicePort">
    <types>
    </types>
    <wsdd:type-mappingxmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdd="http://www.bea.com/servers/wls70">
    <wsdd:type-mapping-entrydeserializer="weblogic.xml.schema.binding.internal.builtin.DocumentCodec"
    type="xsd:anyType"
    class-name="org.w3c.dom.Document"
    serializer="weblogic.xml.schema.binding.internal.builtin.DocumentCodec">
    </wsdd:type-mapping-entry>
    </wsdd:type-mapping>
    <components>
    <java-class name="BindingService"
    class-name="com.arrow.ws.vendor.BindingService">
    </java-class>
    </components>
    <operations>
    <operation name="getConfigName"
    component="BindingService"
    method="getConfigName()">
    <params>
    <return-param xmlns:typeNS="http://www.w3.org/2001/XMLSchema"
    location="body"
    type="typeNS:string"
    name="result"
    class-name="java.lang.String">
    </return-param>
    </params>
    </operation>
    </operations>
    </web-service>

  • Tool to Generate all EJB Components ( including descriptors )

    We have built a tool that generates all components of EJBs from the database. This
    includes the home and remote interfaces, the bean implementation and descriptor
    files. In addition the tool also generates the session bean wrapper to access
    EJB s in a transaction oriented environment.
    Once the EJB s are generated you can build your J2EE application within a very
    short time and never require to hand code and test EJBs. The generated code is
    totally extendable ( via an extended layer ) and can be interated with any tools
    such as JBuilder.
    For a free demonstration ( Condition applies ) of the tool which takes about 30
    minutes to 1 hour, at your office please send an e-mail to [email protected]

    We have built a tool that generates all components of EJBs from the database. This
    includes the home and remote interfaces, the bean implementation and descriptor
    files. In addition the tool also generates the session bean wrapper to access
    EJB s in a transaction oriented environment.
    Once the EJB s are generated you can build your J2EE application within a very
    short time and never require to hand code and test EJBs. The generated code is
    totally extendable ( via an extended layer ) and can be interated with any tools
    such as JBuilder.
    For a free demonstration ( Condition applies ) of the tool which takes about 30
    minutes to 1 hour, at your office please send an e-mail to [email protected]

  • Want to capture the exception in webservice?..

    Hi,
    I have written a BAPI within the MAIN function module for Asset creation. Suppose if the asset is not created due to some invalid data i dont want to use the BAPIRET2 structure for Exception handling, but i want to capture on the MAIN function module EXCEPTIONS.
    Note: EvenIf the BAPI fails the sy-subrc is 0.
    Please suggest.
    Regards,
    Neslin.

    Hi Neslin,
    the following content may help you
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/107aeaf2-540f-2a10-4286-a03955f5274c
    if helpful reward points are appreciated

  • I cannot "capture" the fullScreen display state

    Hi,
    When trying to get my head around another problem I have with altering content depending on whether the displayState is normal or fullScreen, I tried to set up a feedback/debug box that would send me messages about the displayState. I created a textbox with dynamic text and gave it a variable name, and then wrote a little AS2 tidbit as follows:
    if (Stage["displayState"]="normal") {
        textbox = ("you're in normal mode");
    } else {
        textbox = ("you're in fullscreen mode");
    When I start the movie and am in normal mode then I get the correct message but when I hit a button to toggle true fullscreen on then the normal message stays on screen.
    Obviously I am new to all this, what am I doing wrong?
    Thanks!

    Hi, thanks for your answer. It cleared away some clouds for me.
    I think my problem is that I don't understand how actionscript is parsed by the Flashplayer engine. I had placed my if-statement at the bottom of all AS-code, on its own - and as my Flash movie only has one frame and that is the location of all the AS - I thought that the movie would be looping this frame over and over and thus the AS would be parsed over and over. Hence, putting the if-statement at the bottom I thought it would be continually evaluated and sending the correct value to my textbox depending on the displayState.
    But when I put the if-statement inside the functions to go/exit fullscreen, then it works, but of course since I intended it as a feedback mechanism it is then redundant since I can see on screen that fullscreen is activiated/disactivated.
    1) Perhaps I should focus my question on the parsing issue: I thought that since it is a slideshow gallery that keeps playing and changing images then the script is parsed over and over again? But perhaps the script is only parsed once, and it is its instructions that have told the player to keep changing images? Then I can see why putting the if statement at the bottom did not produce the result I wanted.
    2) If I want to change the characteristics of my movie to behave in one way in normal fixed width display and behave differently when it is displaying in fullscreen, should I put all code relating to how it is supposed to display when in fullscreen inside the function that tells it to go fullscreen? And then put all code reverting those changes inside the function that exits fullscreen? (You see the advanced state of my actionscript knowledge!!)
    /G
    PS. 'textbox.txt' does not produce anything on screen, 'textbox' does. 'textbox' is the variable name of my dynamic text field.

  • Cannot lookup the bean in JBoss

    I had a entity bean called AddressBean and bind the JNDI name as ejb/entity/AddressBean, but I cannot lookup this bean. The NameNotFoundException is thrown, the exception message is "ejb not bound". Did anyone know what happen with it?
    Hashtable props = new Hashtable();
    props.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");
    InitialContext initialContext = new InitialContext(props);
    Object obj = initialContext.lookup("ejb/entity/AddressBean");But I can lookup this bean by using the default JNDI name "AddressBean".

    I've been trying to make a lookup from a remote client.
    I've tried this code
    props.put(InitialContext.PROVIDER_URL, "jnp://10.10.10.10:1099");
    I get the error unknown protocol
    Ofcourse 10.10.10.10 was not the acutal ip address of the machine on which JBoss was running. While running the code i did have the correct ip address.
    Then I tired the approach discussed here
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=63&t=000150
    Now i get a "no protocol" error.
    I have included the jboss-client.jar and the jnp-client.jar in the classpath of the client.
    Can someone help me out with this?

  • To capture the error after processing LOGON function

    Dear friends
    I want to capture the exception after the execution of the LOGON function. Scenario i need to capture is when the user account been locked, password expired and password will expire in N days.
    I made the user account locked and password expired through backend.
    In the when-button-pressed trigger I make a call to the procedure where the Logon function is coded
    Function P_CONNECT (io_message IN OUT varchar2)
    Account_locked EXCEPTION;
    Password_expired EXCEPTION;
    Password_will_expire EXCEPTION;
    PRAGMA Exception_Init (Account_locked, -28000);
    PRAGMA Exception_Init (Password_expired, -28001);
    PRAGMA Exception_Init (Password_will_expire, -28002);
    begin
    begin
    Logon( L_username,
    L_string,
    FALSE);
    exception
    when Account_locked then
    io_message := 'acc_loc';
    return FALSE;
    end;
    if form_success then
    /* code with certain activities*/
    end if
    end;
    During the execution of this procedure, i tried to capture the account_locked for example. I couldnt.
    Then I created on_error trigger at the form level. I couldnt able to capture as well.
    Also I need the form errorcode (FRM 4....) equvalent to -28000. -28001, -28002.
    Or any other suggestions are welcome
    Thanks
    Sada

    Hi,
    I got struck with the similar case. i.e.., if the user enters the login details incorrectly or login details are not provided then I've used exec_sql package. This package is been used to check whether a connection can be established or not. If the connection cannot be established then I'll pop up a message saying that the login details are incorrect.
    Though my case is different than that of yours, but i think that this will give u some idea to kick start to your solution.
    Regards,
    Alok Dubey

  • How to capture the value ?

    Hello Everyone,
    I am running a BDC program using call transaction , and I am updating some records in FB01 , then  for each record a number is generated  called document number ( bkpf - belnr ),
    I want to capture the number generated for each record i process ?
    if i process 10 different records at a time, then how to find which document number is generated for which record ?
    will be rewarded ??

    declare the internal table of type structure BDCMSGCOLL.
    Use this itab in call transaction.
    ex:
    call transaction.......messages into itab.
    if sy-subrc = 0.
    endif.
    In debugging mode check if itab contains any document number for the success full record. Generally it contains the number.

  • How to capture Java Exceptions in batch file

    I have a batch file that calls java class. When the java class throws exception, how do I capture the exception as an error message in batch file.
    This is the java program
    import java.io.*;
    public class Test{
           public static void main(String []args) {
         String wantThisToFail=null;
              try {
                   if (wantThisToFail.equals("SomeString") ) {
                        System.out.println("Testing");     
              }catch (Exception e){
                   System.out.println("Exception " + e);
    This is the batch file
    @echo off
    echo Testing
    REM execute the java class
    java Test
    set deployError=%ERRORLEVEL%
    echo %deployError%
    IF NOT %deployError% == 0 (
    echo failed
    )else (
    echo succeeded
    )Since the java class throws NullPointerException, i want the batch file to show "Failed" Message.
    Please Help!!

    Try capturing the return value of the command "java Test". If it succeeds, you should get a '0', otherwise you'll get something else. I admit it's been years since I had to do that, but it rings a bell. If it works, and you're on Java 5 or later, you can use the method Thread.setDefaultUncaughtExeptionHandler ( look at the docs ) and from there use System.exit(<your integer value return code here>) for more control over the return value

  • Capture BEx exceptions in a class (superclassCL_RSR_WWW_MODIFY_TABLE)

    Hi....
    I am trying to capture the exceptions defined in the BW BEx Reports in a z-class (superclass - CL_RSR_WWW_MODIFY_TABLE) in a variable or something.
    This is actually to change the properties of a table in Web Applcn. acc to the exceptions specified by altering the cell content in the class(Transaction - SE80).
    Is it possible to store the exceptions in a variable in the class???

    Hi,
    You can acheive this through using the CAPTION_CELL method and CHARACTERISTIC_CELL methods.
    We need to use CAPTION_CELL method to merge headers and then the other one to merge char values.
    For detail info refer these links:
    Merging the values of two columns into one column BW Report
    You can make use of the coding and methodlogy that was used in this below article.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f0aca990-0201-0010-0380-f3aac4127a57
    Hope this helps you.
    Regards,
    Rajkandula

  • Capturing the AuditLog from Aadapter and sending to sender through alert

    Hi Experts,
    I have a requirement where I have to send the sender system ( specially the   vendor) an email if message fails at adapter level.
    I need to also capture the exception or cause stated in the comm. channel adapter.
    Is it possible to do this  through alert ?
    like the alert will capture the audit log from adapter  and send it to the sender through the defined alert rule ?
    Thanks
    Vinny

    Hi,
    Yes this is possible. Please check this blog for how to configure the alerts
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    You can also have a seperate alert category in ALRTCATDEF for adapter engine alerts.
    Then in the alert rule you can specify the where the alert occurs as "adapter engine"
    try first having an alert rule having wild card * for all fields and do NOT check "suppress multiple alerts from this rule" option.
    Afterwards you can try creating more granular alert rules for specific interfaces if required.
    The container element SXMS_TO_ADAPTER_ERRTEXT should be used in the alert category in ALRTCATDEF for getting the exception text from the adapter engine, communication channel. This container element will show you only first 70 characters of error text in audit log. In later PI releases from PI70 SP19 onwards there is new container element available &SXMS_TO_ADAPTER_ERRLINES[]& (sap note 1294312) and this will  help to display the complete error text of the audit log in the alerts.
    Regards,
    francis

Maybe you are looking for

  • Windows XP installation on Satellite U300

    I need to downgrade my notebook from vista to XP pro. After slipstreaming the new sata drivers into XP I installed windows xp. After installing all the drivers (and chipset drivers) i have two questionmarks left. (other devices) I realy don't have an

  • How can I stop and restart a .vi with a single front panel button?

    Hey guys, a newbie here. I have a .vi with a stacked sequence. The first few frames are hardware initialization and settings (LIN master node) and the data the hardware should transmit (frame response table). In the next frame there's a loop in which

  • ERROR message while posting SHIPMENT order

    Hi all, i have developed one program which can create a shipment order using BAPI_SHIPMENT_CREATE.After uploading, i have passed all the data to this FM. in my return parameter, i am getting only error message number & type of message but message  is

  • ISE Client Provisioning of Certifcates

    I am trying to setup an ISE deployment to allow me to connect to an SSID for client provisioing only. The provisioing should install a certificate from the CA server and setup the new SSID eap-tls authentication settings. I have two questions in rega

  • Java.sql.SQLException: Closed Connection error when invoking web service

    Hi I've assembled a simple web service for an Oracle PL/SQL package and deployed it on a Standalone OC4J, when I come to invoke it on the Oracle Enterprise Manager screen I'm getting the following returned within the envelope body: <env:Body> <env:Fa