Session bean "Exception in method create()"

Hello,
I have a session bean which is consuming entity bean and session bean is published as webService now when I call create method of entity bean from session bean it says "Exception in method com.syntel.exam_tool.entityBeans.tabExamTable.TabExamLocalHomeImpl0.create()."
But my create method of entity bean is blank I am not getting from where this exceptions is being thrown.
below is the code from session bean wehre I am calling entity bean
javax.naming.Context ctx;
ctx = new InitialContext();
TabExamLocalHome tabExamLocalHome = (TabExamLocalHome) ctx.lookup("java:comp/env/ejb/TabExamBean1");
TabExamLocal tabExam = tabExamLocalHome.create();
Please help me ins this problem.
Thanks

Hi Janeth,
below is the stack trace
com.syntel.exam_tool.entityBeans.tabExamTable.TabExamLocalHomeImpl0_0.create(TabExamLocalHomeImpl0_0.java:343)
com.syntel.exam_tool.sessionBeans.examTool.ExamToolBean.findByPassingScore(ExamToolBean.java:126)
com.syntel.exam_tool.sessionBeans.examTool.ExamToolLocalLocalObjectImpl0_0.findByPassingScore(ExamToolLocalLocalObjectImpl0_0.java:247)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
SoapServlet.doPost(SoapServlet.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
java.security.AccessController.doPrivileged(Native Method)
com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
please help me in this as I am not getting where the problem is
Edited by: new to netweaver on Sep 9, 2009 11:15 AM

Similar Messages

  • How to call a web service from a session bean's business method???

    Hi Experts,
    Can anybody help in calling a web serivce frm a session bean's business method??
    Hw do we do that?
    I have one requirement where i want to send emails to set of users for which i have email sending web service ready.. How can i call it thru a session bean's business method???
    Pls help,
    Regards,
    Amey

    Hi Amey,
    You can achieve this using the followin 2 Step implementation:
    1. [Creating a Deployable Proxy|http://help.sap.com/saphelp_nw70/helpdata/EN/2d/b9766df88f4a24967dae38cb672fe1/frameset.htm]
    2. [Create a Client Bean|http://help.sap.com/saphelp_nw70/helpdata/EN/45/029840cf43495195da923f32262911/frameset.htm]
    Hope it helps.
    Regards,
    Alka.

  • Calling session bean's business method through web dynpro component

    Hi All,
    Can anybody tell me how to call a session bean's methods through a web dynpro WITHOUT java-model or web service model ??
    I have following scenario:-
    1. Stateless Session bean having two business methods
    2. Web Dynpro component
    3.Now i want to call business methods without using any model. I have got following piece of code but I dont know how to go about it.
    4.Where do i have to set JNDI name for session bean? which interface will be looked for?
    5. Do I have to declare public part for EJB DC? If yes, how?
    //This is inside web dynpro component
    InitialContext   context = new InitialContext();
    o = context.lookup(JNDIName);
    TestSessionbeanHome homeRef = (TestSessionbeanHome) PortableRemoteObject.narrow( o,                                                                               
    TestSessionbeanHome.class);
    TestSessionbean beanRef = homeRef.create();
    <returnValue> = beanRef.<ejb method name>
    Please help to get a step-by-step approach to this case.
    Thanks and regards,
    Amey Mogare

    Hi,
    If  I comment out the part that is using session bean's business method, DC is building fine.
    And if I uncomment, then compiler is unabl eto resolve business method(s).
    And i would like to mention that my EJB + J2EE App DC is building properly, but it havent yet deployed properly as I am waiting for data-source-alias name prefix to be configured by ERP team. So will this be a reason why Web Dynpro DC is not able to resolve business methods ??
    Because Web Dynpro DC is able to resolved all interfaces of Session bean and entity bean. But when it comes to business method, its not able to resolve.
    Any more ideas why it is not happening?
    Pls help.
    Now i went through some forum posts regarding this and found that we also need to add EJB DC to Java Build Path for WebDynproDC>Properties>Java Build Path.
    I did this and now it is able to resolve business methods and DTOs as well. So to summarize I did following:-
    1. Added EJB DC (complete DC) as a Used DC to Web Dynpro DC with Buid-n-Deploy-n-Run time dependency
    2. Added Sharing reference of J2EE application DC to Web Dynpro DC -->Properties
    This reference I constructed as follows:-
    <vendorname>/<name of j2ee application as appearing under display name tag in application.xml (replacing '/' with '~')>
    So my Sharing Reference becomes:- <vendorname>/reqpstapscreqpstapja_reqid
    3. Added EJB DC to Java Build Path in Web Dynpro DC's properties
    4. Then I added following piece of code to get object of SessionBean class
    InitialContext context = new InitialContext();
    Object o = context.lookup("java:comp/env/ejb/SessionRequestIDBean");
    SessionRequestIDHome homeRef = (SessionRequestIDHome) PortableRemoteObject.narrow(o, SessionRequestIDHome.class);
    SessionRequestID beanRef = homeRef.create();
    beanRef.<business method>
    But After doing this I am facing another problem :-
    The build fails saying it is not able find the package for DTOs. But when I see the Component Controller's code it is not showing any red or yellow marks.
    Can anybody pls help me out here?
    Thanks and regards,
    Amey Mogare

  • Should the session bean (stateful/stateless) be created once?

    hi
    I have a sessionBean called BusinessSessionBean and it interacts with a persistent layer session bean (stateful) called PersistenceSessionBean (which acts as a session facade).
    so
    in constructor of BusinessSessionBean I ,
    a) create an instance of home interface PersistenceSessionBeanHome
    b) create an instance of remote interface PersistenceSession
    c) keep it as a member variable
    Then whenever i invoke a method of BusinessSessionBean , the method will invoke a method of PersistenceSessionBean.
    Now should I create an instance of PersistenceSessionBean in the constructor of BusinessSessionBean and keep it as a member variable and use that instance to invoke methods in PersistenceSessionBean ?
    or each time a method in BusinessSessionBean is invoked, I create an instance of PersistenceSessionBean from its home interface and then invoke the method?
    What will be the approach for stateless PersistenceSessionBean ?
    thanks in advance
    Tanveer

    "What will be the approach for stateless PersistenceSessionBean ?"
    Hi stateless bean cannot maintain data inbetween multiple client calls. So if ur Business Session Bean is stateless every time you have to lookup the PersistenceSessionBean. no other go.
    But I don't understand y do u need such a setup.
    Have a normal java class instead of Business Session Bean (in desing patterns term it is called as Business Delegate). Instead of having the lookup machanism in this java class itself move it to a differenct class (design patterns calls it service locator). have a session bean in (session facade) which could do the task for you in the server side calling other beans........
    - Paul

  • Using only one method in session bean to create web service

    Hi all,
    I hhave a scenario where i am inserting and retrieving data from dict table using web service.
    For this i have created a session bean and a wrapper class.
    The session bean has two methods: insertRecords(), and viewRec().
    so while creating a web service i need to include two methods.
    I want to have only one method where i can pass a parameter as operation and if it is "I", then i can call the insert method and if it is "S" i can call view method.
    I tried doing that bt i am stuck up with the return type.
    Insert method has return type as array of wrapper class and
    view method has wrapper class as return type ...
    Is this scenario possible..??
    or is there any other way to do this???
    Plz let me knw..
    Thankls n regards,
    Ankita

    Hi Siddharth,
    Im really sorry..
    i cudnt  get u ..
    Actually these r methods:
    public DemoDicModel[] viewRecords()
    and
    public DemoDicModel insertRecords(
              String title,
              String desc,
              String status)
    and im trying this:
    public DemoDicModel[] getMethods(String operation,String title,String desc, String st)
    DemoDicModel[] demoModel =null;
    DemoDicModel model = new DemoDicModel();
    if(operation == "show")
          demoModel = viewRecords();
    if(operation == "ins")
          model = insertRecords(title,desc,st);
          model.setMsg("RECORDS GENERATED");
          demoModel=
    return demoModel;
    im stuck up with insert operation.
    can  u plz explain me in detail.
    thanks,
    ankita

  • Create session bean using interfaces, not implementation classes

    Hi,
    I'm using interfaces and session beans for my persistence/data layer in my adf application.
    I've created a data control for my session bean and during creation of this data control, javabean.xml files are created for the different interfaces that are used in my session bean.
    If I create bindings on these methods, interfaces in jspx-documents I will get errors because he can't find the impl-classes that implement these interfaces.
    When using interfaces in your session bean (as return values or parameters) instead of classes you need to manually create javabean.xml files for the implementation classes.
    It's required by the databindings/datacontrol that the implementation-classes are described in a javabean-format as well? Is this a spec we need to adhere to?
    Could someone verify that you need to create javabean.xml-files for as well the interfaces as the classes when you're working with interfaces in your session beans?
    regards,
    Nathalie

    A patch was released by Oracle to be able to work with Interfaces and so it's not required to work with implementation-classes.
    Patch for 5726754(Base bug 5657179)

  • Is it usefull syncronized method in session bean?

    hi all
    I know that each time I call a session bean my appllication server create one instance.
    So i wonder if it's a wrong idea declaring each session bean methods syncronized.
    Regards

    It's generally not a good practice to call your business classes directly from javascript.
    But you can place a mediator (business delegate) java class inbetween and can access the session bean instead.
    To access any java class using ajax, you may need a remoting library like DWR or JSON-RPC.
    These libraries offer very powerful and easy way to use ajax in your application.
    But if you want a more simpler solution, then have a look at libraries like "ajax4jsf" or "ajaxanywhere".

  • Any difference in creating a web service from a java class or session bean?

    Hi,
    The JDeveloper tutorial at http://www.oracle.com/technology/obe/obe1013jdev/10131/devdepandmanagingws/devdepandmanagingws.htm demonstrates creating a web service from a plain java class. I'm wondering:
    - Is it possible to create a web service from a stateless session bean instead of a java class? If so, what's the proper way to do this in JDeveloper? When I tried doing so in JDeveloper 10.1.3.0.4 (SU5) using the J2EE Web Service wizard, the wizard did not list the session bean in the Component To Publish dropdown (it does list any java classes available in the project). I can proceed by manually typing in the name of the session bean. After the wizard completes though, the @Stateless annotation that had been in my session bean class code is removed and replaced by a @WebService annotation. The end result is that it looks like it made no difference whether I had tried to create the web service from a session bean or plain java class as the annotations in the resulting web service code are the same (although if I had started from a session bean, the class for the web service still implements the Local/Remote EJB interface that the session bean originally implemented).
    - Assuming it's possible to create a web service from a stateless session bean, is there any advantage/disadvantage creating a web service from a java class vs a stateless session bean? I'm creating the web service from scratch so I also need to either build the java class or stateless session bean the web service would be based on from scratch too.
    Thanks for any ideas about this.

    Hi,
    EJB Session beans (EJB 3.0) are deployed as WebServices by annotating the class with @WebService and the methds with @WebMethod (both tags require you to add the JSR-181 library to your project (available in the JDeveloper list of libraries)). Unlike the J2E WebService, the EJB session bean service is turned into a WebService upon deployment. This means you obtain teh WSDL file after deployment
    - Assuming it's possible to create a web service from a stateless session bean, is there any advantage/disadvantage creating a web service from a java class vs a stateless session bean?
    The difference is that EJB Session bean based web services are integrated with the J2EE container, which means that they can leverage container services like transaction handling, data sources, security, JMS etc.
    Frank

  • Can we call a method in stateless session bean ?

    Can we call a method in stateless session bean in onMessage method?

    Hi,
    The purpose of service locator is to abstract the lookup of the server side services like ejb and DSNs. It should be a normal java class but as such there is no such restriction. You can have a look at the service locator patter at the j2ee blue prints.
    /Ashwani

  • [Session Beans]Cannot make any queries!

    Hello,
    I created a simple session bean and find method works fine. Problem comes with queries...I tried to make this simple query:
    Query query = em.createQuery("from Employee e where e.name='myName' ")but I get this exception:
    >
    GRAVE: [!!EXCEPTION!!] An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [from Employee e where e.name='myName'], line 1, column 0: unexpected token [from].
    Internal Exception: NoViableAltException(33@[])
    >
    and this goes for every query I make...I tried different others but result is always the same...

    in HQL you can drop the "select" clause, but i don't think you can do that in the JPA query language. did you try something like "select e from Employee e where e.name='myName'"?
    More examples here http://docs.oracle.com/javaee/5/tutorial/doc/bnbtg.html .
    Edited by: jtahlborn on Apr 13, 2012 1:01 PM

  • How to make a session bean interact with a entity bean?

    hi,
    An entity bean has been created and tested successfully. Values entered into the test app are successfully entered into the pointbase db.
    Now trying to create the same feature through session beans. when the method is invoked, it appears ok, but when the database is queried the values have not been entered. Is there anything that could have been missed or incorrect?
    the steps to setting up session bean
    1)add code to create for JNDI lookup
    public void ejbCreate() {
    System.out.println("Entering oneManagerEJB.ejbCreate()");
    Context c = null;
    Object result = null;
    if (this.myoneHome == null) {
    try {
    c = new InitialContext();
    result =
    c.lookup("java:comp/env/ejb/one");
    myoneHome =
    (oneHome)javax.rmi.PortableRemoteObject.narrow(result,
    oneHome.class);
    catch (Exception e) {System.out.println("Error: "+
                e); }
    2) add business method to enter values into entity bean
    public void createone(int number) {
    System.out.println("Entering ");
    try {
    one oneinfo =
    myoneHome.create(number);
    } catch (Exception e) {
    // Join the following two lines in the Source Editor
    System.out.println("Error in " + e);
    // Join the following two lines in the Source Editor
    System.out.println("Leaving ");
    3) declare variables and namings
    import javax.naming.*;
    private oneHome myoneHome;
    4) add reference to logical session bean
    ejb/one
    5) create test app and add entity bean "one" to module. check mappings.
    run app

    I would do several things which will help track down the problem:
    1. Where you have println statements you may want to change these to exceptions, the session bean won't really work if these problems occur and may silently fail. For example, throw a runtime exeption or EJBException to indicate that the entity bean home interface cannot be found.
    2. When you create the test application you should replace the ejb module which is automatically created with the ejb module or module(s) containing both of the ejb's. This will ensure that the configuration is preserved. The test application is a standard J2EE application, so modules can be added (you could even have multiple test applications each testing a different ejb, make sure that you use different context roots).
    Chris

  • Session bean calls enttity bean got error !!!! *urgent*

    i have a session bean(customerController)with jndi(ejb/customer) calling entity bean (customer).Both using remote interface. when i build a frame application to test these beans. i get the error below.
    can anybody tell me wat happen ?!!
    23:20:22,861 ERROR [LogInterceptor] EJBException: javax.ejb.EJBException: removeCustomer: null      at sessioncallsentitybean.CustomerControllerBean.createCustomer(CustomerControllerBean.java:63)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)      at java.lang.reflect.Method.invoke(Method.java:324)      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98)      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)      at org.jboss.ejb.Container.invoke(Container.java:738)      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke
    (JRMPInvoker.java:383)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)      at java.lang.reflect.Method.invoke(Method.java:324)      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)      at sun.rmi.transport.Transport$1.run(Transport.java:148)      at java.security.AccessController.doPrivileged(Native Method)      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)      at java.lang.Thread.run(Thread.java:536)

    seems like the logic stops when session bean is trying to create an instance of entity bean. i ve set my jndi name (ejb/Customer)correctly in the naming code part in session bean. Can u tell me wat steps that i might have missed. pls. thank you so much. =)
    session bean manages to pass through methods below:
    ejbCreate ()
    createCustomer()
    makeConnection()
    releaseConnection()... but throws the EJBException
    public String createCustomer(String custName, String custEmail, String custAddress, String custGender, String custPhoneNo) throws CreateException {
         System.out.println("CustomerControllerBean createCustomer");
        try{
          makeConnection();
          customer = customerHome.create(customerId, custName,
                     custEmail, custAddress, custGender, custPhoneNo);
          releaseConnection();
        } catch (Exception ex){
          releaseConnection();
          throw new EJBException
          ("createCustomer: " + ex.getMessage());
        return customerId;
      }my error is "javax.ejb.EJBException: createCustomer: null" the rest of the error warning is mentioned in the first posted message above.

  • Statful Session bean and its life

    Hi,
    I don't know how long a Stateful session bean lives in the memory. What keeps
    the stateful bean around?
    I do have a Stateful session bean in my application creating some problem. When
    the user first uses the stateful session bean, the bean remote reference is stored
    in the user session object. Even though the user session is active and not invalidated,
    stateful session bean is getting timed-out. I am using weblogic 6.1 with SP2.
    Please help. Thanks.
    Below is the exception stack trace:
    weblogic.ejb20.locks.LockTimedOutException: The lock request from EJB:SearchList
    HandlerBean with primary key:10,085,579,643,420,691 timed-out after waiting 0
    ms
    . The transaction or thread requesting the lock was:Thread[ExecuteThread: '10'
    f
    or queue: 'default',5,Thread Group for Queue: 'default'].
    at weblogic.ejb20.locks.ExclusiveLockManager$LockBucket.lock(ExclusiveLo
    ckManager.java:448)
    at weblogic.ejb20.locks.ExclusiveLockManager.lock(ExclusiveLockManager.j
    ava:258)
    at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSes
    sionManager.java:226)
    at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSes
    sionManager.java:216)
    at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessi
    onManager.java:310)
    at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:11
    7)
    at weblogic.ejb20.internal.StatefulEJBObject.preInvoke(StatefulEJBObject
    .java:170)
    at com.sherwin.sweep.services.common.SearchListHandlerBean_w4ccs4_EOImpl
    .getSize(SearchListHandlerBean_w4ccs4_EOImpl.java:234)

    The usual cause is a user loads a page, the request takes a while so
    they hit stop and reload. There's other possibilities like frames etc.
    -- Rob
    Sai S Prasad wrote:
    Thanks Rob for the response. Every instance of the sfsb is tied to a particular
    user web session. I am not sure how the concurrent calls take place. I am almost
    certain that I am not calling any methods in sfsb concurrently. Thanks again.
    Rob Woollen <[email protected]> wrote:
    The sfsb hasn't timed out. This is the EJB lock manager that's
    complaining. I suspect you are trying to make concurrent calls on a
    sfsb instance.
    -- Rob
    Sai S Prasad wrote:
    Hi,
    I don't know how long a Stateful session bean lives in the memory.What keeps
    the stateful bean around?
    I do have a Stateful session bean in my application creating some problem.When
    the user first uses the stateful session bean, the bean remote referenceis stored
    in the user session object. Even though the user session is activeand not invalidated,
    stateful session bean is getting timed-out. I am using weblogic 6.1with SP2.
    Please help. Thanks.
    Below is the exception stack trace:
    weblogic.ejb20.locks.LockTimedOutException: The lock request from EJB:SearchList
    HandlerBean with primary key:10,085,579,643,420,691 timed-out afterwaiting 0
    ms
    The transaction or thread requesting the lock was:Thread[ExecuteThread:'10'
    f
    or queue: 'default',5,Thread Group for Queue: 'default'].
    at weblogic.ejb20.locks.ExclusiveLockManager$LockBucket.lock(ExclusiveLo
    ckManager.java:448)
    at weblogic.ejb20.locks.ExclusiveLockManager.lock(ExclusiveLockManager.j
    ava:258)
    at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSes
    sionManager.java:226)
    at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSes
    sionManager.java:216)
    at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessi
    onManager.java:310)
    at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:11
    7)
    at weblogic.ejb20.internal.StatefulEJBObject.preInvoke(StatefulEJBObject
    java:170)
    at com.sherwin.sweep.services.common.SearchListHandlerBean_w4ccs4_EOImpl
    getSize(SearchListHandlerBean_w4ccs4_EOImpl.java:234)

  • Stateless Session Bean calling another Stateless Session Bean

    Hi all,
    I have written 2 Stateless Session bean and would like to call the business method of 2nd Stateless Session Bean in the business method of the 1st.
    I have written the lookup code for 2nd SB in the business method of 1st SB and would like to execute the business method in the same method itself.
    What do I have to do for the same for the following :
    Deployment Descriptor file or any other file needs to be modified.
    I am using Weblogic 6.1 and SQL Server 7.0 as database.
    Thanks in advance,
    Seetesh

    This is actually quite similar to calling a session bean from anywhere.
    Try this
    //Session Bean 2 - Business Method, JNDI name SessionBean2
    public void doSomethingMore(String what)
    // Session Bean 1 which call.
    public void doSomething()
       InitialContext initCtx = new InitialContext();
       SessionBean2Home home2 = null;
       SessionBean2 bean2 = null;
       try
         home2 = (SessionBean2Home)initCtx.lookup("SessionBean2");
         bean2 = home2.create();
       }catch(FinderException ex){..}
        catch(CreateExceptrion ex){..}
       try
         bean2.doSomethingMore("Anything");
       }catch(remoteException ex){..}
    }In my case (webLogic 5.1) I did not need to change anything in any of the deployment descriptor. However, both beans needs top be deployed on same instance of Application server (might work across instances but didnt try)
    This should do it.
    Amitabh

  • Problem while invoking a Stateless Session bean from another bean

    Hi,
    I have a peculiar problem while coding with Stateless Session beans. Maybe you guys can help me out over here. The scenario is as follows
    There are 3 Stateless Session beans. Let Us say Bean A, B and C. There are three methods, method1, method2, and method3 inside A, B and C respectively.
    From A.method1(), B.method2(), and C.method3() are being invoked sequentially. Each of these methods does some JDBC operation and then returns.
    The problem is this, if C.method3() throws and exception, then I am unable to rollback the changes made by B.method2(). Those changes get "Committed" to the database.
    All the 3 beans have Bean managed persistence property set. I am using WebSphere 6.1.
    Any insight on why this is happening would be greatly appreciated.
    Thanks In Advance
    Amardeep Verma

    Hi,
    This is a matter of calling all three methods in the same transaction context. Most easy way of doing this is having a 4th session bean containing a method calling the other 3. Make sure that the Transaction Attributes are REQUIRED, which is the default.
    If the calls a to different backends/databases, you need global transactions and therefor XA complient database and drivers.
    HTH Robert

Maybe you are looking for

  • Saved pattern swatches as ASE have I lost them?

    Hello I created some pattern swatches in illustrator CS6 and saved them as an ASE file. When I try to use them , only the files I'd saved as Ai are offered to me. Does the saved as ASE file only save the colours used and not the actual pattern? Have

  • Custom jtable editors

    Hi, I've written an application which needs to use multiple editors for the same table. Also I've modified the keyboard navigation to create a new row for certain keystrokes like TAB and ENTER. For this I've attached a KeyListener to the JTable. My p

  • Can I still download iPod software updates? iPod is out of warranty.

    Can I still download iPod software updates? iPod is out of warranty.

  • Access DB2 database from IRIX machine.

    Hi , I am using DB2 database ,which is sitting on AIX machine. And i want to access database from IRIX 6.5 (SGI machine). I think there is no driver to connect DB2. If any body knows how to access Thank you for your help.

  • Issues with Import in Lightroom4

    I am using lightroom 4 on a 2008 Mac Pro running the latest verison of MAC OSX. My lightroom 3 catalog wasa upgraded successfully with no issues Now when i try to import photos from my Canon 5D camera (The original 5D) it keeps saying that there are