Accessing client session information in ejb

Hi!
My prblem is the following. We want to access ejb from a servlet. We need some client session information in ejb (e.g. client username, client terminal name, client ip address) for several reason. Could anybody suggest a solution other than passing all the data through the parameter list of every method?
Thanks for any help.
Zoltan

If you use stateful session bean, you can pass this information, when you create it.

Similar Messages

  • Getting session information in servlet?

    In Apache SOAP, org.apache.soap.rpc.SOAPContext can be used as a parameter to get at session data in your servlet. The JDeveloper web services publishing wizard won't expose a method with this parameter, saying that the XML Schema mapping and/or serializer is not specified. Is there an OC4J equivalent to get at session information?

    Hi.
    Most definitely possible. A few months ago I coded something very similar - jsp
    form, submit to a servlet. I needed to get and set session info in both the
    servlet and jsp. The code was very basic (ie no tricks involved) and worked
    well. FWIW both my servlet and jsp were in the same webapp.
    Good luck,
    Michael
    PeterH wrote:
    Howdy.
    re meant something else
    That's what I'm trying to figure out. :>
    re what do I mean by...
    I have one jsp page, that has a an html form on it with elements that get
    passed to a servlet through a submit button on the form. I would like to be
    able to get information about the session from within the servlet. Is that
    possible?
    Let me know if I'm not explaining myself properly and you need more info.
    I'm relatively new to this stuff. But I'm learning! :>>>>
    Thanks for your reply.
    <[email protected]> wrote in message news:[email protected]..
    Hrm. Whoever told you this probably meant something else. What do you mean
    by a 'servlet being called from a jsp' ?
    PeterH <!REMOVEBeforeSending![email protected]> wrote:
    I was told today when using a servlet within a web app (being called
    from a
    jsp), you do not have access to the session object. Is that true?Short of
    passing session attributes via the servlet call, how can you access the
    session information?
    Thanks for any ideas.--
    Dimitri
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Isolated client session & caching

    I have a 3-tier TopLink application that uses isolated client sessions and stateless EJBs with CMT. A separate client session is created for each EJB method call via server.acquireClientSession(). To retrieve a persistent object for read-only purposes, the application uses the client session. To retrieve a persistent object for read/write purposes, the application uses the UnitOfWork returned by clientSession.getActiveUnitOfWork(). Within the same EJB method call, retrieving the same persistent object via the client session and the UnitOfWork causes the same SELECT to be issued twice.
    I noticed that the parent session of the UnitOfWork returned by clientSession.getActiveUnitOfWork() is not clientSession My guess is that this causes objects retrieved via the UnitOfWork to not be stored in clientSession's cache.
    Why is the parent session of the UnitOfWork returned by clientSession.getActiveUnitOfWork() not equal to clientSession? Could the duplicate SELECT be avoided if the parent session was clientSession?

    Hello,
    Instead of calling getActiveUnitOfWork() call acquireUnitOfWork on the clientSession. The acquired UnitOfWork will have the clientSession as the parent. The method getActiveUnitOfWork() goes to the TopLink CMT interface objects to acquire the UnitOfWork. This UnitOfWork is available throughout the transaction and as such is created with a different parentage.
    If you would like to share the same UnitOfWork and ClientSession throughout the Transaction then you could call getActiveUnitOfWork on the serverSession (instead of acquireClientSession) then get the parent and execute your read-only queries on that ClientSession.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Client side Information via Web

    Anyone have any experience in accessing client side information
    via Web Forms. I need to pull user info from their machine vice
    the server, which is actually running the form.
    null

    Jeffrey Porter (guest) wrote:
    : I'm looking for information on how to construct the link
    between
    : the web server and the database such that the client is not
    : required to establish the database link. Everything is server
    : side with the client passing in values via web submits and
    : information returned via constructed HTML. I think the reason
    : this is all constructed this way is to fit into the JAVA
    security
    : model for web based application processes. I have constructed
    : the JDBCODBC bridging with the client making the dattabase
    : connection but now I want the connection shifted from the
    client
    : to the server.
    (1) In your system there are 3 nodes. The first one is the web
    client running a browser posting HTTP request to your web server.
    Your web server is a server to the web client but also a client
    to your Oracle database server. From the web client browser you
    cannot communicate directly with the Oracle server directly
    through JDBC. Your CGI scripts (you have not specified what web
    scripting tool you are using) written in Java may communicate
    with your Oracle database using the JDBC drivers available in
    your $ORACLE_HOME/jdbc/lib/classes111.zip file.
    (2) You do not need any JDBC-ODBC bridge to access Oracle
    databases. You should use the Oracle JDBC drivers.
    NM
    null

  • EJB client session

    What is an EJB client session? How many are there? When does it start and when does it end? Who controls that?
    Thank you.

    You may be thinking of a Stateful Session Bean. Each stateful session bean has state that is tied to a
    particular client. In EJB 3.0, the stateful session bean is created when the client does a naming
    lookup or has the stateful session bean injected. The client can remove the stateful session bean at
    any time by calling a method annotated with the @Remove annotation.
    The container can also choose to remove a stateful session bean. Typically, the container vendor
    provides configuration options that specify the stateful session bean timeout parameters.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Could not access Local Session Bean using JNDI lookup

    Hi EJB Guru,
    I am quite new to EJB 3.0 but have had a good deal of success including using JNDI to lookup Remote Stateless Session Bean in EJB 3.0. However, looking up local Stateless Session Bean prove more challenging with I had anticipated.
    Here is my code
    as follows:
    public interface Calculator {
        public int add(int x, int y);
        public int subtract(int x, int y);
    import javax.ejb.Remote;
    @Remote
    public interface CalculatorRemote extends Calculator {
    import javax.ejb.Local;
    @Local
    public interface CalculatorLocal extends Calculator {
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import bean.CalculatorLocal;
    import bean.CalculatorRemote;
    @Stateless
    public class CalculatorBean implements CalculatorRemote, CalculatorLocal {
        public int add(int x, int y) {
            return x + y;
        public int subtract(int x, int y) {
            return x - y;
    import bean.*;
    import bean.Calculator;
    import bean.CalculatorLocal;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class ClientAccessLocalCalculator {
        public static void main(String[] args) throws NamingException {
            InitialContext ctx = new InitialContext();
            CalculatorLocal calculator = (CalculatorLocal) ctx.lookup("CalculatorBean/local");
            System.out.println("1 + 1 = " + calculator.add(1, 1));
            System.out.println("1 - 1 = " + calculator.subtract(1, 1));    }
    import bean.Calculator;
    import bean.CalculatorRemote;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class ClientAccessRemoteCalculator {
        public static void main(String[] args) throws NamingException {
            InitialContext ctx = new InitialContext();
            CalculatorRemote calculator = (CalculatorRemote) ctx.lookup("CalculatorBean/remote");
            System.out.println("1 + 1 = " + calculator.add(1, 1));
            System.out.println("1 - 1 = " + calculator.subtract(1, 1));    }
    }Output when running ClientAccessRemoteCalculator gives
    1 + 1 = 2
    1 - 1 = 0
    Output when running ClientAccessLocalCalculator on JBoss AS 4.0.5 gives:
    Exception in thread "main" javax.ejb.EJBException: Invalid invocation of local interface (null container)
    at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:75)
    at $Proxy0.add(Unknown Source) at ClientAccessLocalCalculator.main(ClientAccessLocalCalculator.java:14)
    JNDIView in JMX-Console in JBoss:
    +- CalculatorBean (class: org.jnp.interfaces.NamingContext)
    | +- local (proxy: $Proxy84 implements interface bean.CalculatorLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
    | +- remote (proxy: $Proxy83 implements interface bean.CalculatorRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
    Output when running ClientAccessLocalCalculator on SJSAS 9.0 gives:
    Exception in thread "main" javax.naming.NameNotFoundException: bean.CalculatorLocal not found
    C:\>asadmin
    Use "exit" to exit and "help" for online help.
    asadmin> list-jndi-entries
    Jndi Entries for server within root context:
    bean.CalculatorRemote: javax.naming.Reference
    jbi: com.sun.enterprise.naming.TransientContext
    jdbc: com.sun.enterprise.naming.TransientContext
    UserTransaction: com.sun.enterprise.distributedtx.UserTransactionImpl
    bean.CalculatorRemote__3_x_Internal_RemoteBusinessHome__: javax.naming.Reference
    bean.CalculatorRemote#bean.CalculatorRemote: javax.naming.Reference
    ejb: com.sun.enterprise.naming.TransientContext
    Command list-jndi-entries executed successfully.
    asadmin>I am using Application Client to lookup these Session Beans on Netbeans 5.5, JBoss AS 4.0.5 (EJB3 installer)/SJSAS
    9.0, SDK 1.5.0_11 on Windows XP platform.
    Any assistance would be much appreciated.
    Many thanks,
    Henry

    Hi Henry,
    Any direct global JNDI lookup is not portable. It works in some cases but not in others, which
    is why we recommend using the portable Java EE approach of declaring an ejb dependency
    and looking up that dependency via the bean's component environment (java:comp/env).
    This is true whether you're dealing with Remote or Local ejb dependencies.
    Local ejbs are not supported in the Application Client tier at all. In the server tier, there is no
    guarantee that a Local EJB even is assigned a global JNDI name since there's no requirement
    that it be available outside of the application in which the ejb is defined.
    You can find more information on these ejb access topics in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • How client application contacts the EJB?

    Hi,
    I have a doubt. I am wondering how the client application contacts an EJB. Consider the following scenario.
    I have my web server and the application server located in two different locations, meaning two different machines.
    My web components are deployed onto the web server and my enterprise components are deployed onto the application server. In this case how the client application will know how to locate an EJB that is running on a different machine. In the client application we only call lookup method of the JNDI. But my doubt is just with the lookup name how it would be possible to locate an EJB. We are not giving any IP address or port or anything in our client application or may be we should...
    Is there anyone who can clarify please?
    Thanks in advance
    Karthik

    Hi
    This is what I wanted to know...
    If you need to access EJB components that are residing in a remote system other than the system where the application client is being developed, set the values for the Java Virtual Machine startup options:
    jvmarg value = "-Dorg.omg.CORBA.ORBInitialHost=${ORBhost}"
    jvmarg value = "-Dorg.omg.CORBA.ORBInitialPort=${ORBport}"
    Here ORBhost is the Application Server hostname and ORBport is the ORB port number (default 3700).
    This information can be obtained from the domain.xml file on the remote system. For more information on domain.xml file, see the Sun Java System Application Server Reference.
    The link you provided was more than enough to clarify...
    Thanks,
    Karthik

  • Single Sign-On and session information

    I have an Oracle Portal application with many Java Web Applications. I wish to
    provide Single Sign-On to this applications. I know how to configure Single
    Sign-On and how to get the user login in Java. I want to store session
    information such as: User First and Last Name, User Social Security Number. I
    want to get this information from the database after authentication, store it
    in session and then access this information from all my applications.

    Are you familiarized with sys_context function?
    Hope this is useful help.
    BR,
    Marcos

  • What happens to client session when host goes down?

    I have a windows 2012 R2 RDP environment. 1 Broker and 3 Session Host Servers.
    My question is as follows:
    User connects via broker to one of the Host servers. Host server goes down, while user is still connected. Session is written in Broker database. User wants to connect again, but broker sends him on to the server which is down and so he cannot connect.
    Other situation is similar, User connects to host, administrator drains host, stopping new connections. User disconnects session, session is still in Broker, when user tries to reconnect is sent to drained server but cannot login, as he is considered new
    connection.
    What am I missing?
    Aaron

    Hi Aaron,
    Thank you for posting in Windows Server Forum.
    We need to configure RDSH in a load balance farm where it can be managed by RD Connection Broker. For that we need to use DNS RR where need to make entry for all RDSH server which will be handled by RDCB Server or we can use any load balancing method to load
    balance the different RDSH server and thus that connection will allow the disconnected session for reconnection and can identify the connection.
    The RD Connection Broker for RDS serves the following main purposes:
    • Determining the best RD Session Host server to connect to - this is based on the amount of current sessions per RD Session Host Server as a form of load balancing. 
    • Reconnecting a user to an existing session, in case there is one - this is called reconnecting to disconnected sessions. 
    • Being a resource for RD Web Access to deliver information about what Remote Apps are available on RD Session Host Servers that are a member of the broker.
    More information.
    Remote Desktop Server farms explained (Part 1
    & Part 2) (Link is for Server 2008 R2 but it’s only for reference).
    Step by Step Windows 2012 R2 Remote Desktop Services – Part 3 (For Server 2012 R2)
    Hope it helps!
    Thanks.
    Dharmesh Solanki

  • Failed to acquire exclusive lock on client session ClientSession

    HI all.
    when I login the Portal as a MSS role,I want to see about the data of employee(about 20000 employee).
    some page can't open succeed.The error:
    500   Internal Server Error
      SAP NetWeaver Application Server 7.00/Java AS 7.00 
    Failed to process request. Please contact your system administrator.
    Error Summary
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
       com.sap.tc.webdynpro.services.session.LockException: Thread SAPEngine_Application_Thread[impl:3]_27 failed to acquire exclusive lock on client session ClientSession(id=(DSAPBPRD_DPP_01)ID2006199550DB11722229503911854949End_53412655). Existing locks: LockingManager(ThreadName:SAPEngine_Application_Thread[impl:3]_27, exclusive client session lock: ClientSessionLock(SAPEngine_Application_Thread[impl:3]_29), shared client session locks: ClientSessionSharedLockManager([]), app session locks: ApplicationSessionLockManager([]), current request: sap.com/pb/PageBuilder).Hint: Take a thread dump of the server node to find the blocking thread that causes the problem.
        at java.lang.Throwable.<init>(Throwable.java:56)
        at com.sap.exception.BaseException.<init>(BaseException.java:145)
        at com.sap.tc.webdynpro.services.exceptions.WDException.<init>(WDException.java:61)
        at com.sap.tc.webdynpro.services.exceptions.WDException.<init>(WDException.java:54)
        at com.sap.tc.webdynpro.clientserver.session.ClientSession$LockingManager.lock(ClientSession.java:1511)
        ... 20 more
    Edited by: cui joe on Jun 16, 2009 5:36 AM

    HI,thanks very much.
    Because our data is very huge,so some leader login the system will get the error.I check the st22,It realy found the error:
    Time limit exceeded.
    The program "SAPLRHDB" has exceeded the maximum permitted runtime without
    interruption and has therefore been terminated.
    If I should increase the system profile parameter "rdisp/max_wprun_time"?
    Can else I should turn other parameter?

  • Missing post message in client session monitoring

    Hi,
    I have synchronized creating a record of a data object, in the message monitoring tool appears that the message is processed correctly but if I look the session at the client session monitoring that message did not appears, would appears as post message, right?
    Another question, why in the client session monitoring at session information of a one session appears not sorted the synchronization cycle number or date and time? Can I sorted it?
    I'm in 7.10 SP11.
    Thanks in advance and kind regards.

    Hi,
    You see only default columns given by SAP. But you can add additional attributes like direction, message type etc., by going to personalization screen. On extreme right of the table top, you see a couple of buttons. One of them is personalization. Click on that and it opens a pop which shows the list of available fields for display on left side and fields which are already displayed on the right side.
    You need to select direction and message type from left and move them to right and save and apply those settings for the user. So from next time, it shows the selected attributes.
    Coming to your problem, do you see any messages at all in session monitoring? Without giving any filtering criteria just try to search for all of them in the system. See if you get any entries at all. (If still not displayed then you need to enable session monitoring logs).
    The timezone difference could be because the system timezone is set to different timezone than of your current.
    Best Regards,
    Siva.

  • How can we share session information between browser and WebView

    Hi
    I have a web application which launches a instance of JavaFX web view on a click of a button. My issue is that when i launch this web view it creates a  new session of its own ,how can you transfer the session information of the parent (browser) to the web view.
    One of the solution i found was to add the JSESSION_ID cookie into the default(System-wide) cookie handler so it would override the existing cookie within the WebView cookiehandler.
    http headers - Setting a cookie using JavaFX&amp;#39;s WebEngine/WebView - Stack Overflow
    Are there any other solution for sharing session information between the web view instance and browser that launches it ?

    O.K. then, is it at least possible to access a wwsto_api_session
    from Java in the following way?
    Calling PL/SQL from Java
    JDBC and SQLJ allow you to call PL/SQL stored functions and
    procedures. For example, suppose you want to call the following
    stored function, which returns
    the balance of a specified bank account:
    FUNCTION balance (acct_id NUMBER) RETURN NUMBER IS
    acct_bal NUMBER;
    BEGIN
    SELECT bal INTO acct_bal FROM accts
    WHERE acct_no = acct_id;
    RETURN acct_bal;
    END;
    From a JDBC program, your call to the function balance might look
    like this:
    CallableStatement cstmt = conn.prepareCall("{? = CALL balance(?)}");
    cstmt.registerOutParameter(1, Types.FLOAT);
    cstmt.setInt(2, acctNo);
    cstmt.executeUpdate();
    float acctBal = cstmt.getFloat(1);

  • Client Session Not getting expired in OBI EE 10.1.3.4.1

    Hi All,
    I haave placed the below tag in the instanceconfig.xml file, but the client session is not getting expired.
    Can you please help me on the same.
    Our test environment OBI is enabled with the Site minder SSO.
    <ClientSessionExpireMinutes> 60</ClientSessionExpireMinutes>
    Thanks in Advance
    Siva

    Siva,
    There can be many factors for this: 'ClientSessionExpireMinutes'
    Defines the length of idle time that can pass before Oracle BI Presentation Server removes the user's client (browser) session information from its memory. This session includes user-specific state information such as request cache - dashboard page state - subject area information -connection information - and so on.
    Make sure while testing you are not doing anything on OBIEE browser window i.e. its idle
    Also, try to increase the minutes to say 240 and check how much time it takes ...??
    This shud solve..as this is very common problem with such tags..its not 100% guranteed !!

  • Forms6i Accessing HTTP Session Object in APache JServ

    I want to create an HTTP session object via a servlet in Apache JServ. This session object contains user profile data as well as session context information. The servlet will redirect the user to the forms6i listener servlet. Can the Forms servlet access the session object and retrieve/modify its values? Does Forms6i provide APIs to do this natively?

    Maybe the Java Importer is what you are looking for.
    You can use it to call the servlet from within forms and get the information you need.(But only after forms is running).
    look at the Java integration section on Forms section of otn.

  • Sun Desktop Access Client - Language Settings Windows Logon Screen

    Dear All,
    i have a little problem with the language setting of my Sun Desktop Acces Client if i try to connect to Windws 2003 Server.
    First some configuration details:
    PC:
    Win XP (german version)
    keyboard layout: german
    Sun Desktop Access Client 1.0
    Server:
    Win 2003 Server (german version)
    The Problem is that if connect the server via the SDAC the laguage setting of the logon screen has changed to EN
    instead of DE. Using a german keyboard layout causes some trouble.
    If i connect to the server via a sun ray dtu (kiosk mode) it works properly.
    Has anybody a clue to get rid of this??
    Thanks in advance.
    Best regards
    Ha-Pe

    Okay, after a bit of investigation...
    You can't have the locale used change automatically according to the local used on the client, the best you can do is assign a default locale for most users and create alternative kiosk sessions with different locales (as a uttsc option) which you can assign to DTUs or SDACs (or to smartcard token ids but SDAC doesn't currently support smartcards).
    At least this is what I understand, I'm sure someone will comment if this isn't the case.
    If this is good enough you can do this using the utkiosk and the utkioskoverride commands.

Maybe you are looking for