Can a client call the ejb callback methods directly????

Is there any way using which client can call the ejb callback methods directly.
ie in the client program i want to call ejbPassivate/ejbActivate?? is there any way of doing the same

short answer: yes, pass a reference of the ejb (bean class) to the client. This will not do what you expect however and hopefully with generate an error that you should read as "don't do this".
better answer: you are no longer doing ejb development if you do this. those methods exists for the container to interact with your bean and are NOT meant for clients. You should NEVER do what I suggest in my "short answer".

Similar Messages

  • How to call the screen in methods could u please explain

    hi,
    how to call the screen in methods could u please explain clearly with example

    HI ,
    CALL SCREEN - Call a screen
    Basic form
    CALL SCREEN scr.
    Addition:
    ... STARTING AT x1 y1 ... ENDING AT x2 y2
    Effect
    Calls the screen scr; scr is the number of a screen of the main program. You use SET SCREEN 0. or LEAVE SCREEN. to define the return from the CALL screen.
    Note
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition
    ... STARTING AT x1 y1  ENDING AT x2 y2
    Effect
    The coordinates x1, y1 (start column and start line in the window) and x2, y2 (end column and end line in the window) define the size and position of the CALL screen ("top left - bottom right"). Besides these coordinates, you can also see the contents of the primary window, but cannot perform any action there.
    Note
    If "ENDING AT ..." is not specified, suitable values are substituted for x2 and y2, taking into account the size of the called screen.
    Exceptions
    Non-Catchable Exceptions
    Cause: No further screen level (call screen); the maximum number of nested screen levels is restricted to 50 at present.
    Runtime Error: DYNP_TOO_MANY_CALL_SCREENS
    THX

  • Server error when calling the DatabaseController.replaceConnection() method

    <p>I am receiving the error message below when calling the DatabaseController.replaceConnection() method. Can anyone tell me what may be the cause of this? The code being executed is below the error message.
    </p>
    <p>
    Thank you.
    </p>
    <pre>
    A server error occured while processing the CrystalReport object, wfr.rpt (AVTJyRKrfDxKtXX31l5E9Ek), from the CMS.
        Unable to connect to the server: ATHENA.ReportApplicationServer.
         --- java.lang.Boolean cannot be cast to java.lang.String
    Stack Trace:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server:
        ATHENA.ReportApplicationServer. - java.lang.Boolean cannot be cast to java.lang.String--
        Error code:-2147217387 Error code name:connectServer
            at com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException.
                    throwReportSDKServerException(Unknown Source)
            at com.crystaldecisions.sdk.occa.managedreports.ras.internal.CECORBACommunicationAdapter.
                    request(Unknown Source)
            at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
            at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
            at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
            at com.crystaldecisions.sdk.occa.report.application.DatabaseController.replaceConnection(Unknown Source)
            at aiConfigUtility.cmdlline.ImportExportBiarFile.changeReportDataSource(ImportExportBiarFile.java:561)
            at aiConfigUtility.cmdlline.ImportExportBiarFile.processBiarFile(ImportExportBiarFile.java:726)
    </pre>
    <br />
    <pre>
    private void test(String reportName)
       throws SDKException, ReportSDKException, java.io.IOException
       IInfoObjects newInfoObjects;
       IInfoObject reportObj;
       ReportClientDocument clientDoc = new ReportClientDocument();
       DatabaseController dc;
       PropertyBag pBag;
       PropertyBag logonProps;
       ConnectionInfo newConInfo;
       ConnectionInfo oldConInfo;
       ConnectionInfos conInfos;
       int connOptions = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB; //0;
       Fields connFields = null;
       String queryStr = "Select * From CI_INFOOBJECTS " +
          "Where SI_NAME='wfr.rpt' AND SI_KIND='CrystalReport' AND SI_INSTANCE=0";
       newInfoObjects = getCms().executeQuery(queryStr);
       if(newInfoObjects.size() > 0)
          reportObj = (IInfoObject)newInfoObjects.get(0);
          try
             clientDoc = getCms().getReportAppFactory().openDocument(
                reportObj
                , OpenReportOptions._refreshRepositoryObjects
                , java.util.Locale.US);
             dc = clientDoc.getDatabaseController();
             conInfos = dc.getConnectionInfos(null);
             for(int i = 0; i < conInfos.size(); ++i)
                oldConInfo = (ConnectionInfo)conInfos.getConnectionInfo(i);
                newConInfo = (ConnectionInfo)oldConInfo.clone(true);
                pBag = newConInfo.getAttributes();
                pBag.putStringValue("QE_ServerDescription", "alio");
                logonProps = new PropertyBag();
                logonProps.putStringValue("Trusted_Connection", "false");
                logonProps.putStringValue("Server", "alio");
                pBag.put("QE_LogonProperties", logonProps);
                newConInfo.setUserName("admin");
                newConInfo.setPassword("password");
                <b>dc.replaceConnection(
                   oldConInfo
                   , newConInfo
                   , connFields
                   , connOptions);</b>
          catch(ReportSDKServerException Ex)
             String msg = "A server error occured while processing the " + reportObj.getKind()
                + " object, " + reportObj.getTitle() + " (" + reportObj.getCUID() + "), from the CMS.";
             Utility.errorOut(msg, Ex);
          catch(Exception Ex)
             String msg = "An error occured while processing the " + reportObj.getKind()
                + " object, " + reportObj.getTitle() + " (" + reportObj.getCUID() + "), from the CMS.";
             Utility.errorOut(msg, Ex);
          finally
             clientDoc.save();
             getCms().commitToInfoStore(newInfoObjects);
             clientDoc.close();
    </pre>
    Edited by: Mark Young on Sep 10, 2009 2:13 PM

    <p>I just wanted to provide an update to this. I did find a work-around for this, but I cannot explain it. The post I added to a related thread on 23 Sept. 2009, Trying to change the data source for a Crystal Report. (thread 1472257), explains a work-around I found for that problem. It seemed to resolve this one simultaneously. 
    </p>
    <p>
    I don't know why it works. If anyone has a comment or some insight, it is welcome. Thank you in advance.
    </p>

  • Can we hav call transaction and session method for an application

    can we hav call transaction and session method for an application ?if yes how?

    Hi ,
    You can.  If Call Transaction fails, a batch input session can be created.
    Check this example-
    Call the transaction. Messages from Call Transaction are stored in the
    internal table messtab 
      CALL TRANSACTION 'LT01' USING bdc_tab MODE 'N' UPDATE 'S'
          MESSAGES INTO messtab.
      IF sy-subrc = 0.                                                 
    Call transaction successfull,  get the number of the Transfer Order that
    was created                                                        
        LOOP AT messtab.                                               
          IF messtab-dynumb = '0104' AND messtab-msgnr = '016'.        
            w_transportorderno = messtab-msgv1.                        
          ENDIF.                                                       
        ENDLOOP.
      ELSE.
    Call transaction failed, create a batch input session instead.
        PERFORM open_group.                        
        PERFORM bdc_insert USING 'LT01'.           
        PERFORM close_group.                       
    ENDIF.
    Regards,
    Sookshma

  • Unable to call the backend action method

    Hi,
    First of all,I would like to let you know that I am not very much familiar with jsf. My problem is as follows:
    I have a jsf page having some input text boxes,one gridview component( Infragistics jsf component) and a submit button. On submit, I am trying to call one managedbean action method. The gridview component has further two columns,one input text box and one h:selectonemenu component.
    When I try to submit the page, it doesn't call the managedbean action method.The gridview component has one attribute called datasource which is basically a list.During debugging, I found that on submitting the page, it goes to getter of datasource.
    One thing I noticed that If I remove the h:selectonemenu from the gridview component, the action method gets called.
    Can any body please suggest me where could be the problem?
    Thank you

    Hi Guys,
    Thanks for your solutions and answers. My problem was solved.
    But again I have similar kind of problem. This time I have h:selectOneRadio component which seems to be causing the problem because if I remove this, the call goes to action method. It's again seems to be conversion or validation error.As suggested,I have tried putting <h:message> for this component but I get a warn message in console like "Unable to find component with ID 'categorylist' in view". I further saw in the html source of the page and indeed found that the id was not there.I have no idea about it,why it's happening.
    I have following code snippet for jsp page:
    <div id="inner_body" style="height: 550px;">
                                  <h:outputText value="#{msg.Manage_MED_CLASS}" styleClass="title" />
                                  <h:messages globalOnly="true" styleClass="error" />
                                  <f:verbatim>
                                       <br />
                                       <br />
                                  </f:verbatim>
                                  <br />
                                  <ig:gridView id="medclassdefnitionlist"
                                       dataSource="#{medClassManagedBean.medClassDefinitions}">
                                       <ig:column>
                                            <f:facet name="header">
                                                 <h:outputText value="Med class definition"></h:outputText>
                                            </f:facet>
                                            <h:outputText value="#{DATA_ROW.medClassDef}"></h:outputText>
                                       </ig:column>
                                       <ig:column>
                                            <f:facet name="header">
                                                 <h:outputText value="Classification(Controlled/Uncontrolled)"></h:outputText>
                                            </f:facet>
                                            <h:selectOneRadio id="categorylist"
                                                 value="#{DATA_ROW.medClassCategory}"
                                                 style="white-space: nowrap">
                                                 <f:selectItem itemLabel="Yes" itemValue="true" id="itemid1"/>
                                                      <f:selectItem itemLabel="No" itemValue="false" id="itemid2"/>
                                            </h:selectOneRadio>
                                            <h:message for="categorylist" styleClass="error"></h:message>
                                       </ig:column>
                                  </ig:gridView>
                                  <f:verbatim>
                                       <br />
                                       <br />
                                  </f:verbatim>
                                  <h:panelGrid columns="2" cellpadding="4" cellspacing="3">
                                       <h:commandButton image="../../../images/btn_save.gif"
                                            accesskey="S"
                                            action="#{medClassManagedBean.saveMedClassDefinition}"
                                            style="outline: none;"></h:commandButton>
                                       <h:commandButton accesskey="C" style="outline: none;"
                                            image="../../../images/btn_cancel.gif"
                                            action="backtoreportinglevel" />
                                  </h:panelGrid>
                             </div>Under ig:gridView component, I have two columns, in the first one h;outputtext is there while in the 2nd one h:selectOneRadio is there. I tried putting immediate="true" in h:commandButton , and then the call goes to the action method. So, it is definitely failing in either validation or conversion phase.
    The following is my java code snippet:
    public ArrayList<MedClassBackingBean> getMedClassDefinitions() {
              try {
                   medClassDefinitions = new ArrayList<MedClassBackingBean>();
                   HttpServletRequest request = (HttpServletRequest) FacesContext
                             .getCurrentInstance().getExternalContext().getRequest();
                   HttpSession session = request.getSession();
                   String hospitalCode = (String) session
                             .getAttribute(Constants.HOS_GLO_EXCLUSION_SESSION_VAR);
                   MedGroupBD medGroupBd = new MedGroupBD();
                   List<Object[]> medClassList = medGroupBd
                             .getMedClassDefinitionsForHospital(hospitalCode);
                   //populateMedClassCategoryList();
                   if (UtilityFunctions.isNotEmpty(medClassList)) {
                        for (Object[] medClass : medClassList) {
                             MedClassBackingBean medClassBackingBean = new MedClassBackingBean();
                             medClassBackingBean.setHospitalCode(hospitalCode);
                             medClassBackingBean.setMedClassDef(medClass[0].toString());
                             if (medClass[1] != null) {
                                  if (medClass[1].toString().equals("Controlled")) {
                                       medClassBackingBean.setMedClassCategory("true");
                                  } else {
                                       medClassBackingBean.setMedClassCategory("false");
                             } else {
                                  medClassBackingBean.setMedClassCategory("false");
                             medClassDefinitions.add(medClassBackingBean);
              } catch (Exception e) {
                   log.error(e.getMessage(), e.getCause());
              return medClassDefinitions;
         }The above code returns the list for the ig:gridView datasource. "medClassCategory" is the property of backing bean which is mapped for the value attribute of h:selectOneRadio component. The managed bean is in the request scope.Right now on submit of form, first the call goes to this method "getMedClassDefinitions" and then I found like call goes to setter of medClassCategory property in the backing bean as well and sets the changed value from the UI but it never goes to the action method.
    Please see if anybody can help me.
    Thank you,
    Edited by: dacsinha on Nov 27, 2009 6:36 AM

  • I have deploy an EJB in weblogic 6.1,but how to use jsp to invoke the EJB's method?

    i have deploy an EJB in weblogic 6.1,but how to use jsp to invoke the EJB's method?
    thanks!

    You'd do something like:
    <%
    //vvv this part can potentially be done in initialization
    Context ctx = getInitialContext();
    BeanHome home =
    (BeanHome)PortableRemoteObject.narrow(ctx.lookup("the.jndi.name"),
    BeanHome.class);
    Bean b = home.create();
    //^^^
    Result r = b.invokeMethod();
    %>
    "toxin" <[email protected]> wrote in message
    news:3d2e95e5$[email protected]..
    >
    i have deploy an EJB in weblogic 6.1,but how to use jsp to invoke theEJB's method?
    thanks!

  • The URL to call the screen of RFx directly

    Dear expart.
    I'm setteing at SRM7.0 in order to call RFx directly from SUS now.
    I would like to know what URL should be sat at URL of BIDDING_SERVICE in CustomerSetting of SUS.
    Should I set URL of EP there?
    Should I set URL of ITS as well as SRM5.0?
    Because ITS have not been used since SRM7.0, I have no Idea how to set.
    SO could you please let me know if you know the URL calling the screen of RFX directly.
    Thanks

    Hello ,
    Please use the url to launch the RFQ BO directly.
    HTTP://<Server and Port>/sap/bc/webdynpro/sapsrm/wda_l_fpm_oif?
    sap-wd-configId=/SAPSRM/WDAC_I_FPM_OIF_RFQ_PR_PU
    &sap-system-login-basic_auth=X
    &sap-client=<client_no>
    &sap-language=EN
    &SAPSRM_BOID=<Object Guid>
    &SAPSRM_BOTYPE=BUS2200
    &SAPSRM_MODE=DISPLAY
    Let me know if you have any further issues.
    Best Regards.
    Mani

  • How to call the EJB methods from servlet/jsp

    Hello ,
    i have write one ejb signOn having the method validateUser(username,password).i can able to call this function from client.java class.i want to know whether i can call this function from servlet.if yes then where to write that servlet and web.xml file.
    At present i m using weblogic server 8.1and i create directory call c:\ejb\demo and put the ejb files(home ,remote,ejb class ,client.java) then i have created .jar file and put in application file.
    Now i want to create a servlet for that i have to create a new directory and put the servlet,web.xml,weblogin-web.xml file and then create one .war file and put in application directory or do some thing extra.Please help me.
    Thanks In Advance
    [email protected]

    I think this might not be the most appropriate forum for your question. You might try a forum about ejb, or weblogic, or jndi.

  • Somehow ejbCreate method of an Entity EJB is not inserting a record into the database. I'm using BMP and calling the Entity bean method from a servlet. I'm using NAS 4.0 sp5 on Win 2k.

    Also if I call the insert query from within the servlet it works fine. I have disabled global transactions. Am I missing something out ? Please
    any help would be greatly appreciated.

    May be your servlet is not able to lookup the EJB. You can use some print statements and see whether lookup ok or not.
    Just a guess.
    Plese get back, if any queries.
    Thanks,
    Rakesh.

  • Managing a UserTransaction from a client calling an EJB

    This post is similar to one I read from October (Subject: Need help with
              transactions!) but I didn't see a final answer to it. I am curious if a
              UserTransaction can be created (like explained in
              http://www.weblogic.com/docs51/classdocs/jts_driver.html) in a jsp page and
              saved in the session until user interaction calls a commit or rollback. The
              jsp will call methods on a stateful session bean with a 'Required'
              transactional option. The session bean will be interacting with Entity
              beans with a 'Supports' transactional option. It appears to work fine if I
              create a UserTransaction, call begin(), call session bean methods then call
              commit() or rollback() on one jsp page submission. However, when I try to
              save the UserTransaction instance as a session attribute so that the user
              can commit or rollback, the UserTransaction seems to be set to the
              STATUS_NO_TRANSACTION. Is this possible and if so any suggestions would be
              appreciated. I have investigated the documentation and cannot seem to find
              any answers.
              Thanks
              Todd Smith
              

    I can answer my own question, and the answer was in another thread.
    Use the entityManager.flush() which will execute any sql methods on the datasource to sync up managed entities immediately (as opposed to when the transaction ends), and equally important this method throws sql excpetions in the form of a catchable PersistenceException, which contains detailed information about why the sql commnd failed.
    So just inserting a flush() method after my persist() solved my issue -it makes it possible to catch and interpret sql exceptions from inside an ejb whose entityManage method is resulting in an sql exception.

  • We want to deploy Servlet/JSP in JServ and call the EJB's deployed in iPlanet App Server 6.0 SP2. How do we make the getInitialContext Call be able to access the EJB's.

    Additionally what configurations do we need to make sure we have on JServ (Third party Servlet container) to make sure that the iPlanet EJB's can be accessed.

    Let me preface my instructions with the comment that this isn't a good idea. Although the J2EE specification allows you seperate your web container from your EJB container, in practical deployments it is a bad idea. The overhead of doing RMI/IIOP calls to an external container as opposed to making inter-JVM calls means that you can expect roughly an order of magnitude less performance than if you colocate your web and EJB containers. (This is why all EJB containers are also web containers, or at least have the provision to install themselves in the same JVM as a web container.)
    That said, if you do not have the option to move the servlets to iAS, you can access EJB's in iAS from JServ the same way that you would from any remote client. Take a look at the following information for more detail:
    Chapter 9 of the developer's guide ( this shows you what changes you need to make to the remote JVM (at JServ) and in the EJB's that you are exposing).
    The RMI/IIOP sample application. This gives you an example of how to access EJB's from outside the container.
    (To answer your direct question, the following code will get the initial context. But if you don't take all of the other configuration steps, this code won't work:
    env.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put("java.naming.provider.url", "iiop://" + host + ":"+port);
    Context initial = new InitialContext(env);
    I'd also suggest that you approach the task with the following approach. (Assuming that I haven't managed to convince you that this is a really bad idea.)
    1. Get your EJB's working on iAS. Test them with servlet harnesses running on iAS.
    2. Get your servlets working on JServ, if they aren't already.
    3. Create a simple standalone Java application as a test harness for EJB's. Follow the RMI/IIOP instructions until you get this test harness working.
    4. Create a simple servlet test harness in JServ to access your EJb's. Follow the JVM setup instrucitons until you get this working.
    5. Actually integrate the EJB's with your production application.
    I say this because there are about five trillion things that can go wrong in this process. Although the troubleshooting steps in the docs are helpful, I find that it helps to get one thing working at a time. It's very frustrating to spend a day trying to resolve JNDI issues only to find out that you have your CXS configured improperly.

  • Calling the super class method from the subclass

    Hi all,
    I have a question about inheritence and redefinition of methods. Is it possible to call the superclass implementation of a method which is redefined in the subclass in another method of the subclass?There are possbilities like creation of an explicit super class instance or delegating the super class method implementation to another method which is also protected etc. What i mean is, is there a direct way of calling it?We have ,me,   as the reference for the instance we have(which is the subclass instance in this case), is there also a way of pointing the superclass implementation(with super we can reference in the subclass redefinition, my question is if we have such a parameter in other methods of the subclass too)
    Thanks in advance
    Sukru

    Hi,
    The super reference can only be used in redefined methods to call superclass implementation . So probably what you can do is use upcasting and access the required superclass implementation. I can think of only this way...;-)
    Ex data lr_super type ref to cl_superclass
    lr_super = lr_subclass.
    lr_super->method().
    ~Piyush Patil

  • Can we use Call transaction and session method in same program ?

    Hi experts,
                     Is it suggested to use call Transaction and session method in the same Program ?
                     i have a doubt , why cant we use multiple call transactions in same program instead of session method if we have multiple transaction updations ?

    Hi Dengyong Zhang,
    we can use the call transation and session method in same program.
    However for better performance it's benificial to use call trasaction method of BDC. but if u want to upload very large amount of data then Session method is more preferable to use.
    Session method is one of the method of BDC.
    U can also use BAPI to upload the data in SAP but it's a different concept than BDC. Performance wise BAPI is more advantageous than BDC.

  • How can a client know the ip of the server?

    How can a client locate a rmi - server without
    have the ip of the server.
    Is there a methode that can check if there's a
    server in a L.a.n?

    We have used 2 different solutions.
    1. Our servers use UDP multicast and send out empty packets every second. The client listens on the multicast address:port, and once it sees a packet, it bootstraps the RMI object by contacting the registry on the server that sent the multicast.
    2. In another case we use JNLP/ Webstart to launch the client. With JNLP you can pass a parameter through to the app's System.properties via -D option on the command line using the jnlp property tag. If you change the ip address of the server you just update the *.jnlp file's particular <property> tag with the new value. The next time everyone launches the app, webstart will see that the *.jnlp has changed, will download the latest version of the jnlp file, decide it has all the correct jars etc, then launch the app with the new property value.
    This is a great way to centrally manage the configuration of multiple clients when the configuration is the same on all clients but might change over time.
    Bruce

  • Need to Call the Parent Class Method

    Hi..
    Please go thru the following code.
    class Parent {
         Parent() {
              System.out.println("In Parent Constructor");
         void set() {
              System.out.println("In Parent set method");
    class Child extends Parent {
         Child() {
              System.out.println("In Child Constructor");
         void set() {
              super.set();
              System.out.println("In Child set method");
    class SetTrial {
         public static void main(String args[])
              Child aChild = new Child();
              Parent theImpl = (Parent)aChild;
              theImpl.set();
    I want to know, is there any way by which we can get the Parent Set method to be executed, when we invoke it in main.
    In the main, I should be able to decide which Set to invoke based on certain conditions.
    TIA..
    Basu.

    Since you seem to have an aversion to using the child class decide whether to call just the parent's set function, I think I would do it like this:
    class Parent{
      Parent() {
         System.out.println("In Parent Constructor\n");
      void set(ConditionClass C) {
        System.out.println ("In Parent set method\n");
    class Child extends Parent {
      Child() {
        System.out.println("In Child Constructor");
      void set(ConditionClass C) {
        super.set();
        if (C.CallChildSet()) {
          System.out.println("In Child set method");
    class SetTrial {
         public static void main(String args[])
              Child aChild = new Child();
              Parent theImpl = (Parent)aChild;
                    ConditionClass C = new ConditionClass()
              theImpl.set(C);
    }In any case I would decide in the child's set to call the parent's set or not.

Maybe you are looking for