I've continued to isolate and have found that the session Bean that I'm supposed
to have is somehow lost. I added a finalizer method to the bean class. What I see
throgh my debugging is that I get the session bean instantiated. After getting to my
"failure" point, I get another session bean instantiated. I shut down the application
propoerly, which to me indicates that the session is still valid.
I look at the debugging console (from servletexec) and see that the 2nd session bean 
object
gets garbage collected. The 1st session bean obeject is never garbage collected.
What can cause such a behaviour? Shouldn't the bean object live until the session 
expires?

All JSP pages creates the bean as follows:

<jsp:useBean id="csrCollabSession" scope="session" 
class="com.upfront.htmlc.collab.CsrCollabSession"/>
<%
    CollabSubmitPage thisPage = csrCollabSession.guiEngine.framesetPage.messagePage;
    thisPage.processRequest(request);    OR OTHER METHOD/MEMBER VARIABLE ACCESSED
%>


The CsrCollabSession class looks like this:

package com.upfront.htmlc.collab;

import com.upfront.htmlc.*;
import com.upfront.htmlc.gui.*;
import com.upfront.htmlc.collab.gui.*;
import com.upfront.htmlc.es.*;
import com.upfront.generic.web.config.*;
import com.upfront.generic.web.debug.*;
import com.upfront.generic.util.misc.*;
import com.upfront.shared.*;
import java.awt.event.*;

public class CsrCollabSession{
    public CsrCollabController controller;
    public CsrCollabGuiEngine guiEngine;
    private boolean initialized = false;

    public CsrCollabSession(){
        init();
Debug.println("CsrCollabSession: " + this);
    }

    private void init(){
        if(!initialized){
            controller = new CsrCollabController();
            boolean isDebugActivated = 
ConfigUtil.root_config.getAsPrimBoolean("htmlc.system.debug");
            guiEngine = new CsrCollabGuiEngine( controller, 
ConfigUtil.root_config.getAsConfig("collab"), isDebugActivated);
            initialized = true;
Debug.println("CsrCollabSession::init");
        }
    }
    protected void finalize() {
        Debug.println("GARBAGE: " + this);
    }
}


/Peter

>  -----Original Message-----
> From:         Peter Claesson (EUS)
> Sent: Tuesday, February 12, 2002 12:31 PM
> To:   [EMAIL PROTECTED]
> Subject:      Object garbage collected
>
> Hi,
>
> I'm having a problem which I don't understand how it happens, nor do I know
> how to continue isolating it. Let me try to explain the problem.
>
> I have a customer application running in IE. I also have a call center application,
> an Windows MDC app with IE browser objects embedded. The two users
> of these applications communicate with each other.
>
> In the call center application my JSP web page contains a frameset. This frameset
> contains 2 frames, GUI and KERNEL as well as another frameset. The second
> frameset contains 2 frames, POLLER and MESSAGE. All of the frames contains
> a bean to an object A. Only these JSP pages has this object A reference, the server
> do not.
>
> The POLLER frame checks with the server every 3 seconds of there are any new
> messages to download. The response is a new POLLER page with potentially new
> javascript included.
>
> The GUI page stays constant and is only unloded when the call center agent closes
> the application.
>
> The KERNEL page stays loaded as long as the GUI page does.
>
> The MESSAGE page is for creating javascript message queues and stays loaded as
> long as the GUI page does.
>
> The problem I have is that at a certain point, the POLLER gets a new reference to
> object A. After that I start receiving nullpointers due to not properly initialized 
>variables.
>
> When I see this problem, I run Windows 2000, JDK 1.3.0.02, and ServletExec 3.1.
> The interesting part is that when I run JBuilder 4.0 with Tomcat I do not see this>
> problem!
>
> My debugging tools are limited when using IIS (compared to JBuilder). How can I
> trace or find out what's going on.
>
> I suspect that object A gets garbage collected. This would mean that somehow
> the beans in the 4 pages looses its reference, or...
>
> Any help is greatly appreciated.
>
> Peter

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to