How to display active Session ?

hi,
i would like to implement for an administrative usage, a jsp page that list all active session. I notice in the J2EE api that there's a HttpSessionListener interfaces wich enables listener to receive notification when creating and deleting session. Is it a good way to implement this functionnality, thanks in advance for your help.
PS : i am sure, others persons have already implement a solution, perhaps there is a Design Pattern for that.

Hi ,
Its really simple....
See the following code
public class SessionCounter implements HttpSessionListener {
int sessionCount = 0;
public void sessionCreated(HttpSessionEvent evt) {
sessionCount ++;
evt.getSession().setAttribute("Count", sessionCount);
public void sessionDestroyed(HttpSessionEvent evt) {
sessionCount --;
evt.getSession().setAttribute("Count", sessionCount);
now add this Listener to your web.xml
and you can get it anywhere (in jsp or servlet) using session.getAttribute("Count");
Is this you want.
Please let me know.
cheers
kuttus

Similar Messages

  • How to find active sessions count on a server in weblogic server console

    Hi All,
    I would like to know how to find active sessions count on a server in weblogic console. I am using weblogic 11g.
    Regards,
    Sunil.

    On the deployment, monitoring tab, you can select web applications. Here the number of current sessions are listed per web application deployed on the domain.
    The deployment itself (deployments, application, monitoring, sessions) shows a list of sessions and where it is located. Unfortunately, there is no aggregation (but that is something you can so yourself as well).
    When you are using a load balancer in front, the count of sessions on per web application on the domain gives you some clue how many sessions there are present on each server.
    That is to say, when load balancer is using round-robin (and does that correct), you can take the total number of sessions divide it by the number of servers.

  • How to get active session details

    Dear all
    in my application i want to display number of users online in a list and their details,for that how can i get the active session details in a jsp , or any other ways to do this.any suggestion regarding this is very much helpful to me. thanks in advance
    thanking u
    yours
    kumaran ramu

    Hi,
    You can use a Listener class for track the sessions and do some logic when a session is created/destroyed. See HttpSessionListener interface. You can save the session IDs and session objects when a session is created, for example in a hashmap. Save the hashmap in application context. In your JSP get the hashmap and get its key/values. See thread safe problems if you are using a hashmap in application context.

  • How to access "Active Sessions" using MBeans

    Hi all,
    I have deployed an application at EM (Enterprise Manager).
    when I logged into EM and click the application I can see the number of active sessions under "Servlets and JSPs" topic.
    how can I access that parameter at application level..??
    (I want to access that parameter *"x"* at my web application and display Logged in users : x )
    EM shows that the number of active sessions. it updates too.. so there must be some bean or record for that parameter..
    how can I access that....??
    Regards,
    Dinuka.

    You can use something like the following:
    package middleware.magic;
    import javax.management.MBeanServerConnection;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServiceURL;
    import javax.naming.Context;
    import java.io.IOException;
    import java.util.Hashtable;
    public class Browse {
        private String hostname = "172.31.0.106";
        private Integer port = 7001;
        private String username = "weblogic";
        private String password = "transfer11g";
        private String protocol = "t3";
        private String jndiRoot = "/jndi/";
        private String mBeanServer = "weblogic.management.mbeanservers.domainruntime";
        private String serviceName = "com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean";
        private JMXConnector connector;
        public static void main(String[] args) {
            Browse test = new Browse();
            try {
                MBeanServerConnection connection = test.getMBeanServerConnection();
                test.getSomeInformation(connection);
                test.closeJmxConnector();
            } catch (Exception e) {
                e.printStackTrace();
        public void getSomeInformation(MBeanServerConnection connection) throws Exception {
            ObjectName service = new ObjectName(serviceName);
            ObjectName[] serverRunTimes = (ObjectName[]) connection.getAttribute(service, "ServerRuntimes");
            for (int i = 0; i < serverRunTimes.length; i++) {
                String name = (String) connection.getAttribute(serverRunTimes, "Name");
    String version = (String) connection.getAttribute(serverRunTimes[i], "WeblogicVersion");
    String state = (String) connection.getAttribute(serverRunTimes[i], "State");
    System.out.println("Server name: " + name + ", Version: " + version + ", Server state: " + state);
    for (int i = 0; i < serverRunTimes.length; i++) {
    ObjectName[] applicationRuntimes = (ObjectName[]) connection.getAttribute(serverRunTimes[i], "ApplicationRuntimes");
    for (int j = 0; j < applicationRuntimes.length; j++) {
    String name = (String) connection.getAttribute(applicationRuntimes[j], "Name");
    ObjectName[] componentRuntimes = (ObjectName[]) connection.getAttribute(applicationRuntimes[j], "ComponentRuntimes");
    System.out.println("Application name: " + name);
    for (int k = 0; k < componentRuntimes.length; k++) {
    if (connection.getAttribute(componentRuntimes[k], "Type").equals("WebAppComponentRuntime")) {
    String componentName = (String) connection.getAttribute(componentRuntimes[k], "Name");
    Integer sessionsCurrent = (Integer) connection.getAttribute(componentRuntimes[k], "OpenSessionsCurrentCount");
    Integer sessionsHigh = (Integer) connection.getAttribute(componentRuntimes[k], "OpenSessionsHighCount");
    System.out.println(" - Component Name: " + componentName + ", Sessions Current: " + sessionsCurrent + ", Sessions High: " + sessionsHigh);
    public MBeanServerConnection getMBeanServerConnection() throws IOException {
    return getJmxConnector().getMBeanServerConnection();
    public JMXConnector getJmxConnector() throws IOException {
    JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, jndiRoot + mBeanServer);
    Hashtable hashtable = new Hashtable();
    hashtable.put(Context.SECURITY_PRINCIPAL, username);
    hashtable.put(Context.SECURITY_CREDENTIALS, password);
    hashtable.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
    connector = JMXConnectorFactory.connect(serviceURL, hashtable);
    return connector;
    public void closeJmxConnector() throws IOException {
    connector.close();
    Information regarding runtimeMBean can be found here: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/core/index.html.
    Open the tree Runtime MBeans, ServerRuntimeMBean and click attributes to see the available attributes (such as Name, WeblogicVersion, State etcetera).
    An example output of the program above:Server name: AdminServer, Version: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PDT 2009 1267925 , Server state: RUNNING
    Server name: soa_server1, Version: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PDT 2009 1267925 , Server state: RUNNING
    Application name: FMW Welcome Page Application_11.1.0.0.0
    - Component Name: AdminServer__11.1.0.0.0, Sessions Current: 0, Sessions High: 0
    Application name: Module-FMWDFW
    Application name: bea_wls_internal
    - Component Name: AdminServer_/bea_wls_internal, Sessions Current: 0, Sessions High: 0
    Application name: mds-soa
    Application name: bea_wls_deployment_internal
    - Component Name: AdminServer_/bea_wls_deployment_internal, Sessions Current: 0, Sessions High: 0
    Application name: wsil-wls
    - Component Name: AdminServer_/inspection.wsil, Sessions Current: 0, Sessions High: 0
    Application name: bea_wls_diagnostics
    - Component Name: AdminServer_/bea_wls_diagnostics, Sessions Current: 0, Sessions High: 0
    Application name: mejb
    Application name: bea_wls9_async_response
    - Component Name: AdminServer_/_async, Sessions Current: 0, Sessions High: 0
    Application name: uddiexplorer
    - Component Name: AdminServer_/uddiexplorer, Sessions Current: 0, Sessions High: 0
    Application name: mds-owsm
    Application name: bea_wls_management_internal2
    - Component Name: AdminServer_/bea_wls_management_internal2, Sessions Current: 0, Sessions High: 0
    Application name: consoleapp
    - Component Name: AdminServer_/console, Sessions Current: 0, Sessions High: 2
    - Component Name: AdminServer_/consolehelp, Sessions Current: 0, Sessions High: 1
    Application name: DMS Application_11.1.1.1.0
    - Component Name: AdminServer_/dms_11.1.1.1.0, Sessions Current: 0, Sessions High: 0
    Application name: em
    - Component Name: AdminServer_/em, Sessions Current: 0, Sessions High: 0
    Application name: uddi
    - Component Name: AdminServer_/uddi, Sessions Current: 0, Sessions High: 0
    Application name: MQSeriesAdapter
    Application name: OraSDPMDataSource
    Application name: JmsAdapter
    Application name: uddi
    - Component Name: soa_server1_/uddi, Sessions Current: 0, Sessions High: 0
    Application name: wsil-wls
    - Component Name: soa_server1_/inspection.wsil, Sessions Current: 0, Sessions High: 0
    Application name: SOAJMSModule
    Application name: DbAdapter
    Application name: bea_wls9_async_response
    - Component Name: soa_server1_/_async, Sessions Current: 0, Sessions High: 0
    Application name: composer
    - Component Name: soa_server1_/soa/composer, Sessions Current: 0, Sessions High: 0
    Application name: DMS Application_11.1.1.1.0
    - Component Name: soa_server1_/dms_11.1.1.1.0, Sessions Current: 0, Sessions High: 0
    Application name: Module-FMWDFW
    Application name: usermessagingdriver-email
    - Component Name: soa_server1_/sdpmessagingdriver/email-mbeanlifecycle, Sessions Current: 0, Sessions High: 0
    Application name: UMSJMSSystemResource
    Application name: AqAdapter
    Application name: FtpAdapter
    Application name: OracleBamAdapter
    Application name: SOADataSource
    Application name: usermessagingserver
    - Component Name: soa_server1_/sdpmessaging/mbeanlifecycle, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/sdpmessaging/parlayx, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/sdpmessaging/userprefs-ui, Sessions Current: 0, Sessions High: 0
    Application name: bea_wls_internal
    - Component Name: soa_server1_/bea_wls_internal, Sessions Current: 0, Sessions High: 0
    Application name: SocketAdapter
    Application name: SOALocalTxDataSource
    Application name: FileAdapter
    Application name: DefaultToDoTaskFlow
    - Component Name: soa_server1_/DefaultToDoTaskFlow, Sessions Current: 0, Sessions High: 0
    Application name: soa-infra
    - Component Name: soa_server1_/soa-infra, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/TaskService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/TaskMetadataService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/TaskQueryService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/TaskReportService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/IdentityService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/UserMetadataService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/RuntimeConfigService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/TaskEvidenceService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/CompositeMetadataService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/b2b, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/b2b, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/AGMetadataService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/AGQueryService, Sessions Current: 0, Sessions High: 0
    - Component Name: soa_server1_/integration/services/AGAdminService, Sessions Current: 0, Sessions High: 0
    Application name: wsm-pm
    - Component Name: soa_server1_/wsm-pm, Sessions Current: 0, Sessions High: 0
    Application name: mds-owsm
    Application name: b2bui
    - Component Name: soa_server1_/b2bconsole, Sessions Current: 0, Sessions High: 0
    Application name: bea_wls_diagnostics
    - Component Name: soa_server1_/bea_wls_diagnostics, Sessions Current: 0, Sessions High: 0
    Application name: bea_wls_cluster_internal
    - Component Name: soa_server1_/bea_wls_cluster_internal, Sessions Current: 0, Sessions High: 0
    Application name: EDNLocalTxDataSource
    Application name: EDNDataSource
    Application name: uddiexplorer
    - Component Name: soa_server1_/uddiexplorer, Sessions Current: 0, Sessions High: 0
    Application name: bea_wls_deployment_internal
    - Component Name: soa_server1_/bea_wls_deployment_internal, Sessions Current: 0, Sessions High: 0
    Application name: worklistapp
    - Component Name: soa_server1_/integration/worklistapp, Sessions Current: 0, Sessions High: 0
    Application name: mds-soa
    Application name: OracleAppsAdapter

  • Error when displaying Active Sessions - 500 Internal server error

    Hi all,
    recently I am getting errors when I want to look up the logged on users in our MII 12.0.2 system. The error displayed is
    500 - Internal server error
    Application error occurred during request processing
    Details:   java.util.ConcurrentModificationException: null
    Exception id: [0002556FD9C4003400000076000EA16A00045CFF57783831]
    Netweaver Log only displays the same error.
    Has anyone experienced this kind of error before? All other MII portal items work as usual, it is only "Active sessions" that brings up this error, I would say, 80% of the time I call it.
    This error occurs after a GoLive with more users and more traffic on the machine. Could it be some kind of memory problem? Reboot of the system does not help.
    Michael

    Perhaps the jsp page is not handling something properly - a special character in name or email perhaps?
    Have you tried something like: 
    "/XMII/Illuminator?Service=Admin&Mode=SessionList"
    or
    "/XMII/Illuminator?Service=Admin&Mode=SessionList&Content-Type=text/xml"
    These URL's should produce the desired dataset results - hopefully without the internal server error.
    Regards,
    Jeremy

  • How to monitor active sessions in a cluster

    Hi all,
    we currently test failover of our WLS 11g cluster.
    How can I see in the Console to which managed server a client is connected?
    Thank you in advance
    Regards
    Rolf

    today i found a way to get the name of the server in a cluster which handles the active session, using a managed bean in my application.
    There i added a getter method
    public String getServerName() {
    return System.getProperty("weblogic.Name");
    and then I used an af:outputText with
    #{<mybean>.serverName}
    See this blog entry http://theblasfrompas.blogspot.com/2009/05/adf-failover-within-weblogic-103.html
    Is there realy no way to get something like client-ip:<managed server> using WLS console?
    I only found the number of requests (which is incrementing after reloading the console) in Deployments-> <application> -> Monitoring - Workload
    Regards Rolf
    Best Regards

  • How to get active sessions in tomcat 5.0?

    Hi,
    As I am working on monitoring related requirement, I need to get no. Of active sessions,sessions created, etc.
    I found interesting code in ManagerServlet, As it has some protected methods, I cant call it from its object, I need to create servlet for my work, So I even can't extend ManagerServlet, So I've created one POJO for that, But now I need to populte the context and many other objects,
    Is there any other way out for this?,
    I really appriciate any kind of help. :-)
    -Jeff

    hi :-)
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
    or
    http://www.google.com.ph/search?hl=en&q=java+servlet+tutorial&btnG=Google+Search&meta=
    regards,

  • How to display Active URLs

    Hi ALL
    i have a table with a column that contains a url: #{row.taskUrl}. Its displayed as any string, how can i display it as an active URL?
    thanks

    thanks for your reply, actually i used the outputFormatted, and i concatenated the url with the Html <a> element and it worked:)

  • How to display active directory users through weblogic portal Application?

    Hi,
    Does anyone has faced this situation?
    I configured the activedirectory and able to see the users and group in the weblogic console at Security->Realms->Myrealm->users. when I run my portal application,I am able to see only the users that are configured in embedded weblogic LDAP ie, I can see only the users weblogic,portaladmin and yahooadmin that are of defaultauthenticator provider.I need to display the active directory users also in our portal.
    I have two doubts on this?
    1)Is it I need to write custom code to view the active directory users in our portal?
    2)Does I need to use any jars that supports active directory authenticator?
    I would appreciate if any one can reply on this with helpfull docs/information.
    We are using BEA 8.1 SP4.
    Windows 2000.
    Surendra

    Hi,
    I too have a similar kind of requirement, i use a jsp to do this activity, but i get an exception, i have shown the entire jsp code below,
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ page import="java.util.Set" %>
    <%@ page import="javax.naming.Context" %>
    <%@ page import="weblogic.jndi.Environment" %>
    <%@ page import="weblogic.management.MBeanHome" %>
    <%@ page import="weblogic.management.configuration.DomainMBean" %>
    <%@ page import="weblogic.management.configuration.SecurityConfigurationMBean" %>
    <%@ page import="weblogic.management.security.RealmMBean" %>
    <%@ page import="weblogic.management.security.authentication.AuthenticationProviderMBean" %>
    <%@ page import="weblogic.management.security.authentication.UserPasswordEditorMBean" %>
    <%@ page import="weblogic.security.providers.authentication.LDAPAuthenticatorMBean" %>
    <%@ page import="weblogic.management.configuration.EmbeddedLDAPMBean" %>
    <%@ page import="weblogic.management.security.authentication.UserEditorMBean" %>
    <%@ page import="weblogic.management.security.authentication.UserReaderMBean" %>
    <%@ page import="weblogic.management.security.authentication.GroupReaderMBean" %>
    <%@ page import="weblogic.management.utils.ListerMBean" %>
    <%@ page import="javax.management.MBeanException" %>
    <%@ page import="javax.management.modelmbean.RequiredModelMBean" %>
    <%@ page import="examples.security.providers.authentication.manageable.*" %>
    <%@ page import="weblogic.security.providers.authentication.ActiveDirectoryAuthenticatorMBean" %>
    <%@ page import="weblogic.management.utils.InvalidParameterException" %>
    <%@ page import="weblogic.management.utils.NotFoundException" %>
    <%@ page import="weblogic.security.SimpleCallbackHandler" %>
    <%@ page import="weblogic.servlet.security.ServletAuthentication"%>
    <%!
    private String makeErrorURL(HttpServletResponse response,
    String message)
    return response.encodeRedirectURL("welcome.jsp?errormsg=" + message);
    %>
    <html>
    <head>
    <title>Password Changed</title>
    </head>
    <body>
    <h1>Password Changed</h1>
    <%
    // Note that even though we are running as a privileged user,
    // response.getRemoteUser() still returns the user who authenticated.
    // weblogic.security.Security.getCurrentUser() will return the
    // run-as user.
    System.out.println("------------------------------------------------------------------");
    String username = request.getRemoteUser();
    System.out.println("User name -->"+username);
    // Get the arguments
    String currentpassword = request.getParameter("currentpassword");
    System.out.println("Current password -->"+currentpassword);
    String newpassword = request.getParameter("newpassword");
    System.out.println("New password -->"+newpassword);
    String confirmpassword = request.getParameter("confirmpassword");
    System.out.println("Confirm password -->"+confirmpassword);
    // Validate the arguments
    if (currentpassword == null || currentpassword.length() == 0 ||
    newpassword == null || newpassword.length() == 0 ||
    confirmpassword == null || confirmpassword.length() == 0) { 
    response.sendRedirect(makeErrorURL(response, "Password must not be null."));
    return;
    if (!newpassword.equals(confirmpassword)) {
    response.sendRedirect(makeErrorURL(response, "New passwords did not match."));
    return;
    if (username == null || username.length() == 0) {
    response.sendRedirect(makeErrorURL(response, "Username must not be null."));
    return;
    // First get the MBeanHome
    String url = request.getScheme() + "://" +
    request.getServerName() + ":" +
    request.getServerPort();
    System.out.println("URL -->"+url);
    Environment env = new Environment();
    env.setProviderUrl(url);
    Context ctx = env.getInitialContext();
    MBeanHome mbeanHome = (MBeanHome) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME);
    System.out.println("MBean home obtained....");
    DomainMBean domain = mbeanHome.getActiveDomain();
    SecurityConfigurationMBean secConf = domain.getSecurityConfiguration();
    // Sar
    EmbeddedLDAPMBean eldapBean = domain.getEmbeddedLDAP();
    System.out.println("Embedded LDAP Bean obtained...."+eldapBean );
    RealmMBean realm = secConf.findDefaultRealm();
    System.out.println("RealmMBean obtained....");
    AuthenticationProviderMBean authenticators[] = realm.getAuthenticationProviders();
    System.out.println("AuthProvMBean obtained....");
    // Now get the UserPasswordEditorMBean
    // This code will work with any configuration that has a
    // UserPasswordEditorMBean.
    // The default authenticator implements these interfaces
    // but other providers could work as well.
    // We try each one looking for the provider that knows about
    // this user.
    boolean changed=false;
    UserPasswordEditorMBean passwordEditorMBean = null;
    System.out.println("UserPwdEdtMBean obtained....");
    //System.out.println("Creating MSAI....");
    //ManageableSampleAuthenticatorImpl msai =
    // new ManageableSampleAuthenticatorImpl(new RequiredModelMBean());
    //System.out.println("Done....");
    for (int i=0; i<authenticators.length; i++) {
    System.out.println("### Authenticator --->"+authenticators);
    if (authenticators[i] instanceof ActiveDirectoryAuthenticatorMBean)
    ActiveDirectoryAuthenticatorMBean adamb =
    (ActiveDirectoryAuthenticatorMBean)authenticators[i];
    System.out.println("### ActiveDirectoryAuthenticatorMBean .....");
    String listers = adamb.listUsers("*",0);
    while(adamb.haveCurrent(listers))
    System.out.println("### ActiveDirectoryAuthenticatorMBean user advancement.....");
    adamb.advance(listers);
    if (authenticators[i] instanceof UserPasswordEditorMBean) {
    passwordEditorMBean = (UserPasswordEditorMBean) authenticators[i];
    System.out.println("Auth match ...."+passwordEditorMBean);
    try {
    // Now we change the password
    // Sar comment
    System.out.println("Password changed....");
    //passwordEditorMBean.changeUserPassword(username,
    // currentpassword, newpassword);
    changed=true;
    // Sar Comment
    catch (InvalidParameterException e) {
    response.sendRedirect(makeErrorURL(response, "Caught exception " + e));
    return;
    catch (NotFoundException e) {
    catch (Exception e) {
    response.sendRedirect(makeErrorURL(response, "Caught exception " + e));
    return;
    // Sar code
    LDAPAuthenticatorMBean ldapBean = null;
    UserReaderMBean urMBean = null;
    UserEditorMBean ueMBean = null;
    GroupReaderMBean gMBean = null;
    //ListerMBean lBean = null;
    try
    if (authenticators[i] instanceof LDAPAuthenticatorMBean)
    ldapBean = (LDAPAuthenticatorMBean) authenticators[i];
    String userFilter = ldapBean.getAllUsersFilter();
    System.out.println("userFilter ="+userFilter);
    if (authenticators[i] instanceof UserEditorMBean)
    try
    System.out.println("UserEditorMBean...");
    ueMBean = (UserEditorMBean) authenticators[i];
    System.out.println("List users..."+ueMBean);
    boolean b = ueMBean.userExists("webuser");
    System.out.println("User Exists->>>"+b);
    String cursor = ueMBean.listUsers("webuser", 2);
    System.out.println("List User ----->"+cursor);
    catch(InvalidParameterException e)
    response.sendRedirect(makeErrorURL(response, "ERROR InvalidParameterException:" + e));
    catch(java.lang.reflect.UndeclaredThrowableException e)
    response.sendRedirect(makeErrorURL(response, "ERROR UndeclaredThrowableException :" + e));
    e.printStackTrace();
    catch(Exception e)
    response.sendRedirect(makeErrorURL(response, "ERROR LBean:" + e));
    catch(Exception ex)
    ex.printStackTrace();
    response.sendRedirect(makeErrorURL(response, "ERROR:" + ex));
    return;
    if (passwordEditorMBean == null) {
    response.sendRedirect(makeErrorURL(response, "Internal error: Can't get UserPasswordEditorMBean."));
    return;
    System.out.println("pwd changed ->"+changed);
    if (!changed) {
    // This happens when the current user is not known to any providers
    // that implement UserPasswordEditorMBean
    response.sendRedirect(makeErrorURL(response,
    "No password editors know about user " + username + "."));
    return;
    %>
    User <%= username %>'s password has been changed!
    <br>
    <br>
    </body>
    </html>
    Here is the console log
    User name -->webuser
    Current password -->i
    New password -->u
    Confirm password -->u
    URL -->http://localhost:7011
    MBean home obtained....
    Embedded LDAP Bean obtained....[Caching Stub]Proxy for mydomain:Name=mydomain,Type=EmbeddedLDAP
    RealmMBean obtained....
    AuthProvMBean obtained....
    UserPwdEdtMBean obtained....
    ### Authenticator --->Security:Name=myrealmDefaultAuthenticator
    Auth match ....Security:Name=myrealmDefaultAuthenticator
    Password changed....
    UserEditorMBean...
    List users...Security:Name=myrealmDefaultAuthenticator
    User Exists->>>true
    java.lang.reflect.UndeclaredThrowableException
    at $Proxy1.listUsers(Unknown Source)
    at jsp_servlet.__updatepassword._jspService(__updatepassword.java:411)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.jav
    a:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC
    ontext.java:6718)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:37
    64)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: javax.management.MBeanException
    at weblogic.management.commo.CommoModelMBean.invoke(CommoModelMBean.java:551)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1560)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1528)
    at weblogic.management.internal.RemoteMBeanServerImpl.private_invoke(RemoteMBeanServerImpl.j
    ava:988)
    at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:946)
    at weblogic.management.commo.CommoProxy.invoke(CommoProxy.java:365)
    ... 14 more
    ### Authenticator --->Security:Name=myrealmDefaultIdentityAsserter
    pwd changed ->true
    Can u pls let me know how to get all the entries from LDAP.
    Thanx
    Sar

  • How to display current session parameter value

    Hi,
    How can a db user know value of a session parameter, if he doen't have privilege to access v$parameter?
    SQL> conn hr/hr
    Connected.
    SQL> show parameter QUERY_REWRITE_ENABLED
    ORA-00942: table or view does not exist
    SQL> alter session set QUERY_REWRITE_ENABLED=true ;
    Session altered.
    -- how can the user HR know the value of QUERY_REWRITE_ENABLED

    You can code a PL/SQL function and grant only execute privilege to the user:
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SQL> drop user admin cascade;
    User dropped.
    SQL> create user admin identified by admin;
    User created.
    SQL> grant create session, create procedure to admin;
    Grant succeeded.
    SQL> grant select on sys.v_$parameter to admin;
    Grant succeeded.
    SQL> connect admin/admin
    Connected.
    SQL> show user;
    USER is "ADMIN"
    SQL> create or replace function get_parm (p_pn in varchar2) return varchar2
      2  as
      3  l_val v$parameter.value%type;
      4  begin
      5   if ( UPPER(p_pn) = 'QUERY_REWRITE_ENABLED' )
      6   then
      7        execute immediate 'select value from v$parameter where name = :1 '
      8        into l_val using p_pn;
      9        return l_val;
    10   else
    11      raise_application_error(-20000,'Invalid parameter');
    12      return null;
    13   end if;
    14  end;
    15  /
    Function created.
    SQL> grant execute on get_parm to test;
    Grant succeeded.
    SQL> connect test/test
    Connected.
    SQL> show parameter query
    ORA-00942: table or view does not exist
    SQL> select admin.get_parm('query_rewrite_enabled') from dual;
    ADMIN.GET_PARM('QUERY_REWRITE_ENABLED')
    TRUE
    SQL> select admin.get_parm('compatible') from dual;
    select admin.get_parm('compatible') from dual
    ERROR at line 1:
    ORA-20000: Invalid parameter
    ORA-06512: at "ADMIN.GET_PARM", line 11

  • How to know active sessions logged in by same database users

    This is 10g. I need to query list of DB users who have logged in using the same database user accounts. How can I achieve this? This is on 10g and 9i

    Hello,
    You may enable audit. Then, with the following query you may get the list of User who logged on the same Oracle User account:
    select username, os_username, userhost, terminal, timestamp, action_name
    from dba_audit_trail
    where action_name in ('LOGON','LOGOFF')
    order by username;Please, find below a link about audit:
    http://www.oracle-base.com/articles/10g/Auditing_10gR2.php
    Hope this help.
    Best regards,
    Jean-Valentin

  • How can I find out if a user has an active session

    How can I find out if a user has an active session or sessionObject in the application Server.
    When a user logs on to my web-application, I want him to be able to see a
    list of all the other users that are also loged on. To do this I need to get a
    list of all the session objects avaliable in the sever at that perticular moment?
    In J2EE 2.1 I found the class "javax.servlet.http.HttpSessionContext" with the method "getIds()"
    that returned all the session Id's. By using the method getSession(java.lang.String sessionId)
    from the same class, you could then retrieve the sessionObject.
    But these methods are depricated (and want to be able to use the
    latest version of J2EE).
    Is there any other way to do this?
    I'm using JBoss application server.

    Check out HttpSessionListener -> http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html
    Essentially what you have to do is implement this interface. You also have to register the listener in your web.xml, like this:
    <listener>
        <listener-class>
            package.name.YourListener
        </listener-class>
    </listener>sessionCreated() will get called each time the app server creates a session and sessionDestroyed() will get called each time the app server invalidates a session. You could have a Map that contains all the active sessions, and a method for printing a list of all of the active sessions.

  • Counting how many active sessions in a webapp

    Hi folks,
    I was wondering if it is possible to count how many active sessions that there currently are in a webapp? I've looked at the ServletContext and ServletConfig classes, but I can't find anything. Any ideas?
    Cheers,
    Raj.

    HttpSessionListener was introduced in servlet spec 2.3 which is supported in Tomcat 4.0 but not 3.3.
    If upgrading to 4.0 is not an option, there is no elegant way to get what you need. There is no API call that returns all the active sessions so you must do it yourself. One way is to create a class that implements HttpSessionBindingListener to track your sessions. Instantiate it on start-up and add its reference as a session attribute when the session is first created. You can then update your custom session info in the valueBound and valueUnbound methods.

  • How to get all active session id's

    hai,
    i am new to servlet. i am tring to find out all active session id's for security perpose.
    and also i want to deactive a perticular session using that session id.
    but i don't know how to do. please help me.
    thanks in advance.

    Well to me.. I wud like to write a Listener class implementing HttpSessionListener in the following way....
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpSessionListener;
    import javax.servlet.http.HttpSessionEvent;
    import java.util.HashMap;
    public class SessionHandler implements HttpSessionListener{
    public static HashMap<String,HttpSession> SessionsMap = new HashMap<String,HttpSession>();
    public void sessionCreated(HttpSessionEvent se) {
    SessionsMap.put(se.getSession().getId(),se.getSession());
    public void sessionDestroyed(HttpSessionEvent se) {
    SessionMap.remove(se.getSession().getId());
    public static invalidateSession(String SessionId){
    HttpSession session =  SessionsMap.get(SessionId);
    SessionMap.remove(SessionId);
    session.invalidate();
    }Note:I'm assuming tht you are running the code on Jdk/jre 1.5+
    However, i think its more of core way of implementing this specially usage of static members howevr @ the given situation can very well cater your resources.added to it you add ActivationListener depending on your requirement.
    Hope this might help :)
    REGARDS,
    RaHuL

  • For active sessions error what can i do ..Install j2ee or sdm locally How ?

    Hi,
    Here many developers r working on Web DynPro Java. So when morethan one developers deploying application parallely at that time sdm gives error of active sessions, I found some threads told me that we had to install j2ee or sdm locally . But that threads could not ans satisfactory. Please any one tell me satisfactory ans what i need to install locally and how ?
    Regards,
    Gurprit Bhatia

    Hi,
      WAS Web Application Server has SAP J2EE Engine in which Web Dynpro Applications run. Software Deployment Manager(SDM) component manages deployment process.
    Once you deploy WAS locally, developer will have local server very similar to Tomcat kind... which you he/she can manage.
    Developer need to login to local server portal using http://server url:50000/irj/portal
    if u have any more doubts please let us know.

Maybe you are looking for

  • Error while running the trusted recon in GTC

    HI All, I tried running the trusted reconciliation scheduler for the GTC which uses database app table transport and format providers. While running the reconciliation the status of the schedule job is success but it is failing to generate the events

  • HP Officejet Pro 8500A Premium 910n wireless operation freezes while printing (and not)

    With a Linksys/Cisco E3000 wireless (encrypted) connection the HP OJ 8500A 919n will bluescreen (with a momentary error code) and crash (to a white screen with blinking lights) during printing and at random times. A (5 to 6 min) power off-on cycle is

  • How do I sum selected entries (currency) in one column based on criteria (specific text) set from a different column?

    Disclaimer:  I'm not a computer guy but I can be taught! I am tracking a checking account for a church ministry.  I have one table that holds the line items and the amounts budgeted for each item.  I want to add a column to that table that shows the

  • Quantity shipped on AR Invoice

    I have a client that is wanting to show quantity shipped on the a/r invoice PLD example: Sales UoM -  Qty Ordered - Qty Shipped - Total Units - Pricing Unit Sales UoM = Drum Qty Orderd = 1 Qty Shipped = 1 Total Unts = 55 Pricing Unit = GAL Where 1 dr

  • Planning Layout Function

    Hi Guys, In the Manual planning Layout selection, Is it possible to have a range selection as you have in BW User Entry Variable in queries?? Or have a default setting that uses the last used value in the selection field???? K