Session monitoring servlet

Hi
          I am trying to write a servlet to monitor the sessions in a weblogic server
          at a point in time.
          Here is my situation:
          1. We are running a server clustered with three other weblogic server
          instances.
          2. My code looks like this:
          HttpSession ses = req.getSession(true);
          HttpSessionContext ctx = ses.getSessionContext();
          for(Enumeration e = ctx.getIds(); e.hasMoreElements();)
          String id = (String) e.nextElement();
          HttpSession curSession = ctx.getSession(id);
          if(curSession == null)
          System.out.println("AdminSessionServlet: Null session
          continue");
          continue;
          long creationL = curSession.getCreationTime();
          3. When I run this without clustering, it works great. I get a list of
          sessions, the creation time, last accessed time etc.
          4. When clustered, the curSession (from ctx.getSession(id)) always comes
          back as null.
          5. I did some poking around only to find that the id that I get looks like a
          long number (for example: -3435089287746960634 ).
          Has anybody run into such a problem? Any idea how I can get it to work?
          thanks,
          Srikanth Meenakshi
          [email protected]
          

I have to talk the relevant developer. I know exactly what's happening. Since
          JavaOne is going on, we are spending time at the conference. I will try to get
          back to you this week if not, it will be early next week.
          - Prasad
          Srikanth Meenakshi wrote:
          > Thanks for the reply.
          >
          > 1. I used the Servlet api from here:
          >
          > http://jserv.javasoft.com/products/java-server/documentation/webserver1.1/ap
          > idoc/javax.servlet.http.HttpSessionContext.html#_top_
          >
          > which did not say that the methods are deprecated. I did look at the latest
          > spec and they are deprecated. However, since the solution I have works in
          > non-clustered environment, I am wondering what I need to do to make it work
          > in a clustered environment.
          >
          > 2.
          >
          > >
          > > You are poking into internal stuff. I suggest you not to do that.
          >
          > The only poking around I did was to print out the id (String) that I
          > received from a public method in a public API. As in,
          >
          > for(Enumeration e = ctx.getIds(); e.hasMoreElements();)
          > {
          > String id = (String) e.nextElement();
          > System.out.println("the id is: " + id);
          > }
          >
          > Thanks,
          >
          > Srikanth
          >
          > "Prasad Peddada" <[email protected]> wrote in message
          > news:[email protected]...
          > > First of all you are using deprecated api method. Those methods will
          > return null
          > > in the near future.
          > >
          > > Srikanth Meenakshi wrote:
          > >
          > > > Hi
          > > >
          > > > I am trying to write a servlet to monitor the sessions in a weblogic
          > server
          > > > at a point in time.
          > > >
          > > > Here is my situation:
          > > >
          > > > 1. We are running a server clustered with three other weblogic server
          > > > instances.
          > > >
          > > > 2. My code looks like this:
          > > >
          > > > HttpSession ses = req.getSession(true);
          > > > HttpSessionContext ctx = ses.getSessionContext();
          > > >
          > > > for(Enumeration e = ctx.getIds(); e.hasMoreElements();)
          > > > {
          > > > String id = (String) e.nextElement();
          > > > HttpSession curSession = ctx.getSession(id);
          > > >
          > > > if(curSession == null)
          > > > {
          > > > System.out.println("AdminSessionServlet: Null
          > session
          > > > continue");
          > > > continue;
          > > > }
          > > > long creationL = curSession.getCreationTime();
          > > > .........
          > > > }
          > > >
          > > > 3. When I run this without clustering, it works great. I get a list of
          > > > sessions, the creation time, last accessed time etc.
          > > >
          > > > 4. When clustered, the curSession (from ctx.getSession(id)) always comes
          > > > back as null.
          > > >
          > > > 5. I did some poking around only to find that the id that I get looks
          > like a
          > > > long number (for example: -3435089287746960634 ).
          > >
          > > You are poking into internal stuff. I suggest you not to do that.
          > >
          > > - Prasad
          > >
          > >
          > > >
          > > > Has anybody run into such a problem? Any idea how I can get it to work?
          > > >
          > > > thanks,
          > > >
          > > > --
          > > >
          > > > Srikanth Meenakshi
          > > > [email protected]
          > >
          

Similar Messages

  • Servlet Session Monitoring via MBeans turns up no MBeans

    Hi,
    I discovered more about why I'm not seeing any Servlet Session Runtime
    MBeans when I enable session monitoring. It looks like each time my
    managed server creates a new session, two errors get written to my
    WebLogic log:
    "####<Sep 22, 2002 6:46:43 PM EDT> <Warning> <Dispatcher>
    <chile.iso-ne.com> <adminserver> <ExecuteThread: '7' for queue:
    '__weblogic_admin_rmi_queue'> <> <> <000000> <RuntimeException thrown
    by rmi server: 'weblogic.rmi.internal.BasicServerRef@10b - jvmid:
    '7074298665992588400S:10.145.220.82:[7001,7001,7002,7002,7001,7002,-1]:smsdomain:adminserver',
    oid: '267', implementation:
    'weblogic.management.internal.AdminMBeanHomeImpl@3c7b65''>
    weblogic.management.NoAccessRuntimeException: User guest does not have
    access permission on weblogic.admin.mbean.MBeanHome
    at weblogic.management.internal.Helper.checkAdminPermission(Helper.java:1637)
    and
    "####<Sep 22, 2002 6:46:43 PM EDT> <Error> <HTTP Session>
    <chile.iso-ne.com> <webuiserver> <ExecuteThread: '0' for queue:
    'default'> <> <> <100032> <Error creating servlet session runtime>
    weblogic.management.NoAccessRuntimeException: User guest does not have
    access permission on weblogic.admin.mbean.MBeanHome
    at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:136)
    at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
    at $Proxy7.getMBeanServer(Unknown Source)
    at weblogic.management.internal.MBeanHomeImpl.isAdminHome(MBeanHomeImpl.java:93)
    at weblogic.management.internal.MBeanHomeImpl.getMBean(MBeanHomeImpl.java:118)
    at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:590)
    at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:568)
    at weblogic.servlet.internal.session.SessionData$1.run(SessionData.java:185)
    at weblogic.management.internal.Helper.doLocally(Helper.java:1656)
    at weblogic.servlet.internal.session.SessionData.getRuntimeMBean(SessionData.java:179)
    at weblogic.servlet.internal.session.SessionData.<init>(SessionData.java:166)
    Looks like the managed server is making a request of the admin server
    and propagating the "guest" principal instead of "system".
    These principal propagation errors from managed-to-admin seem to
    happen all over the place with different MBeans, and get patched one
    place at a time in various BEA service packs. For instance, there's
    another issue with accessing the XML Entity Cache from a managed
    server, and I'm sure I've read about others. Isn't there a way to
    make sure these errors no longer occur with any MBean requests from
    the managed server?
    Jim

    Add
    acl.access.weblogic.admin.mbean.MBeanHome=guest
    in the filerealm.properties file.
    Jim Doyle wrote:
    Hi,
    I discovered more about why I'm not seeing any Servlet Session Runtime
    MBeans when I enable session monitoring. It looks like each time my
    managed server creates a new session, two errors get written to my
    WebLogic log:
    "####<Sep 22, 2002 6:46:43 PM EDT> <Warning> <Dispatcher>
    <chile.iso-ne.com> <adminserver> <ExecuteThread: '7' for queue:
    '__weblogic_admin_rmi_queue'> <> <> <000000> <RuntimeException thrown
    by rmi server: 'weblogic.rmi.internal.BasicServerRef@10b - jvmid:
    '7074298665992588400S:10.145.220.82:[7001,7001,7002,7002,7001,7002,-1]:smsdomain:adminserver',
    oid: '267', implementation:
    'weblogic.management.internal.AdminMBeanHomeImpl@3c7b65''>
    weblogic.management.NoAccessRuntimeException: User guest does not have
    access permission on weblogic.admin.mbean.MBeanHome
    at weblogic.management.internal.Helper.checkAdminPermission(Helper.java:1637)
    and
    "####<Sep 22, 2002 6:46:43 PM EDT> <Error> <HTTP Session>
    <chile.iso-ne.com> <webuiserver> <ExecuteThread: '0' for queue:
    'default'> <> <> <100032> <Error creating servlet session runtime>
    weblogic.management.NoAccessRuntimeException: User guest does not have
    access permission on weblogic.admin.mbean.MBeanHome
    at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:136)
    at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
    at $Proxy7.getMBeanServer(Unknown Source)
    at weblogic.management.internal.MBeanHomeImpl.isAdminHome(MBeanHomeImpl.java:93)
    at weblogic.management.internal.MBeanHomeImpl.getMBean(MBeanHomeImpl.java:118)
    at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:590)
    at weblogic.management.internal.MBeanHomeImpl.getRuntimeMBean(MBeanHomeImpl.java:568)
    at weblogic.servlet.internal.session.SessionData$1.run(SessionData.java:185)
    at weblogic.management.internal.Helper.doLocally(Helper.java:1656)
    at weblogic.servlet.internal.session.SessionData.getRuntimeMBean(SessionData.java:179)
    at weblogic.servlet.internal.session.SessionData.<init>(SessionData.java:166)
    Looks like the managed server is making a request of the admin server
    and propagating the "guest" principal instead of "system".
    These principal propagation errors from managed-to-admin seem to
    happen all over the place with different MBeans, and get patched one
    place at a time in various BEA service packs. For instance, there's
    another issue with accessing the XML Entity Cache from a managed
    server, and I'm sure I've read about others. Isn't there a way to
    make sure these errors no longer occur with any MBean requests from
    the managed server?
    Jim--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • What is the "Main Attribute" for in Session Monitoring?

    Anybody know what the "Main Attribute" column is for in session monitoring or how
    I can use it?
    Can't find it mentioned anywhere.

    Does this actually work in WLS 6.1 SP1 ? I have session
    monitoring enabled, have set the ConsoleMainAttribute to
    "username", and have actually set an attribute with that name
    to a string value in each session, but still get null returned
    from getMainAttribute() on ServletSessionRuntimeMBean. Any
    information, hints, advice, or vague prophecies on how to
    successfully use this API would be appreciated.
    --matt
    Mihir Kulkarni <[email protected]> wrote:
    The Main Attribute in the console is mapped to the ConsoleMainAttribute
    in the
    weblogic.xml file.
    This attribute specified as follows in the weblogic.xml:
    <session-param>
    <param-name>ConsoleMainAttribute</param-name>
    <param-value>mySession</param-value>
    </session-param>
    As per: http://e-docs.bea.com/wls/docs60/programming/weblogic_xml.html
    If you enable Session Monitoring in the WebLogic Server Administration
    Console, set
    this parameter to the name of the session parameter you will use to identify
    each
    session that is monitored.
    This parameter can only be a String in WLS 60. In 61, this parameter
    can be an Object
    and its toString method will be called to display its value.
    cheers,
    Mihir
    Steven Job wrote:
    Anybody know what the "Main Attribute" column is for in session monitoringor how
    I can use it?
    Can't find it mentioned anywhere.

  • How to Create a session in Servlet

    will somone show me the code to create a session in servlet?
    if a session can be created in servlet file, it can be used all the jsp files in a same web ?
    Thanks!!!

    Session in Java web application is started by the web server itself.
    In a servlet you can get the session by
    HttpSession session = request.getSession();
    It will return the current session associated with this request, or if the request does not have a session, creates one.

  • Session in servlet

    Good morning my dear friends
    can nay one explain y we are not using "new" operator to create a object for session in servlet ?

    Please take care, that the http protocoll is a stateless protocoll. Without special actions it is not possible to say that this request come from user x and so on.
    So you have to use a session.
    Create the SessionObject with the request object like this:
    HttpSession session = request.getSession(true);
    So, now you have a session. This session is identified by a cookie or with some additional work with the sessionid in the url.
    If you don't use persistent data you don't have to know which client make the request! Is you use it then store the data with the session object.
    If you really need to know the name from the client / user you have to make a login .
    I hope this help
    regards Dietmar

  • Session in Servlet and JSP

    Hi
    How do I maintain a session in the scenario below:
    (1) Servlet A creates a session
    (2) Servlet A dispatch JSP A
    (3) JSP A capture some user inputs and post to Servlet B
    So far both (1) and (2) are working fine, but to get on to (3) the session is lost upon reaching Servlet B
    Pls Advise...

    Hi mirage2000,
    You mean that when you are calling the Servlet B, the request object has no session inside it's a bit strange.
    Let's take the following example wich is quite simple:
    Servlet A:
    package servlet;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ServletA extends HttpServlet {
    public void init (ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    doPost(req, res);
    public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    String nomClient = "Toto";
    HttpSession session = null;
    try {
    session = req.getSession();
    req.setAttribute("servlet.a.nom", nomClient );
    getServletConfig().getServletContext().getRequestDispatcher("/jspa.jsp").forward(req, res);
    } catch (Exception e) {
    System.out.println("Pas cool !");
    JSP A:
    <%@ page import="java.util.*"%>
    <% String nom = (String)request.getAttribute("servlet.a.nom"); %>
    <HTML>
    <HEAD><TITLE>Age ?</TITLE></HEAD>
    <BODY>
    <BR>
    <BR>
    What is your age ?
    <BR>
    <FORM ACTION="../servlet/ServletB" METHOD="post">
    <INPUT TYPE="text" NAME="age" SIZE="3">
    <BR>
    <INPUT TYPE="submit" NAME="action" VALUE="SEND"> </FORM>
    </BODY>
    </HTML>
    Servlet B:
    package servlet;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ServletB extends HttpServlet {
    public void init (ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    doPost(req, res);
    public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    HttpSession session = null;
    PrintWriter out = res.getWriter();
    try {
    String action = req.getParameter("action");
    if (action.equals("SEND") ) {
    res.setContentType(CONTENT_TYPE);
    session = req.getSession();
    String age = (String)req.getParameter("age");
    String nomClient = (String)session.getAttribute("servlet.a.nom");
    out.println("<HTML><HEAD></HEAD><BODY>");
    out.println("Hello mister <B>" + nomClient + "</B>");
    out.println("<BR>You are <B>" + age + "</B> years old !!");
    out.println("</BODY></HTML>");
    out.flush();
    out.close();
    } catch (Exception e) {
    System.out.println("Pas cool !");
    This exemple is really simple and is working perfectly on my Apache Tomcat test server.
    Be more precise maybe you forgot to do some stuff.
    Regards
    Julien

  • 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.

  • Session Monitoring in AS Java Portal

    We require Logs and history of User logins with their respective IP
    addresses. Various forums talks about session monitoring in NWA but
    this tab is not visible in our installation.
    We are on NW7.0 SP17

    Hi Hussaini,
    I think session monitoring feature is available from NW 7.01 release. I am not sure for your version it is available or no.
    And in session management you can not see hostorical data.
    I think you can use different tools like wily  interscope for session monitoring.
    Thanks.
    Sushil

  • Missing dll in top sessions monitor..

    I installed OEM V9.0.1 on Win2K workstation. I am able to launch Enterprise manager console, access schema, etc,
    but when I click on TOP SESSIONS MONITOR (after entering the user id & password), i get the following error
    "the dynamic link library oravppdc.dll could not be found in the specified path"
    I have searched all the directories for this dll, but I am not able to find it. where can I find it ?
    thanks & regards

    Hello,
    Check SAP note 1145609 and see if it helps.
    Regards,
    David

  • Session Monitoring tool (Java)

    I made a session monitoring tool written in Java.
    Though it is very simple, it may be useful if you are looking for
    monitoring tools available on Linux platform.
    see http://www.bekkoame.ne.jp/~mei/oracle/ .
    null

    Hi,
    You could do from OAM or from 11g OEM (third part tools are also available, like TOAD).
    Enterprise Manager Documentation 11g Release 1 (11.1)
    http://download.oracle.com/docs/cd/E11857_01/index.htm
    Thanks,
    Hussein

  • Unable to find JPIP Session Monitor link in Strategy Management

    Dear Guru's,
    We installed CE 7.2 and SSM 7.5 recently and followed the standard configuration guide & completed.
    http://hostname.doimain.com:50000/strategy/tools/index.jsp
    In the above url, we're unable to find Version and JPIP Session Monitor link. Anyone guide me what has to be done to fix this issue.
    OS : Windows 2008 Enterprise
    DB : MS SQL 2008R2
    SAP : CE 7.2
    SSM : 7.5
    regards,
    Guna

    Guna,
    You want to make sure that you have applied the latest note for SSM 7.5 which is SP8. That is Note 1533787.
    When you install SSM you have an option of installing via CPIP rather than the JPIP. The JPIP installation is the default. If you did install the CPIP option, you wouldn't have the JPIP functions in tools.
    Please check to make sure that you are at the latest SP for 7.5 and installed the default JPIP path.
    Regards,
    Bob

  • MPE Utilization report vs In Session monitoring

    I have MPE 2.1.1.2. We have 25 voice ports and 20 Web ports. Today when I go look at the utilization report for voice it says 100% scheduled and 10% utilized. At the same time I look at the in session monitoring and count 15 ports in use for voice. Is there something I need to correct for reporting or is it broken? Thanks
    Donnie

    Hi Donnie,
    Just a thought here
    The Port Utilization report looks at this usage over a specified period of time
    (I believe the default is 9 hours) so over the 9 hours (in my example) the Voice
    Ports used vs scheduled average was 10%.
    The Session monitoring is a "real time" look at the port usage. When you checked
    the Ports being used were 15/25 but throughout the Reporting period that is referenced
    in the Port Utilization Report (above) this was not the case. You might want to tune the
    parameters for the start/end times in the Port Utilization Report to reflect the most
    accurate data.
    http://docwiki.cisco.com/wiki/Cisco_Unified_MeetingPlace_Express%2C_Release_2.x_--_About_This_Page:_Port_Utilization_Report#Output_of_the_Port_Utilization_Report
    Cheers!
    Rob

  • Session Monitoring using WLST commandLine interpreter

    How is it possible using WLST command line interpreter to get number of session on each managed server in a Cluster. I need the value of attribute "OpenSessionCurrentCount" of WebAppComponentRuntime MBean. But I am not able to navigate to this Bean.

    Hello,
    Can you let me know if you got to findout how to look for the attributes for Session monitoring through WLST like - OpenSessionCurrentCount. I am looking through teh WLSTAT tool through which we can get stats for transaction rate, OpenSocketsCurrentCount etc.,. Can you please mention to me to which tree I need to look for those stats in WLST.
    Thank you
    Ravi

  • Problem with Sessions in Servlets

    Hi,
    I'm having a problem with sesions with servlets. It seems that if someone logs into my website, which is running on all servlets, while another person is logged on, the second person gets the session of the first person.
    I'm using
    HttpSession session = request.getSession(true);to get the session in each page. The session contains a user object which shows if the user is logged in and what permissions.
    The session should be unique to the client computer right? Or am I jsut screwing this up big time?

    Yes, each client will have their own session. However, you may be testing incorrectly:
    In Firefox, for example, all instances of the application running on the same machine will share the same cookies, therefore the same session, and would be considered one client.
    MS IE will do the same if you use File - New to open a new wondow rather than clicking on the desktop icon.
    If the different clients are using different machines and still getting shared data, then you may be using class-level variables in the servlet, which would not be thread safe and could lead to your problems...
    public class MyServlet extends HttpServlet {
      String data;  //bad
      int moredata; //bad
      public void doGet(...) ... { ... }
    }

  • Monitoring servlets through SNMP Servlet Runtime Table

    Is it possible to check or monitor a servlet/jsp using SNMP traps (counter, attribute change, etc). If so can you provide a sample set up for values such as the MBean Name, MBean Type, MBean Attribute.
    Thanks,
    Juan

    Yes there is, monitor the gateway, not the CCM:
    http://cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a00801abe59.shtml

Maybe you are looking for

  • How do I untag a message in my inbox?

    I put a tag on a message in my incoming box and I want to take the tag off of it now but I cant get the tag off. How can I have it appear as it did when the email first came into my inbox?

  • OS cant find compiler??

    Downloaded Standard Edition jdk1.3.1 on my windows 98 system. I set the path on the Autoexec.bat screen to Set PATH= C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.3.1\bin set classpath=.;C:\classes when I open the bin directory I see the javac.exe file. But

  • Re :- What is the Importance of Group Currency

    My client maintained two company codes having different currencies. But they want to maintain reports only for local currency . In that case I am Activated Groups currencies for the both the company codes. It is correct or wrong.

  • Performance issue if we use jar file instead of classes

    Hi, My application uses tomcat as web server. If i use calsses in webapps -> WEB-INF -> classes folder, i place classes in that , In other case i use jar file and place that file in WEB-INF -> lib folder in the webapps directory. There is huge perfor

  • Thinkpad W530: None of the USB ports work when used with a 4338-35U replicator

    I have tried mouse. keyboard and a generic USB stick with a LED. None of the USB ports work on the replicator. Everything works fine when connected directly to the W530. The replicator ports must not have power because the LED doesn't come on.