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.

Similar Messages

  • Calling a backing bean method after load of fragment in adf

    I needed to call a backing bean method after page load of fragment in adf.
    I used the method suggested in:
    https://community.oracle.com/message/11044570
    only difference is im giving the if clause as:
    if (refreshFlag == RegionBinding.RENDER_MODEL ) {
    instead of
    if (refreshFlag == RegionBinding.PREPARE_MODEL)
    It was working fine, but page was not getting refreshed so used the code as mentioned in example:
    public void refresh() {
              FacesContext facesContext = FacesContext.getCurrentInstance();
              String refreshpage = facesContext.getViewRoot().getViewId();
              ViewHandler  viewHandler =facesContext.getApplication().getViewHandler();
              UIViewRoot viewroot =  viewHandler.createView( facesContext, refreshpage);
              viewroot.setViewId(refreshpage);
              facesContext.setViewRoot(viewroot);
    Now issue is once page is loaded and backing bean method is called, the refresh code refreshes the page and upon page load, refresh method is called again in recursive fashion.
    please advise what to do in such scenario?
    I tried to do selective refresh using some variable(also with static) but it does not help as page wont be refresh at all or page will keep refreshing recursively.

    Use clientListener on the page load event
    <af:document id=”d1″>
        <af:serverListener type=”onloadEvent”
                           method=”#{<managedbean name>.<method name>}”/>
        <af:clientListener method=”onLoadClient” type=”load”/>
        <af:resource type=”javascript”>
        function onLoadClient(event) {
          AdfCustomEvent.queue(event.getSource(),”onloadEvent”,{},false);
          return true;
        </af:resource>

  • Is it possible to call any Managed Bean method from af:goLink

    Hi,
    I am using RichGoLink component.
    Is it possible to call a managed bean method on click of the af:goLink? I want to provide some validations when user clicks on the goLink.
    There is no any actionListener provided.
    Thanks in advance.

    Hi,
    I am able to resolve my second problem also.
    i wanted to set the "destination" of the goLink on the fly. To do this I created a custom componnt by extending the RichGoLink and I override the encodeBegin method in that class. In this method i check my condition and then set the "destination" property.
    I am still using the clientListener and the serverListerner to do some further testing that i wanted to. Here one thing you have to keep in mind that. In the javascript function that we are calling in the clientListener should not do the "cancel" on the event object, if you do so it will not navigate to the required position.
    Thanks for the way you showed to resolve my problem. Hope you understand the way i worked for this solution.

  • New To Iplanet app server.Can some one help me getting started by delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with iplanet docs..didnt quite get it. thanx

     

    Hi,
    What is that you are trying to accomplish ? Is it deployment or
    trying to develop applications ? Are you getting any errors ? If so,
    please post them to help you. I think the documentation is the best place
    for you to begin with.
    Regards & Happy New Year
    Raj
    Arif Khan wrote:
    New To Iplanet app server.Can some one help me getting started by
    delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with
    iplanet docs..didnt quite get it. thanx
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • What is the difference between on new focus and do prepare out put methods

    Hi,
    what is the difference between on new focus and do prepare out put methods.

    Hi Divya,
    DO_PREPARE_OUTPUT method is triggered each time the view is prepared after each event. Normally we redefine this method in order default the initial values based upon the parameter iv_first_time = 'X'. There can be certain other scenarios like putting data validations where this method can be helpful.
    For details on ON_NEW_FOCUS, refer to this [thread|on_new_focus event;
    Thanks
    Vishal

  • Call a backing bean method using h:selectBooleanCheckbox of jsf on select

    I want to call a backing bean method using h:selectBooleanCheckbox of jsf on select and deselect.
    I cannot use af:selectBooleancheckBox of adf and h:selectBooleanCheckbox doesnot have the property of autosubmit="true"

    User,
    please don't duplicate your posts on this forum ({thread:id=2369739})
    If you don't get an answer right away it might be that there is some information missing or nobody had time to work on the issue. Pleas be patience...
    We all have other work to do to get our bills paid.
    If you can't wait open a support request with support.oracle.com
    Timo

  • NoSuchMethodException calling a session bean method from a web service

    I am running on NetWeaver 6.40 SP10 on Windows.
    I have a Java class (not a SessionBean) exposed as a web service where I invoke a session bean method with an argument that is another Java class (basically, just a JavaBean with some getters and setters).  I am getting a strange reflection-related error when I invoke a session bean method.  The exception I see is a 'java.lang.reflect.UndeclaredThrowableException', and if I unwrap it with 'ex.getCause()', I see 'java.lang.NoSuchMethodException: com.xx.ejb.PersistentObjectSBObjectImpl0.createR3Config(com.xx.common.R3Config)'
    I have spent several days trying to come up with a testcase for this, but to no avail.  The calling class is:
    --- snip R3UpdateTest.java ---
    package com.xx.server.webse;
    import com.xx.ejb.*;
    import com.xx.common.*;
    import java.util.*;
    import javax.ejb.*;
    import java.rmi.*;
    import javax.naming.*;
    * @author william_woodward
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    public class R3UpdateTest {
         public String createR3Config(String a, String b, String c,
                   String d, String e, String f) {
              String retval = "success!";
              try {
                   PersistentObjectSB poSB = getPersistentObjectSB();
                   R3Config r3cfg = new R3Config();
                   r3cfg.setR3HostName(a);
                   r3cfg.setR3SystemNumber(b);
                   r3cfg.setRfcUserName(c);
                   r3cfg.setRfcPassword(d);
                   r3cfg.setRfcClient(e);
                   r3cfg.setRfcLanguage(f);
                   poSB.createR3Config(r3cfg);
              } catch (Exception ex) {
                   retval = "Exception: " + ex + ", Causing Exception : " + ex.getCause();
              return retval;
          * Private methods
         private PersistentObjectSB getPersistentObjectSB() throws RemoteException, CreateException, NamingException {
              Properties props = new Properties();
              props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              props.put(Context.PROVIDER_URL, "localhost:50004");
              InitialContext ctx;
              ctx = new InitialContext(props);
              PersistentObjectSBHome poSBHome =
                   (PersistentObjectSBHome) javax.rmi.PortableRemoteObject.narrow(
                        ctx.lookup("xx.com/CMPOBEAR/PersistentObjectSBBean"),
                        PersistentObjectSBHome.class);
              return poSBHome.create();
    --- end R3UpdateTest.java ---
    If I change the createR3Config() method to take an argument of class 'Object' instead of an argument of class 'R3Config', and then cast the object back into an R3Config in the method body, it all works fine.
    Any clues, anyone?
    Thanks,
    - Bill
    Message was edited by: Bill Woodward - Fixed some funky formatting

    Sure, I can show them to you.  They are very similar to a couple of non-DC classes/projects I put together to try and duplicate the problem.
    First, the interface, PersistentObjectSB.java:
    package com.xx.ejb;
    import javax.ejb.EJBObject;
    import com.xx.common.R3Config;
    import java.rmi.RemoteException;
    public interface PersistentObjectSB extends EJBObject {
          * Business Method.
         public void updateR3Config(R3Config r3Config) throws RemoteException;
          * Business Method.
         public void createR3Config(R3Config r3Config) throws RemoteException;
    And the implementation, PersistentObjectSBBean.java:
    package com.xx.ejb;
    import java.util.*;
    import javax.ejb.*;
    import javax.naming.*;
    import com.xx.common.*;
    import com.xx.interfaces.*;
    * @ejbHome <{com.xx.ejb.PersistentObjectSBHome}>
    * @ejbLocal <{com.xx.ejb.PersistentObjectSBLocal}>
    * @ejbLocalHome <{com.xx.ejb.PersistentObjectSBLocalHome}>
    * @ejbRemote <{com.xx.ejb.PersistentObjectSB}>
    * @stateless
    public class PersistentObjectSBBean implements SessionBean {
         private R3ConfigEJBLocalHome _r3ConfigEJBLocalHomeIf = null;
         public void ejbRemove() {
         public void ejbActivate() {
              try {
                   setEJBLocalHome();
              } catch (NamingException e) {
                   throw new EJBException(e);
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
         private SessionContext myContext;
          * Create Method.
         public void ejbCreate() throws CreateException {
              try {
                   setEJBLocalHome();
              } catch (NamingException e) {
                   throw new CreateException();
          * Business Method.
         public void updateR3Config(R3Config r3Config) {
              try {
                   R3ConfigPrimaryKey primKey = new R3ConfigPrimaryKey();
                   primKey.r3HostName = r3Config.getR3HostName();
                   primKey.r3SystemNumber = r3Config.getR3SystemNumber();
                   R3ConfigEJBLocal r3ConfigEJBLocal =
                        _r3ConfigEJBLocalHomeIf.findByPrimaryKey(primKey);
                   if (r3ConfigEJBLocal != null) {
                        r3ConfigEJBLocal.updateR3Config(r3Config);
              } catch (Exception e) {
                   // What to do here?
          * Business Method.
         public void createR3Config(R3Config r3Config) {
              try {
                   R3ConfigEJBLocal r3ConfigEJBLocal =
                        _r3ConfigEJBLocalHomeIf.create(r3Config);
              } catch (Exception e) {
                   // What to do here?
         private void setEJBLocalHome() throws NamingException {
              Properties props = new Properties();
              props.put(
                   Context.INITIAL_CONTEXT_FACTORY,
                   "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              InitialContext ctx = new InitialContext(props);
              Object obj = ctx.lookup("localejbs/R3ConfigEJB");
              _r3ConfigEJBLocalHomeIf = (R3ConfigEJBLocalHome) (obj);
    Thanks,
    - Bill

  • Problem Calling Remote Session Bean Method

    Need help. I am trying to call a method in a remote stateless session bean in an EJB in my web application from a stateless session bean in a different EJB in the web application. I am getting a run-time error that says,
    "java.lang.NoClassDefFoundError: dtpitb.common.sb.reports.CommonReportsHome"
    ref = ctx.lookup( jndiName );
    // Cast to Local Home Interface using RMI-IIOP
    commonReportsHome = (CommonReportsHome)
    PortableRemoteObject.narrow(ref, CommonReportsHome.class);
    If while in a session bean of an EJB, I want to call a public method in the session bean of a totally different EJB, is there something in particular I am missing. I can make the call from the web application code. I can make a remote call from this session bean to itself in the exact same fashion. I just can't call a session bean in another EJB. All thoughts are welcome.
    Thanks,
    Pete

    Thanks for replying. That could very well be the case I suppose. I'm using JBuilder and WebLogic, and JBuilder pretty much does all of the deployment descriptor code for me. However, maybe this is something I need to incorporate manually.
    One EJB is in the same project as the web application code. The other EJB (common_ejb) is in another project. The calling session bean is in the project with the web app, and the remote session bean method that I'm targeting is in the common EJB session bean. Both EJBs are included in the web app's WEB-INF\lib dir and in the war file.
    So theoretically, this isn't an unconventional practice I assume?
    Thanks,
    Pete

  • Calling a backing bean method by clicking on an image.

    I have several HtmlGraphicImage (h:graphicImage) objects on a page. I would like to be able to call a method inside the backing bean for the JSP page where the images are located when the user clicks on one of the images, and have a parameter sent to that method in the backing bean that will tell it which image was clicked on.
    How can this be done? Unlike buttons that have an action that gets listend to in the backing bean, HtmlGraphicImage objects do not have actions. I know that you can intercept clicks by an onClick Javascript method, but how can you call a mehtod in the backing bean using the Javascript onClick?
    For example, part of my JSP looks like this:
               <body style="background-color: rgb(255, 255, 255); -rave-layout: grid">
                    <h:form binding="#{InitialReport.form1}" id="form1">
                        <h:graphicImage binding="#{InitialReport.frontalImage}" height="204" id="frontalImage" style="left: 144px; top: 240px; position: absolute" width="242"/>
                        <h:graphicImage binding="#{InitialReport.profileImage}" height="198" id="profileImage" style="left: 432px; top: 240px; position: absolute" width="244"/>
                        <h:graphicImage binding="#{InitialReport.smileImage}" height="198" id="smileImage" style="left: 720px; top: 240px; position: absolute" width="244"/>If my backing bean (InitialReport.java) had a method that looked like this:
      public void setCurrentImage(String imageName)what would the javascript look like in order to send a name to setCurrentImage?
    Thanks!

    you can use the <h:button> with type='image'Thanks for the reply, but I cannot use that. The thing is, the images are read at run time from a database and are not present in the resources. The button's image only takes String file names, not URLs.
    There should be a way to do this using onClick.

  • Calling a backend bean method from another class

    Hi,
    I'm new in JSF & in this forum so maybe this question is already aswer.
    My problem is that I made a jsf component to deal with a tree menu. The resources in the leaf nodes of the menu are stored in a action calling pattern (i.e.: #{myBean.myMethod}) & I'm looking for a way to bind & execute the call from the class of the component that treats the events.
    I suppose that I need to get the current instance of the context, get the bean location, instance it & invoke the method, but I don�t know how.
    I have another more question, may this resource invocation have any kind of undesirable side effect, I meen, it's me & not the faces context who is making the call so I'm not sure if that the best way to solve the problem.
    Thanks in advance.

    If I understand what you're saying correctly... you have a component which enables a user to select an action (leaf nodes in the menu). You are processing this selection in your component and now have a EL expression that looks like #{myBean.myMethod}. You now need to know how to use that expression from Java code to invoke it. Is that correct?
    If so:
    FacesContext ctx = FacesContext.getCurrentInstance();
    MethodBinding mb = ctx.getApplication().createMethodBinding("#{myBean.myMethod}", new Class[] {});
    mb.invoke(ctx, null);
    This should do what you want. If you need to pass arguments to the method, you can do that as well... you need to pass in the types via the Class[], and the objects via an Object[] instead of null.
    Note also that the API's for EL change for JSF 1.2 to the standard EL API's, however, the older API's (above) are still supported.
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • Error while updating data using session and call transaction method

    Hi all,
        i have to update data using MM01 transaction from flat file to database.i have used both session method and call transaction method to do that.in both the methods data has been transferred from internal tables to screens but while updating the data that is by clicking the ok-code at the end of the transaction iam getting a dialogue box stating
       SAP EXPRESS DOCUMENT "UPDATE WAS TERMINATED" RECEIVED FROM AUTHOR "SAP".
      please tell whether the problem lies and solution for that.
                                       thanks and regards.

    hi,
    check your recording.check whether u saved your material no in recording or not.
    once again record the transacton mm01.
           MATNR LIKE RMMG1-MATNR,
           MBRSH LIKE RMMG1-MBRSH,
           MTART LIKE RMMG1-MTART,
           MAKTX LIKE MAKT-MAKTX,
           MEINS LIKE MARA-MEINS,
           MATKL LIKE MARA-MATKL,
           BISMT LIKE MARA-BISMT,
           EXTWG LIKE MARA-EXTWG,
    these are the fields which u have to take in internal table.
    this is the record which i took in my flatfile.use filetype as asc and hasfieldseperator as 'X'.
    SUDHU-6     R     ROH     MATSUDHU     "     001     7890     AA
    i did the same.but i didn't get any error.

  • Entity Framework doesn't save new record into database

    Hy,
    I have problem with saving new record into database using Entity Framework.
    When I run program, everything seems normal, without errors . Program shows existing, manually added records into the database, and new one too. But new one isn't save into database after running program.
    I've got no idea where's problem. There is code for add new record, show existing.
    Thanks for help!!
    // add new record
    using (var db=new DatabaseEntitiesContext())
    var person = new Table()
    First_Name = "New_FName",
    Second_Name = "New_SName",
    PIN = "4569"
    db.Tables.Add(person);
    db.SaveChanges();
    //show all records
    using (var db=new DatabaseEntitiesContext())
    var selected = from x in db.Tables
    select x;
    foreach (var table in selected)
    Console.WriteLine("{0}{1}{2}",table.First_Name,table.Second_Name,table.PIN);

    Hi BownieCross;
    If you are using a local database file in your project the following may be the cause.
    From Microsoft Documentation:
    Issue:
    "Every time I test my application and modify data, my changes are gone the next time I run my application."
    Explanation:
    The value of the Copy
    to Output Directory property is Copy
    if newer or Copy
    always. The database in your output folder (the database that’s being modified when you test your application) is overwritten every
    time that you build your project. For more information, see How
    to: Manage Local Data Files in Your Project.
    Fernando (MCSD)
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects
    and unknown namespaces.

  • Different methods involved in insertion of records into the table

    hi all,
    i am using Forms [32 Bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    i have parameters like emp_code(optional) and year(mandatory field-four digit year).
    Based on the parameter i have to get the details from one table and those records should be inserted into other table along with additions columns(by hardcoding the additional columns).
    To acheive this i am planning to get a cursor by selecting the necessay fields from the table passing the parameters in the where clause of the cursor.
    by looping through the cursor i will insert the records into the other table.
    here the thing is the data is going to be huge (since year is the parameter).
    so is my approach leads to the performance issue.
    i heard that there are different method of insetions,
    can anybody suggest me the better way(peformance wise) other than what i have mentioned (if you are aware of)..
    Thanks..

    This is not really a Forms issue, so you'd better go to the sql and pl/sql forum. Here, this question has been asked many times: how do I insert large volumes of data in a table?
    insert into ...
    select ....
    or CTAS (create table as select ....)
    by looping through the cursor i will insert the records into the other table.That is really the worst idea. If you can do it in sql (insert into ... select ...) DON'T do it in pl/sql.

  • How to call different managed bean methods on a page template button

    Dear All,
    Use Case:
    I have a Page Template and inside this page template is a popup screen which is common to all my
    pages. My popup has OK and Cancel button only.
    My question is this, there are lots of pages that uses this template.
    How is it possible to invoke a managed bean methods dialoglistener when say for example the user clicks the OK button?
    One thing common among the pages is that they are included in some kind of a taskflow and I have configured
    a managedbean in a pageflowscope variable in each taskflow and I just wanted to pass the
    My Template
         - TaskFlow 1 (ManagedBean1.dialogListener)
         - TaskFlow 2 (ManagedBean2.dialogListener)
         - TaskFlow 3 (ManagedBean3.dialogListener)
    Each dialog listener does different things.     
    How to do this?
    JDEV 11G PS3
    Thanks

    Found my answer here... http://www.oracle.com/technetwork/developer-tools/adf/learnmore/79-global-template-button-strategy-360139.pdf
    Thanks!

  • How to call a void bean method in a jsp ?

    I want to call a bean method from the jsp page. The method is void i.e it returns nothing.
    Lets say the bean id is mybean and the method name is beanmethod( ). I want to know in what type of jsp tags should I put mybean.beanmethod( ). Using jsp expression <%= mybean.beanmethod( ) %> gives error and so does scriptlet <% mybean.beanmethod( ) %>
    Can someone help me out. Thanx.
    Arshad

    did you already implement this?
    <jsp:useBean id="mybean" class="yourPackage.YourBean scope="session"/>
    use ";" at the end:
    <% mybean.beanmethod(); %>

Maybe you are looking for

  • 7 hours, 3 complaints, no reply and no BT Sport

    Unbelievable. I know you're all having similar issues, but just in case someone at BT is actually listening (as our complaints and phone calls are going unanswered), here's our experience. If a mod can arrange the Exceptions team to call ME I'd appre

  • How do I search for a word within a web page

    I would like to be able to do a search for a pecific within the page currenly viewed in the browser. Is there a way to do that in Firefox?

  • Best options for wireless security

    I have an Aironet 1040 access device, no controller. I have an LDAP server with radius in front to allow for username and password authentication(using MS CHAPv2) with mandatory WEP and PEAP. I was wondering what the strongest security option is that

  • Gantt chart and calender weeks

    Hi, I have to build a gantt chart and additional to Month year and date I have to show the calender weeks. How can I do this? I think it should be in between this part <locale> <date_time_format week_starts_from_monday="True"> <months> <names>January

  • MDM Integration with Actuate

    Is it possible to integrate ACTUATE (Enterprice Reporting Application - Platform) with MDM? thank you very much