Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.6.0
-
None
-
N/A I'm using TomEE 1.6.0 snapshot 2013-03-27
Description
To prevent this from showing in the log 'always', when/during/after session expiration, please see my code changes below. Look for 'PLEASE MODIFY BELOW, accordingly:' below. Thanks.
private Context lazyStartSessionContext() {
if (logger.isDebugEnabled())
{ logger.debug(">lazyStartSessionContext"); } Context webContext = null;
Context context = getCurrentContext(RequestScoped.class);
if (context instanceof ServletRequestContext) {
ServletRequestContext requestContext = (ServletRequestContext) context;
HttpServletRequest servletRequest = requestContext.getServletRequest();
if (null != servletRequest) { // this could be null if there is no active request context
try {
HttpSession currentSession = servletRequest.getSession();
initSessionContext(currentSession);
// if (failoverService != null && failoverService.isSupportFailOver())
//
if (logger.isDebugEnabled())
{ logger.debug("Lazy SESSION context initialization SUCCESS"); }} catch (Exception e)
{ logger.error(OWBLogConst.ERROR_0013, e); }} else {
PLEASE MODIFY BELOW, accordingly:
- if (logger.isDebugEnabled()) { * logger.warning("Could NOT lazily initialize session context because NO active request context"); * }
}
} else {
PLEASE MODIFY BELOW, accordingly:
- if (logger.isDebugEnabled()) { * logger.warning("Could NOT lazily initialize session context because of " + context + " RequestContext"); * }
}
if (logger.isDebugEnabled())
{ logger.debug("<lazyStartSessionContext " + webContext); } return webContext;
}