Setting a session bean

How do i set a session bean in my JSF action? I have defined this session bean in my faces-config.xml file:
<managed-bean>
<managed-bean-name>SelectedHistoryRecord</managed-bean-name>
<managed-bean-class>com.myco.nps_history.model.NPSHistoryRecord</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
And so far I know how to retrieve it's value ...
javax.faces.application.Application app = ctx.getApplication();
NPSHistoryRecord selectedHistoryRecord = (NPSHistoryRecord)app.getVariableResolver().resolveVariable(ctx, "SelectedHistoryRecord");
but I don't know how to set the session bean to be an instance of a different bean than that returned. Your advice is appreciated, - Dave

Indeed, ExternalContext#getSessionMap() returns a modifable map of session attributes (backed by HttpSession#get/setAttrbute() in a Servlet environment), including the session scoped managed beans which are keyed by their managed bean name.
You may find this article useful in general: [http://balusc.blogspot.com/2006/06/communication-in-jsf.html].

Similar Messages

  • How can I set a Session bean timeout

    Hello !
    How can I set a Session bean to time out eg. 48 hours ?
    Thanks
    Uiloq Slettemark

    For stateful session beans you can use the timeout attribute in the orion-ejb-jar e.g.
    <session-deployment timeout=1800 ..>
    this is specified in seconds and Default Value: 30 (minutes)
    regards
    Debu

  • Adding Set of Session Beans generates client with wrong session bean names

    Hi,
    I am trying to import a set of session beans deployed on Sun Java Sever 8.2 using Netbeans 6.0. on windows XP.
    The problem is that the imported set generated by the IDE has wrong session bean names and out of 8 session beans in the client jar only 6 are shown (and different 6 every time). Also the remote methods of one bean are associated with another bean and every time its a different set of bean clients generated.
    I am really perplexed with this behavior. Any help on this issue will be highly appreciated.

    An RMI/IIOP parameter type must meet one of thefollowing criteria:
    It must be a primitive type, or it must implementeither java.rmi.Remote or java.io.Serializable,
    or it must be an interface for which the runtime typesatisfies the previous criteria,
    or it must be an array containing elements thatsatisfy the previous criteria.This tells you exactly what you need to do.

  • Set maximum session bean pool size?

    Using the embedded OC4J, how can I set the maximum pool size for my session beans? I am using Jdeveloper 10g. Do I have to manually edit some XML file?

    Set the system property com.sun.jndi.ldap.connect.pool.maxsize
    System.setProperty("com.sun.jndi.ldap.connect.pool.maxsize", "25");

  • 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

  • Setting transaction isolation level in a session bean

    Hi all!
    In a stateless session bean (EJB3) with container managed transactions I need to set the transaction isolation level to SERIALIZABLE.
    The idea is to prevent lost update on database when multiple accesses occur concurrently.
    Thanks in advance for your patience,
    Tommaso

    Hi all!
    In a stateless session bean (EJB3) with container managed transactions I need to set the transaction isolation level to SERIALIZABLE.
    The idea is to prevent lost update on database when multiple accesses occur concurrently.
    Thanks in advance for your patience,
    Tommaso

  • How can I set the value to a session bean from backing bean

    Hi Experts,
    How can I set the value to a session bean from backing bean where I have created getter and setter
    methods for that variable.
    Basically I am using ADFUtils class where I am able to get the value from session bean
    using following expression
    String claimType =
    (String)ADFUtil.invokeEL("#{ClaimValueObj.getClaimType}");
    Thanks
    Gayaz

    Gayaz,
    Wrong Post !!
    Post in JDeveloper and ADF
    Thanks
    --Anil                                                                                                                                                                                                                               

  • EJB 3.0 - Communicate an Applet with a Session Bean

    Hello
    I'm developing an EJB 3.0 app (eclipse and glassfish tools bundle), and I have an applet that has to use remote session beans.
    QUESTION: Is it possible for the applet to connect to EJB?
    QUESTION: By creating a J2EE application client project, can I use @EJB annotations to inject the session bean directly to the applet, avoiding the JNDI lookup?
    (since I imagine that the anwser to the second one is NO, I do the following consideration)
    Given an application client project, I imagine that this application can run remotely on a client machine/JRE. Then this application can use Annotations/injection facilities whenever it runs on a J2EE client container (which I assume consists of a set of libraries provided by the application server vendor, Glassfish in that case). Could this application be deployed using Java Web Start? If so, why can't it be deployed as an applet? (both options run in a client JRE, don't they?).
    QUESTION: In either case (applet or JWS), how do I have to package the JAR file (using Eclipse) so that it contains the needed libraries for accessing the EJB? Which are those libraries?
    At the time being, I'm trying to implement a sample application that follows the "Applet doing JNDI lookup" approach. I have:
    - an EAR project
    - an EJB project (containing an Entity Bean and a Stateless Session Bean with a @Remote interface)
    @Remote
    public interface HelloRemote {
         public String hello(String name);
    @Stateless
    public class Hello implements HelloRemote {
         @Override
         public String hello(String name) {
              return "Hello "+name+"!!";
    }- an Application Client project (containing the applet code):
    public class ClientApplet extends JApplet {
         public void init(){     
              try {
                   Context jndiContext = getInitialContext( );
                   HelloRemote server = (HelloRemote) jndiContext.lookup(HelloRemote.class.getName());
                   setContentPane(new JLabel(server.hello("Gerard")));
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         private Context getInitialContext() throws NamingException{
              Properties props = new Properties();
              props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
              props.setProperty("org.omg.CORBA.ORBInitialHost", "myhost");
              props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
              return new InitialContext(props);
    }- a static web project (with a sample web page that contains the applet object the corresponding applet JAR file)
    I tried to export the Application Client project as an "application client JAR", in the hope that the java EE libraries bundled with glassfish (listed as libraries of this project) would be packaged too.
    No success, so now I'll try to copy all the JAR files (one by one) into the +\WebContent\+ folder of the Web Project, and add references to each of them in the archive="" attribute of the +<applet>+ HTML tag. Although this might work, I suspect that I am missing the good/easy way of doing it. Any suggestions?
    Thanks in advance,
    Gerard
    Edited by: gsoldevila on May 6, 2009 7:09 AM

    An Applet can communicate with an EJB via JNDI lookup but I would (personally) use an intermediate Servlet to handle this. Client to Servlet communication is http whereas to ejb is iiop - which might be blocked.
    Injection only works in managed classes (EJB, Servlet, Listeners..) and an Application Client main class. So yes you could use an app client for handling resource injection.
    m

  • Calling Enity Bean's business methods from a session bean in EJB 3.0 specif

    Hello everybody,
    Happy to be a member with you in this forum.
    This is my first participation in this forum.
    I have some problem to start with EJB 3.0 specification, I have created an entity bean with some business methods that access a mysql datbase, then i want to create a stateful session bean to provide the client an interface to consume business methods in Enity be
    Please can someone you help me with an example

    @Vladimir Pavlov
    I did not understand what you are trying to convey...
    Whenever an attribute of this bean is modified we want to access that latest value.... Is there any way to know, when the attribute is modified? Just with get/set we can not know, when it is modified... am i right?
    We want to achieve this without modifying the existing source code of the EJB....
    @ Ivo Simeonov
    As of my knowledge, to use interceptors we need to modify the EJB source code, but we do not want to touch the source code....
    All this has to be achieved dynamically when the application is deployed in the production.... is it possible???

  • Error while calling a Web Service from a Session Bean

    I am trying to call a Web Service from a Session Bean using an Axis client, but I am getting the next exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException: org/apache/axis/client/Service
         at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.wrapException(Util.java:364)
         at javax.rmi.CORBA.Util.wrapException(Util.java:277)
         at com.ing.mx.seguros.siniestros.litigios.ejb._SisaServiceRemote_Stub.invocarWebSericeProveedorLegal(Unknown Source)
         at com.ing.mx.seguros.siniestros.litigios.proxy.SisaWsProxy.solicitarApoyoLegal(SisaWsProxy.java:132)
         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.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:402)
         at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:309)
         at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:333)
         at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
         at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481)
         at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
         at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
         at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
         at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:850)Thanks for any help provided.
    Does any one have insights about it?

    Hi Swapna,
    from your screenshot it seems that you actually try to call the service in your Data Source Expression field. You should set path to the WSDL file here actually - this could be either URL to SAP or to filesystem, as Anton suggested (this could be faster). Have you created endpoint binding for your service in transaction SOAMANAGER? If yes, then simply download the corresponding WSDL with binding or copy the URL which leads to it. But also test whether you are able to retrieve the WSDL without logging into SAP (close all browser windows and then open a new one otherwise session ID from other browser windows can be reused).
    If you have to give username and password, then setup anonymous alias in transaction SICF, for example.
    Pleas, check my previous post on the same subject here: Re: BCM7 IVR : SOAP request for client identification in CRM .
    Maybe it could help.
    Regards,
    Dawood.

  • Accessing the same stateful session bean from multiple clients in a clustered environment

    I am trying to access the same stateful session bean from multiple
              clients. I also want this bean to have failover support so we want to
              deploy it in a cluster. The following description is how we have tried
              to solve this problem, but it does not seem to be working. Any
              insight would be greatly appreciated!
              I have set up a cluster of three servers. I deployed a stateful
              session bean with in memory replication across the cluster. A client
              obtains a reference to an instance of one of these beans to handle a
              request. Subsequent requests will have to use the same bean and could
              come from various clients. So after using the bean the first client
              stores the handle to the bean (actually the replica aware stub) to be
              used by other clients to be able to obtain the bean. When another
              client retrieves the handle gets the replica aware stub and makes a
              call to the bean the request seems to unpredictably go to any of the
              three servers rather than the primary server hosting that bean. If the
              call goes to the primary server everything seems to work fine the
              session data is available and it gets backed up on the secondary
              server. If it happens to go to the secondary server a bean that has
              the correct session data services the request but gives the error
              <Failed to update the secondary copy of a stateful session bean from
              home:ejb20-statefulSession-TraderHome>. Then any subsequent requests
              to the primary server will not reflect changes made on the secondary
              and vice versa. If the request happens to go to the third server that
              is not hosting an instance of that bean then the client receives an
              error that the bean was not available. From my understanding I thought
              the replica aware stub would know which server is the primary host for
              that bean and send the request there.
              Thanks in advance,
              Justin
              

              If 'allow-concurrent-call' does exactly what you need, then you don't have a problem,
              do you?
              Except of course if you switch ejb containers. Oh well.
              Mike
              "FBenvadi" <[email protected]> wrote:
              >I've got the same problem.
              >I understand from you that concurrent access to a stateful session bean
              >is
              >not allowed but there is a
              >token is weblogic-ejb-jar.xml that is called 'allow-concurrent-call'
              >that
              >does exactly what I need.
              >What you mean 'you'll get a surprise when you go to production' ?
              >I need to understand becouse I can still change the design.
              >Thanks Francesco
              >[email protected]
              >
              >"Mike Reiche" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Get the fix immediately from BEA and test it. It would be a shame to
              >wait
              >until
              >> December only to get a fix - that doesn't work.
              >>
              >> As for stateful session bean use - just remember that concurrent access
              >to
              >a stateful
              >> session bean is not allowed. Things will work fine until you go to
              >production
              >> and encounter some real load - then you will get a surprise.
              >>
              >> Mike
              >>
              >> [email protected] (Justin Meyer) wrote:
              >> >I just heard back from WebLogic Tech Support and they have confirmed
              >> >that this is a bug. Here is their reply:
              >> >
              >> >There is some problem in failover of stateful session beans when its
              >> >run from a java client.However, it is fixed now.
              >> >
              >> >The fix will be in SP2 which will be out by december.
              >> >
              >> >
              >> >Mike,
              >> >Thanks for your reply. I do infact believe we are correctly using
              >a
              >> >stateful session bean however it may have been misleading from my
              >> >description of the problem. We are not accessing the bean
              >> >concurrently from 2 different clients. The second client will only
              >> >come into play if the first client fails. In this case we want to
              >be
              >> >able to reacquire the handle to our stateful session bean and call
              >it
              >> >from the secondary client.
              >> >
              >> >
              >> >Justin
              >> >
              >> >"Mike Reiche" <[email protected]> wrote in message
              >news:<[email protected]>...
              >> >> You should be using an entity bean, not a stateful session bean
              >for
              >> >this application.
              >> >>
              >> >> A stateful session bean is intended to be keep state (stateful)
              >for
              >> >the duration
              >> >> of a client's session (session).
              >> >>
              >> >> It is not meant to be shared by different clients - in fact, if
              >you
              >> >attempt to
              >> >> access the same stateful session bean concurrently - it will throw
              >> >an exception.
              >> >>
              >> >> We did your little trick (storing/retrieving handle) with a stateful
              >> >session bean
              >> >> on WLS 5.1 - and it did work properly - not as you describe. Our
              >sfsb's
              >> >were not
              >> >> replicated as yours are.
              >> >>
              >> >> Mike
              >> >>
              >> >> [email protected] (Justin Meyer) wrote:
              >> >> >I am trying to access the same stateful session bean from multiple
              >> >> >clients. I also want this bean to have failover support so we want
              >> >to
              >> >> >deploy it in a cluster. The following description is how we have
              >tried
              >> >> >to solve this problem, but it does not seem to be working. Any
              >> >> >insight would be greatly appreciated!
              >> >> >
              >> >> >I have set up a cluster of three servers. I deployed a stateful
              >> >> >session bean with in memory replication across the cluster. A client
              >> >> >obtains a reference to an instance of one of these beans to handle
              >> >a
              >> >> >request. Subsequent requests will have to use the same bean and
              >could
              >> >> >come from various clients. So after using the bean the first client
              >> >> >stores the handle to the bean (actually the replica aware stub)
              >to
              >> >be
              >> >> >used by other clients to be able to obtain the bean. When another
              >> >> >client retrieves the handle gets the replica aware stub and makes
              >> >a
              >> >> >call to the bean the request seems to unpredictably go to any of
              >the
              >> >> >three servers rather than the primary server hosting that bean.
              >If
              >> >the
              >> >> >call goes to the primary server everything seems to work fine the
              >> >> >session data is available and it gets backed up on the secondary
              >> >> >server. If it happens to go to the secondary server a bean that
              >has
              >> >> >the correct session data services the request but gives the error
              >> >> ><Failed to update the secondary copy of a stateful session bean
              >from
              >> >> >home:ejb20-statefulSession-TraderHome>. Then any subsequent requests
              >> >> >to the primary server will not reflect changes made on the secondary
              >> >> >and vice versa. If the request happens to go to the third server
              >that
              >> >> >is not hosting an instance of that bean then the client receives
              >an
              >> >> >error that the bean was not available. From my understanding I
              >thought
              >> >> >the replica aware stub would know which server is the primary host
              >> >for
              >> >> >that bean and send the request there.
              >> >> >
              >> >> >Thanks in advance,
              >> >> >Justin
              >>
              >
              >
              

  • Declarative Transactions, Session Beans & JDBC

    Hi (this is really a newbie question),
    If I executed an SQL Update statement in a Stateless Session Bean via JDBC,
    is my call to the database enlisted in the container transaction
    automatically? (Of course, I am assuming the correct TxRequired settings
    are set on the deployment descriptors for the Session Bean.)
    Asked in another way, how does JDBC "talk" to the EJB container to let it
    know that it is being called within a Transactional Context and that all
    activities with the database should then be enlisted in a transaction
    automatically? Where does this "smartness" come in? Or does this not happen
    at all - do I have to "obtain" the JDBC connection object from the EJB
    container instead of writing directly to JDBC?
    Thanks in advance,
    Abdullah Kauchali

    Correct.
    I'd also recommend (where possible), doing the DataSource JNDI lookup in
    your setSessionContext method and storing it away in a member variable.
    There's usually no reason to do it on every method call.
    -- Rob
    Abdullah Kauchali wrote:
    Okay,
    After some investigations, this is what I've learned:
    1. To get automatic transactional enlistment (in a distributed tx), you
    have to make your EJB container aware of the JDBC datasource (viz. you have
    to create a Transactional DataSource). This is done by creating necessary
    entries in a configuration XML file so that the container can connect to the
    JDBC datasource when fired-up;
    2. You then only create your Connection object via a reference (JNDI to be
    exact) to the connection object and NOT directly with JDBC (this was my
    confusion in fact). Something like this:
    //obtain the conduit to the JNDI resource manager factory
    javax.sql.DataSource objDS = (javax.sql.DataSource)
    context.lookup("~some jndi
    reference~");
    //now get the connection object - notice no "javax" but "java"
    java.sql.Connection objCon = objDS.getConnection();
    3. By doing 2. above you are actually using a "Resource Manager Connection
    Factory" to get your Connection object for subsequent SQL Updates;
    4. As long as your JDBC driver supports the javax.sql.DataSource interface
    and provided Transactional Context is propagated from any root call to your
    worker Session Bean, you get automatic transaction enlistment of the SQL
    Updates with your EJB container;
    Please correct me if I have concluded wrongly,
    Regards
    Abdullah
    "Abdullah Kauchali" <ak@ak> wrote in message
    news:[email protected]...
    Hi (this is really a newbie question),
    If I executed an SQL Update statement in a Stateless Session Bean viaJDBC,
    is my call to the database enlisted in the container transaction
    automatically? (Of course, I am assuming the correct TxRequired settings
    are set on the deployment descriptors for the Session Bean.)
    Asked in another way, how does JDBC "talk" to the EJB container to let it
    know that it is being called within a Transactional Context and that all
    activities with the database should then be enlisted in a transaction
    automatically? Where does this "smartness" come in? Or does this nothappen
    at all - do I have to "obtain" the JDBC connection object from the EJB
    container instead of writing directly to JDBC?
    Thanks in advance,
    Abdullah Kauchali

  • How to run a client program in Session bean using weblogic 8.1

    Hi
    I am new to weblogic server 8.1. I sucessfully deployed session ejb Session Bean. I created sessionbean jar file and put it it classpath also.
    and also i created sessiobeanclient jar file, it included in class path.
    While running client program it throws exception like noclass def found exception
    plz tell me the right way to run the session ejb program.
    bye

    Hi,
    You have to follow the given steps before you are going to run the client program that invokes the session bean .
    1)set the Weblogic Environment using the tool setWLSEnv
    2)place the Session bean jar file in classpath
    3)run the client program
    Note:If the client has to execute on remote machine we need to copy client class,remote interface, home interface and other classes which are used as
    parameters and return types.
    Regards
    Anilkumar kari

  • Error in updating secondary stateful session bean

              Hi all,
              I have set up a cluster of 2 managed servers with WebLogic 6.1. I have a
              stateful session bean and several stateless session beans. the stateful
              session bean keeps user info and limited cached objects, all are
              serializable. it seems working fine, even after killing any one of the
              servers, as long as one is alive. a java application client creates a
              stateful session bean first, then calls stateless session beans with the
              remote interface of the stateful bean as a method parameter. No problem
              when stateful session bean is created. However, each stateless bean method
              generates the following error message if I turn the debug on (level 64). No
              exception stack traces, and all methods execute successfully.
              <Error> <EJB> <Failed to update the secondary copy of a stateful session
              bean from home:clientsession>
              I wonder what causes the error, and why it tries to update the stateful
              session bean. in all stateless session beans, only read into the stateful
              bean.
              Thank you,
              Fujin
              

    This has been fixed in WLS 6.1 SP2.
              jagdip Talla wrote:
              > Hi Fujin,
              > please let me know, if u were able to solve the problem..
              >
              > hi guys,
              > appreciate if you could give me some clues
              > how to solve this problem ?
              >
              > i hv 2 WLS instances in a cluster,
              > when one server instance is shut down, i keep getting these errors ?
              > is it normal ?
              > <Feb 19, 2002 2:57:53 PM SGT> <Error> <EJB> <Failed to update the secondary copy of a stateful session bean from home:ejb/xyzrel1_2/xxxxHome>
              >
              > appreciate if u can let me know, if u could solve it..?
              >
              > thanks n regads
              > jagdip
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • JDEV 10.1.3 How to manipulate/Debug IndirectList from ejb 3.0 session bean

    I was debugging my session bean a seen that element data for the employeesCollection was empty.
    I didn't understood why my java client was throwing an error when i accessed manually the Departments collection and get the employeeCollection from the first entry in the collection. What was confusing me was that my master/detail jfs application was displaying these data. From where ? how was it possible ? it was the same session bean !
    This is the reason i debugged the session bean return object and seen that the collection was also empty as the from executing from my java client application. I have seen the type of the object that was not a collection but IndirectList.
    So my question ! how is it possible to load the collection of this type ? Which method the data control is executing to load it ? Where may i found a description of this very interesting process ?

    Hi Frank.
    plain English - on plan :).
    I create managed bean with function which do access to LDAP and this function 'return List<Users>'.
    In JDeveloper :) on managed bean(java class) i create "Create Data Control"... after, from Data Controls i drop on page this data(create ADF Table with selectOne)...
    First Page Ready!
    Second page... i need to know which option selected on first page. This option(row) contains, UserName and etc... On second page i again fetch data, from LDAP, associated with this concrete UserName... Because i fetch data using managed bean :) i need to know this username in my managed bean...
    May be :) im wrong...
    sessionAttribute - like this? ->
    * Convenience method for setting Session variables
    * @param ctx FacesContext
    * @param key object key
    * @param object value to store
    public static void storeOnSession(FacesContext ctx, String key, Object object) {
    Map sessionState = ctx.getExternalContext().getSessionMap();
    sessionState.put(key, object);
    * Convenience method for getting Session variables
    * @param ctx FacesContext
    * @param key object key
    public static Object getFromSession(FacesContext ctx, String key) {
    Map sessionState = ctx.getExternalContext().getSessionMap();
    return sessionState.get(key);
    }

Maybe you are looking for

  • Purchased extra storage for photos

    Hi, i have purchased an extra 200gb of storage for photos (newbie to mac here) , can anyone tell me if my photos are saved to iCloud do they stay there until i delete them or do they delete after so many days ?  I bought the 200gb as somewhere to sav

  • Passing arguments in JNLP not working

    I am trying to send arguments to my web start application in the JNLP file attached below. But my application claims that there are no arguments passed to its main program. This is under JDK 1.4.2 and Windoze XP. Has anyone seen this problem or seen

  • Make "Curtain" mode default in Apple Remote Desktop?

    Two issues with ARD and looking for a way to overcome: How can I have Curtain mode enabled by default as soon as I connect to my machine at work? How can I force my machine at the office to get locked (or have the user logged out, or at least switch

  • Order calculating attribute dimension

    Hi all,I have an outine with 4 dimensions measure ( dimension tagged as accounts and desnse )Scenario (dimension tagged as dense)Year (dimension tagged as sparse) (Y02,Y03, Y04)store (dimension tagged as sparse)society (attribute dimension) ( soc1,so

  • ITunes Authorization Error

    I've read all the posts about the authorization error when trying to place a song from iTunes into iMovie. I've tried all the suggestions on both my computers (G5 iMac & MacBook) with no success. All software is up to date and I reloaded iTunes 7.2 o