Session variable null in jsp after some hrs

Hi All,

I am facing problem with session variable in JSP. For 6/8 hours application is running fine then session variable on JSP become as null. Values of NAME_LIST are coming from database. When we are storing in DAO and Action we are getting NAME_LIST properly. But when control is forwarded to JSP, some how session variable become null and page shows blank. In console we are getting exception in JSP. Again if we restart OC4J then session is not null and I am getting all values in dropdown.

Even I tried to hardcode one name instead of displaying blank page by checking name_Lists==null still I am not getting drop down with "Name_1" after 6/8 hours. If we restart OC4J then I am not facing null problem for next 6/8 hrs.

I am using Struts 1.2.7, JDK 1.4.2 and Oracle 10g OC4J.

Please find below Code, which at start of JSP after Login into application.

<%System.out.println("#################### Before NAME_LIST Select #################");%>

<%

ArrayList name_Lists=(ArrayList)session.getAttribute("NAME_LIST");

if(name_Lists==null)

{

%>

<html:select style="width:180;" styleClass="text" property="listName" size="1">

<html:option value=""><bean:message key="N.select"/> </html:option>

<html:option value="1">Name_1</html:option>

</html:select>

<%

}

else

{%>

<html:select style="width:180;" styleClass="text" property="listName" size="1">

<%

for(int i=0;i<name_Lists.size();i++){

ArrayList name_Lists_1=(ArrayList)name_Lists.get(i);

System.out.println("#################### inside NAME_LIST #################"+(String)name_Lists_1.get(0)+(String)name_Lists_1.get(1));

%>

<html:option value="<%=(String)name_Lists_1.get(0) %>"><%=(String)name_Lists_1.get(1) %></html:option>

<%

}

%>

</html:select>

<%

}

%>

<%System.out.println("#################### After NAME_LIST Select ################");%>

Please send me Solution.

Thanks and Regards,

Kailas

[2142 byte] By [kkorea] at [2007-11-27 11:28:09]
# 1

Is that after 6/8 hours of use, or 6/8 hours of inactivity?

My guess would be session timeout.

evnafetsa at 2007-7-29 16:20:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

After login new session is starts. There is no problem inactive session

After login we just populate name list in one dropdown with other text boxes as blank. This drop down is at start of page. When we face error we got blank drop down and rest page as blank. No other text boxes appear on screen.

There is no invalidation of session varible or remove session attribute. The System works fine after restart of application OC4J and it excute else block.

We also done CPU Utilization and Memory issue on OC4J but ther is no problem in performance.

Kailas Kore

kkorea at 2007-7-29 16:20:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...