Servlet session listener

Hello Forum members,
I want to delete a directory on my server after the session has expired. The session has the directory path that I want to delete. <listener>/<listener-class> in web.xml listens for the session expiry. I implemented the following code (session listener) to do the job. This works fine when I deploy on Weblogic App server but does'nt work if I delpoy it on to TOMCAT.
What I am doing is getting the path of the directory from the session using session listener sessionDestroyed(HttpSessionEvent se)
once the session has expired and delete it. Is this the right of doing this or is there any other method that I can use?
public void sessionDestroyed(HttpSessionEvent se) {
          HttpSession session;
          File path;
     System.out.println("enter the sessionDestroyed method");
          try{
     session = se.getSession();
               if ( session != null ){
if ( (String)session.getAttribute( FILES_DOWNLOAD_PATH_ATTRIBUTE) != null ){
                    path = new File((String)session.getAttribute( FILES_DOWNLOAD_PATH_ATTRIBUTE));
                    FileUtils.deleteFilesInThisDirectory(path);
                    FileUtils.deleteDirectory(path);
          }catch(Exception exception){
               System.out.println("some problem in DeleteOnExit.sessionDestroyed() " + exception.toString());
System.out.println("exit the sessionDestroyed method");

Hello Forum members,
I want to delete a directory on my server after the session has expired. The session has the directory path that I want to delete. <listener>/<listener-class> in web.xml listens for the session expiry. I implemented the following code (session listener) to do the job. This works fine when I deploy on Weblogic App server but does'nt work if I delpoy it on to TOMCAT.
What I am doing is getting the path of the directory from the session using session listener sessionDestroyed(HttpSessionEvent se)
once the session has expired and delete it. Is this the right way of doing this or is there any other method that I can use? Any help will be appreciated!!
public void sessionDestroyed(HttpSessionEvent se) {
HttpSession session;
File path;
System.out.println("enter the sessionDestroyed method");
try{
session = se.getSession();
if ( session != null ){
if ( (String)session.getAttribute( FILES_DOWNLOAD_PATH_ATTRIBUTE) != null ){
path = new File((String)session.getAttribute( FILES_DOWNLOAD_PATH_ATTRIBUTE));
FileUtils.deleteFilesInThisDirectory(path);
FileUtils.deleteDirectory(path);
}catch(Exception exception){
System.out.println("some problem in DeleteOnExit.sessionDestroyed() " + exception.toString());
System.out.println("exit the sessionDestroyed method");
Thanks

Similar Messages

  • How to implement session listener in RM

    Hi,
    In my repository manager, a connection to another system is established when a user tries to access the repository. Is there any way to implement a session listener, thereby terminating the sessions to another system when the EP user logs off?
    In our words, in Repository Manager, how can I know when an EP user clicks Log off?
    Thanks,
    Ray

    Or, how can I know when a user logs off EP in my repository manager?

  • Weblogic 8.1 SP2 + Struts + Internal Servlet Session Process Error Found!

    Hi,
              I have developed a struts 1.1 based webapplication which runs fine on
              weblogic 7 (for one year in production), tomcat 4.1,5 and others but
              refuses to function in weblogic 8.1 sp2!
              This is the stacktrace I get when I try to call an action via the browser:
              java.lang.IllegalStateException: Internal Servlet Session Process Error
              Found!
                   at
                   weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
                   at
                   weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
                   at
                   org.apache.struts.action.RequestProcessor.processLocale(RequestProcessor.java:638)
                   at
                   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
                   at
                   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
                   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
                   javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
                   weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
                   at
                   weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
                   at
                   weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
                   at
                   weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
                   at
                   weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
                   at
                   weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
                   at
                   weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
                   at
                   weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at
                   weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              Just out of curiosity I deployed the struts-examples webapplication from
              the apache jakarta struts distribution and it also fails to run with the
              same error!
              Can anybody help me out with this one? Does anybody experience the same
              thing?
              regards,
              oliver
              p.s. I will also post this message on the struts user list.
              

    Hi,
              I have developed a struts 1.1 based webapplication which runs fine on
              weblogic 7 (for one year in production), tomcat 4.1,5 and others but
              refuses to function in weblogic 8.1 sp2!
              This is the stacktrace I get when I try to call an action via the browser:
              java.lang.IllegalStateException: Internal Servlet Session Process Error
              Found!
                   at
                   weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
                   at
                   weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
                   at
                   org.apache.struts.action.RequestProcessor.processLocale(RequestProcessor.java:638)
                   at
                   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
                   at
                   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
                   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
                   javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
                   weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
                   at
                   weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
                   at
                   weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
                   at
                   weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
                   at
                   weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
                   at
                   weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
                   at
                   weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
                   at
                   weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at
                   weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              Just out of curiosity I deployed the struts-examples webapplication from
              the apache jakarta struts distribution and it also fails to run with the
              same error!
              Can anybody help me out with this one? Does anybody experience the same
              thing?
              regards,
              oliver
              p.s. I will also post this message on the struts user list.
              

  • Session Listener

    I have implemented the session listener from where I invoke a Facade. Every time I restart OC4J, I get an exception
    javax.naming.NamingException: Not in an application scope - start Orion with the -userThreads switch if using user-created threads
    at com.evermind.server.PreemptiveApplicationContext.getContext(PreemptiveApplicationContext.java:34)
    at com.evermind.naming.FilterContext.lookup(FilterContext.java:138)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at com.irrs.alpha.common.servicelocator.IRServiceLocator.getRemoteHome(IRServiceLocator.java:76)
    at com.irrs.alpha.config.IRLogoutHelper.sessionDestroyed(IRLogoutHelper.java:29)
    at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:502)
    at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:233)
    at com.evermind.server.http.HttpApplication.destroySessions(HttpApplication.java:5550)
    at com.evermind.server.http.HttpApplication.destroy(HttpApplication.java:5499)
    at com.evermind.server.http.HttpSite.destroy(HttpSite.java:834)
    at com.evermind.server.http.HttpServer.destroy(HttpServer.java:601)
    at com.evermind.server.ApplicationServer.destroy(ApplicationServer.java:1722)
    at com.evermind.server.ApplicationServerShutdownHandler.run(ApplicationServerShutdownHandler.java:39)
    at java.lang.Thread.run(Unknown Source)
    com.irrs.alpha.common.exception.IRException
    at com.irrs.alpha.common.servicelocator.IRServiceLocator.getRemoteHome(IRServiceLocator.java:81)
    at com.irrs.alpha.config.IRLogoutHelper.sessionDestroyed(IRLogoutHelper.java:29)
    at com.evermind.server.http.HttpApplication.invalidateSession(HttpApplication.java:502)
    at com.evermind.server.http.EvermindHttpSession.invalidate(EvermindHttpSession.java:233)
    at com.evermind.server.http.HttpApplication.destroySessions(HttpApplication.java:5550)
    at com.evermind.server.http.HttpApplication.destroy(HttpApplication.java:5499)
    at com.evermind.server.http.HttpSite.destroy(HttpSite.java:834)
    at com.evermind.server.http.HttpServer.destroy(HttpServer.java:601)
    at com.evermind.server.ApplicationServer.destroy(ApplicationServer.java:1722)
    at com.evermind.server.ApplicationServerShutdownHandler.run(ApplicationServerShutdownHandler.java:39)
    at java.lang.Thread.run(Unknown Source)
    Because of this some information that needs to be redeemed keeps hanging and some vital data goes stale. Any help?????

    Gedomir,
    Thanks for the reply. But unfortunately it did not work. I was using the default initial context. I tried setting the properties as well. Even then it did not work.
    I am trying this with oc4j_extended.
    Thanks again.

  • Get Http Request in Session Listener?

    Is it possible get Http Request in Session Listener when session is created? I need to get cookies when session is created.
    anyone knows?

    No, it is not possible.

  • Servlet Session Object

              I need to get the lastAccessTime of the servlet which I have deployed on Weblogic
              7.0.
              I have found that by using ServletSessionRuntimeMBean interface which has a method
              called getTimeLastAccessed, I can get the same.
              I am not able to get the same. Can any one sujject the way I have to go for this.
              

    Hello Linus,
    Actually, you would want to retrieve the necessary objects from your servlet context
    and then pass them along to your session EJBs. It's not necessary to pass the
    entire ServletContext object to your session bean. You should wrap the values
    in DTOs (Data Transfer Objects / Value Objects) and pass them along to your session
    beans. Also, it's not good to couple your EJBs with Servlets, as they may be eventually
    accessed from standalone clients in the future. For more information on this design
    pattern, please see the following link:
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Linus Nikander" <[email protected]> wrote:
    Is it possible to accesss objects stored in a Servlet session context
    from
    an EJB ? If so, how ?
    //Linus Nikander - [email protected]

  • IllegalStateException: Internal Servlet Session Process Error Found!

              I keep getting the annoying error as listed, and the server also keeps reporting
              that I can only connect from 0 unique ip addresses. Has anybody else seen these
              type of frustrations on 8.1 sp2, or can explain them.
              With as much detail omitted for simplicity;
              Frustration 1.
              I have a 8sp2 server running all ok, occasionally after a redeploy of an ear file
              I attempt to load a jsp file, and the error below is thrown.
              The JSP has a bean which is session based, and as from following the stack trace
              it is around some weblogic code which tests if my license allows access to the
              http session (on a developer license). I then have to start another server instance
              and do a deployment of a v.simple war, and access this, then deploy the same war
              to the broken server and access that, then the initial jsp works fine. no code
              changes just environment stops, starts and redeploys!
              Frustration 2
              Server runs ok, tray and connect from two machines (I have an ldap server that
              wants to 'broadcast' messages to my server), error of too many connections.
              The ip connection issues can in most cases be removed with a server restart.
              EXCEPTION TRACE
              java.lang.IllegalStateException: Internal Servlet Session Process Error Found!
              With the following stack trace:
              java.lang.IllegalStateException: Internal Servlet Session Process Error Found!
                   at weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
                   at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
                   at jsp_servlet._security.__changeprofile._jspService(__changeprofile.java:135)
                   at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
                   at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
                   at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
                   at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
                   at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              

              I have the same problem. Could any one help us?
              "David" <[email protected]> wrote:
              >
              >I keep getting the annoying error as listed, and the server also keeps
              >reporting
              >that I can only connect from 0 unique ip addresses. Has anybody else
              >seen these
              >type of frustrations on 8.1 sp2, or can explain them.
              >
              >With as much detail omitted for simplicity;
              >
              >Frustration 1.
              >I have a 8sp2 server running all ok, occasionally after a redeploy of
              >an ear file
              >I attempt to load a jsp file, and the error below is thrown.
              >
              >The JSP has a bean which is session based, and as from following the
              >stack trace
              >it is around some weblogic code which tests if my license allows access
              >to the
              >http session (on a developer license). I then have to start another
              >server instance
              >and do a deployment of a v.simple war, and access this, then deploy the
              >same war
              >to the broken server and access that, then the initial jsp works fine.
              > no code
              >changes just environment stops, starts and redeploys!
              >
              >Frustration 2
              >Server runs ok, tray and connect from two machines (I have an ldap server
              >that
              >wants to 'broadcast' messages to my server), error of too many connections.
              >The ip connection issues can in most cases be removed with a server restart.
              >
              >
              >EXCEPTION TRACE
              >
              >java.lang.IllegalStateException: Internal Servlet Session Process Error
              >Found!
              >
              >With the following stack trace:
              >
              >java.lang.IllegalStateException: Internal Servlet Session Process Error
              >Found!
              >     at weblogic.servlet.internal.session.SessionData.checkProcess(SessionData.java:1148)
              >     at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:501)
              >     at jsp_servlet._security.__changeprofile._jspService(__changeprofile.java:135)
              >     at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
              >     at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
              >     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
              >     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)
              >     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
              >     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
              >     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
              >     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
              >     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
              >     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
              >     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
              >     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              >
              >
              

  • Session listener runs twice

    Hi!
    I have a session listener object in a Tomcat 5.0.19 container, which has the following simple method:
    public void sessionDestroyed(HttpSessionEvent e) {
    System.out.print("Session destroyed: ");
    System.out.println(e.getSession().getId());
    My problem is, that this method is called two times after every session is destroyed. The other, sessionCreated() method runs only one time.
    Can anybody help me?
    Thank you in advance!
    Tomasits �kos.

    For any Tomcat related questions/bugs, please use one of the following options:
    - File a bug at http://nagoya.apache.org/bugzilla/
    - Send email to [email protected]
    - Send email to [email protected]
    Thanks!
    Jan

  • Servlet Sessions+dont have a clue

    im trying to get a servlet session goin for a college project,i know its hard to help someone on this but please try this is driving me mad,,,
    im useless at java so i have just being piecing together other peoples code and trying to get it working,
    Iam trying to accept a username and password for the Oracle database and then put the resulting database connection into a session variable...
    here is my useless code,,,please help....the only error iam getting is to do with the PrintWriter,,,
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    // You need to import the java.sql package to use JDBC
    import java.sql.*;
    public class LoginServlet1 extends HttpServlet
    private Connection con=null;
    public LoginServlet1(Connection con){
    this.con=con;
    public Connection getConnection(){
    return con;
    public void doGet(HttpServletRequest request,HttpServletResponse response)
              PrintWriter writer = response.getWriter();
              HttpSession session = request.getSession(true);
              String username = null;
              String password = null;
              String strHTML = "";
              boolean success = false;
                   if (((username==null) || (username.compareTo("")==0)))
                        strHTML = strHTML + "<title> Lab #11 Login Error </title>";
                        strHTML = strHTML + "</head>";
                        strHTML = strHTML + "<body bgcolor=white>";
                        strHTML = strHTML + "Massive Error --- you need to provide a username ...please try again ...<BR><BR>";
                        strHTML = strHTML + "Back to the login page ..<A HREF=\"../login.html\"> click here </A>";
                        strHTML = strHTML + "</body>";
                        strHTML = strHTML + "</html>";
                        success = false;
                   else if (((password==null) || (password.compareTo("")==0)))
                        strHTML = strHTML + "<title> Lab #11 Login Error </title>";
                        strHTML = strHTML + "</head>";
                        strHTML = strHTML + "<body bgcolor=white>";
                        strHTML = strHTML + "Massive Error --- you need to provide a password ... please try again ...<BR><BR>";
                        strHTML = strHTML + "Back to the login page ...<A HREF=\"../login.html\"> click here </A>";
                        strHTML = strHTML + "</body>";
                        strHTML = strHTML + "</html>";
                        success = false;
                   else
                   try
                             // Load Oracle driver
                             DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                             LoginServlet1 holder=(LoginServlet1) session.getValue("servletapp.connection");
                             if(holder==null){
                             try{
                             holder= new LoginServlet1(DriverManager.getConnection("jdbc:oracle:thin:@macha.wit.ie:1521:MACH"));
                             session.putValue("servletapp.connection",holder);
                             catch(SQLException e){
                             getServletContext().log(e, "No");
                             success= true;
                        catch (SQLException sqlex)
                             strHTML = strHTML + "connection failed ....<BR>";
                             if (sqlex.getErrorCode()==1017)
                                  strHTML = strHTML + "OUPS !!! wrong username or password lads ...please try again ...<BR><BR>";
                             else
                                  strHTML = strHTML + "SQL Error happened ....<BR>";
                                  strHTML = strHTML + "Error Number = " sqlex.getErrorCode() "<BR>";
                                  strHTML = strHTML + "Error Message = " + sqlex.getMessage() + "<BR>";
                                  strHTML = strHTML + "ah common cheer up, it's not the end of the world...<BR>";
                             strHTML = strHTML + "Back to the login page<A HREF=\"../login.html\"> click here </A>";
                             success = false;
                        if (success)
                             try
                             getServletConfig().getServletContext().getRequestDispatcher("/WEB-INF/jsp/query.jsp").forward(request,response);
                             catch (Exception ex) {
              ex.printStackTrace ();

    back again,,
    the code above is causing the following error when i try to run it,,
    Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    the error goes on to give a very long list of exceptions and root causes,there is nothing wrong with Tomcat because i can run the other version of this program that doesnt have any sessions is it,,,
    thanks

  • How to share objects between two ADF Faces servlet sessions

    I gather the application scope is one way to go for sharing data between sessions in an ADF application. Are there other more generic methods of sharing data between servlet sessions?
    For example, let's say we have a JDev 101.3 ADFBC/JSF app. (or JDev 11g for that matter). In this app we also register a servlet in web.xml. So two people log into this application and access this defined servlet, creating two instances of that servlet...I guess. Is there a way for those two instances/sessions to talk to each other? Pass data back and forth? Should I read about JMS? Or does application scope sound better? I guess a direct communication would be more tidy, than putting data on an application bulletin board, lilke application scope.
    Any thoughts?

    Hi,
    Only one instance of each servlet defined in web.xml gets created, not one per user. You're right about the sessions though, one per user is created. You're right on the other parts as well I think you could use application scope to do something like that, or the data base for that matter, depending on the use case.
    Regards,
    ~ Simon

  • 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

  • Get the Web users Clipboard text in Servlet session

    We have a small web application � uses JSPs , Servlets and runs on Tomcat Server.
    We are trying to get the end web user�s ( browsers ) Clipboards copied text in our Servlets session.
    We know there is some AWT API to get the Clipboards copied data.
    java.awt.datatransfer.Clipboard clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
    // Get data from clipboard
    java.awt.datatransfer.Transferable clipData = clipboard.getContents(clipboard);
    But if we use this piece of code in our servlet session, we always get the Clipboard text, which is copied on the Server. Not at the users / browsers.
    So, we wonder are there any ways or similar to get the Users clipboard text in that users session.
    Any help would be great.

    Its the same old story.
    Java code is only running on the server.
    At the client end all you can work with is HTML and javascript.
    With Internet explorer you can access clipboard data:
    http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/clipboarddata.asp?frame=true
    Grab it with javascript, put it into a hidden field, and submit the page.
    That will pass it as a request parameter to your jsp/servlet, and you can get at it that way.

  • Servlet session problem

    hi all,
    I am new to servlet. i have creted a server program and many user can login using thier username ,role and password. if more than one user can login simultaneously i could nt able to mainatin the session, it always showing the last login datas to all users(who'slogin earlier). how do i solve this and please any one explain me with some example?
    regards
    sm

    if more than one user can login simultaneously i could nt able to mainatin the session, it always showing the last login datas to all users(who'slogin earlier). Do you mean to say different users logging into the system using same browser window?
    how do i solve thisThis is more about what do you want to do? One solution might be :- if the user authentication succeeds, add a logic that will invalidate the previous session and create a new session for this new user.

  • Passing objects to a servlet - session or as byte[]

    Hi
    I'm creating my first servlet and I want opinions on my design. I plan to sue my servlet to generate an image. So in my jsp page I have an image tag with the following
    <img src="/Servlet/GenerateImage">But my servlet requires data in an ArrayList from my JSP page. How can I pass the ArrayList to my servlet? I've done some research and been looking aorund the forums, and I noticed people either convert the object to byte[] or pass the object using the session. I've tried doing the byte[] method but I don't know how to pass the byte[] to my servlet. I tried passing it as a parameter using a query string, get the parameter as a string, and convert it to byte[] again, but it didn't work. I can't seem to get this approach to work.
    I'm worried that if I use the session, and a large number of people access my page which runs the servlet, my server will be bogged down.
    What is the best approach in doing this? It'd be great if some sample code or links are supplied
    Thanks for all the help!

    My servlet requires data in an ArrayList from my
    JSP page. How can I pass the ArrayList to my servlet?
    I've done some research and been looking aorund the
    forums, and I noticed people either convert the object
    to byte[] or pass the object using the session. If the ArrayList is derived in the JSP and is required in the servlet, then saving it as a session attribute is the best bet. I guess it would be possible to send all the data from the ArrayList to the client in a cookie, but that seems messy and inefficient.
    I'm worried that if I use the session, and a large
    number of people access my page which runs the
    servlet, my server will be bogged down.The session attribute only contains a reference to the ArrayList and so in itself does not cause a performance problem. If you're concerned that the ArrayList is very large, you could consider saving the info to a disk file. Alternatively, could the ArrayList be derived in the servlet instead of, or as well as, the JSP? Does the servlet need all the Arraylist entries, or just a subset? If a subset, save that as a session attribute and dereference the ArrayList in the JSP. Also, think about when the ArrayList reference can safely be removed from the session.
    What is the best approach in doing this? It'd be great
    if some sample code or links are suppliedJSP
    <jsp:useBean id="myArrayList" class="java.util.ArrayList" scope="session"/>Servlet
    HttpSession session = request.getSession();
    ArrayList al = (ArrayList) session.getAttribute("myArrayList");
    .

  • Servlet session managment

    Hi
    I am trying to set object in session
    first I set object in session in first servlet as session.setAttribute("name"object);
    this session obj can retrive in jsp page
    I make one link <a href="abc which call another servlet
    I want this session object can retrive in that servlet but this get null
    How yo solve this problem

    Are both the servlets in the same web app?
    Your session cannot be accessed across multiple webapps

Maybe you are looking for

  • Ipod classic from 2005 will not conect to my macbook pro itunes

    I have an older Ipod that I haven't used in a few years. I tryed conected it to Itunes on my Macbook pro and I get nothing. I last used it with my old computer that used windows xp. I tryed using 4 different cables from my iphone and ipod touch. stil

  • Problem syncing iTunes app and Music app

    I recently purchsed my iphone 4s, I have synced the ipone and my pc with the intent to transfer my music.  The music shows up in the purchased section of my itunes app, but when I open my music app it says there is no content.  How do I sync the 2?

  • How do I attach file into reply existing email?

    How do I attach file into reply existing email?

  • Read write control on status

    Dear All, I have a problem. Look at the senario, i have a table ATTENDANCE_HEADER in which there is a column STATUS, there is another table ATTENDANCE_DETAILS. entry to the ATTENDANCE_HEADER table is automatic by using schedules setting the STATUS co

  • Can't install Studio 8

    Hi, my mac is running wonderful with a Sonnet 1,4 GHz-CPU: Computername: Power Mac G4 Computermodell: PowerMac3,4 CPU-Typ: PowerPC G4 (3.3) Anzahl der CPUs: 1 CPU-Geschwindigkeit: 1.4 GHz L2-Cache (pro CPU): 256 KB L3-Cache (pro CPU): 2 MB Speicher: