QM <mailto:[EMAIL PROTECTED]> wrote:
> On Sat, Jul 10, 2004 at 12:31:21PM -0700, Richard Mixon (qwest) wrote:
>> The "log" variable is initialized when the Action form is
>>   instantiated, like so: public class ChartWizardForm extends
>>       ActionForm implements java.io.Serializable { private transient
>> Log log =
>> LogFactory.getLog(ChartWizardForm.class);
>>       ...
>>
>> Obviously I'm missing something pretty basic. Is Tomcat re-using a
>> form instance across restarts? I've got pretty much default settings
>> in Tomcat:
>
> I notice, you define/initialize the instance variable "log" at its
> declaration point.
>
> Humor me: what happens if you initialize "log" in the ctor?
>
> -QM

I've had to look at higher priorities for a couple of days :)

Thanks for the idea. I changed as follows:
    ...
    // private transient Log log =
LogFactory.getLog(ChartWizardForm.class);
    private transient Log log; // Logging instance for this class
    ...

    public ChartWizardForm() {
        showInactive = false;
        altClassMeasOrder = false;
        ...
        outputFmt="";
        scaleFactor="";
        log = LogFactory.getLog(ChartWizardForm.class); // <-- ADDED
INITIALIZATION HERE
    }
    ...

But, still get the NPE :(

I'm defininig the instance variable as transient because Tomcat
complains about saving sessions that contain a private instance variable
(non-transient) of type Log. I was trying to get my sessions to persist
across restarts. Does that suggest anything?

Thank you again - Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to