Problem in Session bean (EJB 2)

Hello
i have the next warnig when i start my weblogic:
<Call-by-reference is not enabled for the EJB 'MiSeesionBeanSessionEJB'. The server will have better performance if it is enabled. To enable call-by-reference, set the enable-call-by-reference element to True in the weblogic-ejb-jar.xml deployment descriptor for this EJB.>
the ejb jar file has this:
<session>
<description><![CDATA[MiSeesionBeanSessionEJB]]></description>
<display-name>MiSeesionBeanSessionEJB</display-name>
<ejb-name>MiSeesionBeanSessionEJB</ejb-name>
<home>MiSeesionBeanSessionHome</home>
<remote>MiSeesionBeanSession</remote>
<ejb-class>MiSeesionBeanSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
Can you help me?
thanks

Call-by-reference for remote interfaces is an optimization that some Java EE application servers
can perform for Remote EJB invocations where the caller and callee happen to be within the same
JVM. It avoids some of the overhead of a typical Remote EJB invocation by passing arguments
by reference instead of by value. That approach is non-portable but can result in higher performance.
This was an option that was highly used for the Remote EJB view before the EJB Local view was
added. In general, it's preferable to use the Local EJB view for optimized invocations between
collocated client/ejb components, since in that case the pass-by-reference behavior is portable.
This message is merely a suggestion about one tradeoff for possibly improving the performance
of your application. It's not an error message.
--ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Call stateless session bean EJB 2.0 from Webdynpro Java UI

    Hello,
    Can someone please tell me asto how to call a stateless session bean EJB 2.0 from Webdynpro Java UI?
    The NWDS version is 7.0.
    Thanks and Regards,
    Arya

    Hi Aryadipta
    Please check this pdfs
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10&overridelayout=true
    Steps for calling stateless session bean in Webdynpro java
    Go to NWDS -> open perspective ->j2ee
    select EJB Module Project ->create a project with name
    Open the Project -->RC on ejb-jar.xml -> Select new --> EJB
    Give name to EJB Bean (First letter should be in capital letters)
    select the type of bean as Stateless session bean and give the package name to store that EJB bean.
    After that Expand ejb-jar.xml and then select the <projectEJB> 
    Double click on this on method  tab double click you will get business method where we will create the methods for business logic
    Double click on projectEJB and then RC on bean tab and write required business logic in bean window as follows(based on requirement we will design a business logic).
    After writing the business logic go to project -> rebuild
    Till now we have created one EJB jar file
    then go to File-->Enterprise Application Project -->create a project (projectEAR)
    After creating a project click on next-> here we will have ear projects and then we select specific project required for our application.(here select projectEJB)
    After that Calculate EAR project will be available on j2ee explorer.
    Right click on <Bean> here
    select New->Web Service->give a name to webservice and select Default configuration type as simple SOAP
    -->click next -> Finish.
    That webservice and related are created in ejb-jar.xml .
    Expand the ejb-jar.xml.and double click on < webservice>
    RC ProjectEJB -> Build EJB Archive RC on CalculateEAR ->Build applicationarchive.
    Expand the projectEAR->RC on CalculateEAR.ear->Deploy to J2EE Engine
    Double click on calculateEAR.ear ->Webservice navigator tab ->we eill servers expand the node
    select the specific WebService  
    Here we test the webservice by click on Test and test it.
    After that go to Web dynpro perspective ->create one webdynpro Project and one component
    RC on model> Select import Web Service model(last)>give model name and package
    and select radio button as local file system or URL
    Go to WSnavigator->copy the WSDL path and paste it in model WSDL path and click on finish.
    from here onwards steps are same as that adaptive RFC model
    Hope it helps
    Thanks
    Tulasi Palnati
    Edited by: Tulasi Palnati on Aug 26, 2009 12:15 PM
    Edited by: Tulasi Palnati on Aug 26, 2009 12:43 PM

  • Problem calling a session bean (EJB 3.0)

    Hello,
    I'm new to netbeans and J2EE. I'm using NetBeans 5.5 Beta 2 and sun application server 9 pe.
    I created a new enterprise application and i'm trying to access a Session Bean (Remote and Stateless)
    from the app-client (outside the main class).
    This is the loockup method that was generated by the IDE (Enterprise Resources > Call enterprise bean):
    private ejb.SessionBeanDoenteRemote lookupSessionBeanDoenteBean() {
    try {
    javax.naming.Context c = new javax.naming.InitialContext();
    return (ejb.SessionBeanDoenteRemote) c.lookup("java:comp/env/ejb/SessionBeanDoenteBean");
    catch(javax.naming.NamingException ne) {
    java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
    throw new RuntimeException(ne);
    When I run the application and try to invoke the lookup method my application gets the following exception:
    SEVERE: exception caught
    javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/Se
    ssionBeanDoenteBean
    at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.
    java:751)
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j
    ava:156)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at intensivecare.entrada.JDialogEntrada.lookupSessionBeanDoenteBean(JDia
    logEntrada.java:219)
    at intensivecare.entrada.JDialogEntrada.buttonMenuGravarActionPerformed(
    JDialogEntrada.java:79)
    at intensivecare.JDialogWizzard$2.jButtonGravarActionPerformed(JDialogWi
    zzard.java:178)
    at componentes.JTaskPanelMenu$3.actionPerformed(JTaskPanelMenu.java:54)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
    49)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2169)
    Please... can someone help me?

    The portable way to acquire the dependency is through java:comp/env or @EJB. Accessing the
    global namespace directly is not recommended. If you use an ejb-ref, you need to define it
    in the component environment within which you'll be looking up the dependency. So if you're
    looking it up from an Application Client, you'll need to define the ejb-ref in application-client.xml.
    Also, the ejb-ref-name is the portion of the string after java:comp/env. There is no automatic
    "ejb" appended to it. If you do ic.lookup("java:comp/env/foo"), your ejb-ref-name would be "foo".
    You can use @EJB but it can only be defined in certain managed classes such as the
    Application Client main class.
    You can find additional info in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Stateless Session Bean + EJB Question + Jboss

    Hello,
    If I have a stateless session bean on a linux machine and it works locally what do i need to do to access a method in the session bean from a remote windows machine.
    I would like to be able to execute my client jar file on a windows machine and have it access the jboss server on the linux machine. what do i need to do?
    i have the session bean working locally on both windows and linux machine. do i need to to have a JSP/Servlet to access the session bean? can the session bean not be accessed directly? what should my classpath look like? do I need to include extra jar files in my client jar file.?
    Thanks,
    Joyce

    Thanks guys for the help but I am still a little lost.
    My Client windows machine has the client jar file and all the other jar files. This is my client class
    package helloworld.client;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Hashtable;
    import java.util.Properties;
    import helloworld.interfaces.HelloWorldHome;
    import helloworld.interfaces.HelloWorld;
    public class HelloClient
         public static void main(String[] args)
              Hashtable prop = new Hashtable();
              prop.put ("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
              prop.put ("java.naming.provider.url","jnp://172.16.220.160:1099");
              prop.put ("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
              try
                   Context ctx = new InitialContext(prop);
                   Object obj = ctx.lookup("ejb/helloworld/HelloWorld");
                   System.out.println(obj);
                   HelloWorldHome home = (HelloWorldHome)javax.rmi.PortableRemoteObject.narrow(obj, HelloWorldHome.class);
                   HelloWorld helloWorld = home.create();
                   String str = helloWorld.sayHelloEJB("JOYCE is COOL");
                   System.out.println(str);
                   helloWorld.remove();
              catch(Exception e)
                   e.printStackTrace();
    I get a NullPointer ie the home object is null. The IP address is the IP of the Linux machine that has Jboss running on.
    Questions are:
    1. Do I need to have Tomcat running on my client machine if I am to connect via HTTP? Does this alter my client code.?
    2. My JNDI lookup is what is causing the problem. Does my jboss.xml and my ejb-jar.jar look okay to you.
    jboss.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
    <jboss>
    <enterprise-beans>
    <session>
    <ejb-name>helloworld/HelloWorld</ejb-name>
    <jndi-name>ejb/helloworld/HelloWorld</jndi-name>
    </session>
    </enterprise-beans>
    <resource-managers>
    </resource-managers>
    </jboss>
    ejb-jar.jar
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar >
    <description>No Description.</description>
    <display-name>Generated by XDoclet</display-name>
    <enterprise-beans>
    <!-- Session Beans -->
    <session >
    <description><![CDATA[No Description.]]></description>
    <ejb-name>helloworld/HelloWorld</ejb-name>
    <home>helloworld.interfaces.HelloWorldHome</home>
    <remote>helloworld.interfaces.HelloWorld</remote>
    <ejb-class>helloworld.session.HelloWorldBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    <!--
    To add session beans that you have deployment descriptor info for, add
    a file to your merge directory called session-beans.xml that contains
    the <session></session> markup for those beans.
    -->
    <!-- Entity Beans -->
    <!--
    To add entity beans that you have deployment descriptor info for, add
    a file to your merge directory called entity-beans.xml that contains
    the <entity></entity> markup for those beans.
    -->
    <!-- Message Driven Beans -->
    <!--
    To add message driven beans that you have deployment descriptor info for, add
    a file to your merge directory called message-driven-beans.xml that contains
    the <message-driven></message-driven> markup for those beans.
    -->
    </enterprise-beans>
    <!-- Relationships -->
    <!-- Assembly Descriptor -->
    <assembly-descriptor >
    <!-- finder permissions -->
    <!-- transactions -->
    <!-- finder transactions -->
    </assembly-descriptor>
    </ejb-jar>
    Do I need RMI ? Do I need to concern myself with CORBA? All Im looking for is a step by step to understanding what I need to configure? Is their some way I can debug?
    Thanks alot,
    Joyce

  • JNDI Naming Problem accessing Session Bean from Message Driven Bean

    Hi,
         I am facing a very strange problem in JNDI look up accessing a Session Bean from a Message Driven Bean. I have a session fa�ade bean(Remote Bean) which is being called from Struts Action class getting the home reference from the ServiceLocator (I have implemented ServiceLocator pattern to obtain JNDI reference for all EJBs). When I am calling the session fa�ade EJB from the Struts Action class everything is working fine.
         But when I am trying to call the same EJB from my Message Driven Bean, I am getting a JNDI exception (NameNotFoundException - No Object bound to name �java:comp/env/ejb/EJBJNDIName�). I am trying to get the remote reference from the same ServiceLocator which is successfully providing me a reference while calling from the struts action class. But the same ServiceLocator is not able to provide me a reference while calling from the Message Driven Bean. If I use the JNDI name directly like �EJBJNDIName� in the lookup it is working fine. The lookup for the name is working fine and I am able to call the Session Fa�ade bean with that reference.
         I am really not sure what exactly the problem is. If I have any problem in the ServiceLocator, it should have given me the same error while calling from Struts Action class. But it is working fine with the full name �java:comp/env/ejb/EJBJNDIName� calling from the struts action class. I am not sure whether Message Driven Bean has something to do with it. Why I am not able to get a reference of the EJB with the full name? Please Help.
    Thanks
    Amit

    Hi Bhagya,
    Thanks for your response. I think from EJB container we can call Local EJBs with the full JNDI name. The session facade bean which is being called is a remote bean. From the session facade bean I am calling a local stateless session bean for database access. I am getting the reference of the local EJB from my session facade bean with full JNDI name "java:comp/env/ejb/EJBJNDIName". It is working fine with out any problem. My servicelocator is able to provide me the reference of the local EJB from the session facade remote bean with Full JNDI name. I am only having this problem calling from the MDB. I am really not sure whether what is causing it?
    Thanks
    Amit

  • How to use jta in toplink and stateless session bean EJB 3.0?

    I have an application with techologies jsf,stateless session bean, adf, toplink
    generated by toplink workbench.
    In web side ı want to use two methods in stateless session bean which are updated
    different tables. I call these methods in my page backing bean.
    I also want to JTA in web side. My first methods is done correctly, but second method has an error. I wanto to rollback all transaction.
    How can ı do that? with using JTA in Toplink...

    Yuichi
    Did you manage to solve this?  I'm doing something similar and seeing the same problem, although they're up to 7.3 SP7.
    Any help greatly appreciated.
    Lewis

  • Null Pointer Exception in Stateless Session Beans(EJB 3.0)

    I am executing a simple HelloUser example i code session bean interface and implementing session bean class in the EJB project.
    package ejb3inaction.ejb;
    import javax.ejb.Remote;
    @Remote
    public interface HelloUser {                                       
    public void sayHello(String name);
    package ejb3inaction.ejb;
    import javax.ejb.Stateless;
    @Stateless
    public class HelloUserBean implements HelloUser {                  
    public void sayHello(String name) {
    System.out.println("Hello " + name + " welcome to EJB 3 In Action!");
    And in the client project i code this class and add JAR file of the EJB project.
    package ejb3inaction.example;
    import javax.ejb.EJB;
    import ejb3inaction.ejb.*;
    public class HelloUserClient {
    @EJB
    private static HelloUser helloUser;
         public static void main(String[] args) {
    helloUser.sayHello("Curious George");
    System.out.println("Invoked EJB successfully .. see server console for output");
    I am using netbeans 6.0(10 M) and Sun Application server 9.
    it gives NullPointer Exception at the following line...
    helloUser.sayHello("Curious George");
    how i can resolve this error.
    regards,
    deemy

    Well, helloUser is just a null reference, you haven't created an instance of HelloUser to use, hence the NPE

  • User defined exception problem in session bean.

    Hi,
    I creaed one user defined exception and using this exception
    in the session bean when I am trying use this bean at the client
    side and cathing this exception it is not catching it properly
    while server side it is throwing this exception.
    I can elaborate it through client code -
    try {
    isModified = sessionBean1.modifyNe(Object product);
    catch (ValidationException nve) {
    throw nve;
    catch (RemoteException remoteException) {
    remoteException.printStackTrace();
    server is throwing ValidationException but it is cathing in
    the RemoteException.
    stack trace is given below
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: com.ss.sms.common.exception.ValidationException: name should be unique
    at com.sisl.snms.server.esc.common.SmsEscBean.checkDuplicateNeName(SnmsEscBean.java:56)
    at com.sisl.snms.server.esc.escatm.SessionBean1.modifyNe(EscAtmBean.java:219)
    at com.pramati.ejb.runtime.EscAtmBean_LocalObject_Impl_785398532._pramati_impl_modifyNe(EscAtmBean_LocalObject_Impl_785398532.java:285)
    at com.pramati.ejb.runtime.EscAtmBean_LocalObject_Impl_785398532$3.run(EscAtmBean_LocalObject_Impl_785398532.java:238)
    at com.pramati.security.util.JAASSecurityHelper.doAs(JAASSecurityHelper.java:158)
    at com.pramati.security.util.JAASSecurityHelper.doAs(JAASSecurityHelper.java:266)
    at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)

    hi vikassahu
    try it : remove remoteException catching. and try it with normal Exception, and make sure that Exception should be in remote interface.
    and make sure that you are throwing your user Defined Excepion
    ok i think this will help u
    ok

  • Extend session beans - EJB 2.0

    Hi there,
    I am new to EJB world, but I've to reuse some functionality of an existing stateful session EJB. I am thinking about extending the existing EJB to create my own stateless session bean (note: stateless as I don't have anything to do with a conversational state. It is just one operation that I am going to expose to client code). The EJB I am planning to create will reside in the same JVM as that of the existing EJB.
    Is this a good approach? How to go about it? Are they any patterns around reusing EJB methods in other EJBs without lookups as those methods I am interested in reusing are not part of the home interface of the existing bean.
    I wish I could refactor the existing EJB to take out the methods that I need, but it is not an option for me.
    Thanks a lot and I appreciate any inputs around this.

    user1364272 wrote:
    Is this a good approach? How to go about it? Are they any patterns around reusing EJB methods in other EJBs without lookups as those methods I am interested in reusing are not part of the home interface of the existing bean.Sounds to me like those methods should be in a separate POJO class you can reuse wherever you want.

  • Error while Look up session bean (EJB 3.0) in WebDynpro

    hi ,
                 I want to look up session bean inside webdynpro. I hv written following code inside init of component controller. but not able to look up session bean
    try{
                   InitialContext context = new InitialContext();
                   ApplicationFetcherLocal applicationFetcherLocal = null;
                 applicationFetcherLocal = (ApplicationFetcherLocal)context.lookup((ApplicationFetcherLocal.class.getName());
              catch (Exception ex){
                   System.err.println("LookUp Failed\n\n"+ex.getMessage());

    Have you read my latest reply in your other [thread|session bean look up  across DCs in EJB3.0;?
    What's the value of asking the same question again if you don't care about the answer?
    Regards,
    -- Vladimir

  • Problem with Session Beans in JSP

    Hi,
              I'm testing Weblogic for our company's IT department and just ran into a
              strange error. I wrote a simple JSP script to use a bean that works fine
              except when trying to set the bean scope to session. I looked at the the log
              file and the only exception recorded was a ClassCastException. Could anyone
              please clarify this to me? Is this a current bug in Weblogic?
              Thank you for your attention,
              Paul Visan
              

              classcastexception are generally due to bad classpaths...
              can you provide more information like what is the code trying to do..stack trace etc..
              "Paul Visan" <[email protected]> wrote:
              >Hi,
              >
              >I'm testing Weblogic for our company's IT department and just ran into a
              >strange error. I wrote a simple JSP script to use a bean that works fine
              >except when trying to set the bean scope to session. I looked at the the log
              >file and the only exception recorded was a ClassCastException. Could anyone
              >please clarify this to me? Is this a current bug in Weblogic?
              >
              >Thank you for your attention,
              >Paul Visan
              >
              >
              

  • Fileinputstream problem in session bean

    Hi i m using fileInputStream in Seesion bean to read one file. but i want to give relative path of that file according to ear. but it give me fileNotFound Exception.. i cant give physical path of that file.. the file i m trying to read exists in the ear..
    can u help me out?
    Venky

    I have read some good number of XMLs and property files. Make use of Class.getResourceAsStream()method by passing the file name as argument. From the InputStream construct FileInputStream.

  • 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

  • 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

  • Stateful session bean and faces

    I have one stateful session bean(EJB) that manages business logic and conditional page flow. In the web part i have a bunch of JSP pages and each page has it's own JSF bean with data and "submit" methods. Each bean has to keep a reference to this stateful bean and it should be the same reference among all beans. Also i have to create and destroy this bean some way (I think i can use HttpSessionBindingListener).So, any suggestions how to do this? Also i'm searching for 'tips'n'tricks' or design pattern for JSF.
    anton

    why do you need to hold the same EJB reference in all your JSF beans?
    something is wrong with your design, you should take a closer look to see why you need this. a stateless bean does not hold client specific state and there is no difference between stateless bean instances, so your JSF beans do not have to point to the same EJB reference.

Maybe you are looking for