geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <xhh...@gmail.com>
Subject How to resolve the different thread is used for Tomcat context initialization ?
Date Wed, 19 Jan 2011 09:17:50 GMT
Hi,
>From Tomcat 7.0.6, a different thread is used for listener start, filter
start, and loadOnStartup, the purpose for that is for avoiding potential
memory leaking. But we got problems for OWB initialization, as we register a
OWB listener in the context. I am not sure whether this issue is a common
issue, but so far, I could only see that OWB is affected. Now, my idea is to
save the webbeans context in the servlet context, then attach it with the
thread in WebBeansConfigurationListener. Part of those codes are like :
--->
WebBeansContext oldWebBeansContext =
GeronimoSingletonService.contextEntered((WebBeansContext)event.getServletContext().getAttribute("org.apache.webbeans.config.WebBeansContext"));
        try {
            this.webBeansContext = WebBeansContext.getInstance();
            this.failoverService =
webBeansContext.getService(FailOverService.class);
            //                this.lifeCycle.startApplication(event);

event.getServletContext().setAttribute(OpenWebBeansConfiguration.PROPERTY_OWB_APPLICATION,
"true");
        } catch (Exception e) {
            logger.error(OWBLogConst.ERROR_0018,
event.getServletContext().getContextPath());
            WebBeansUtil.throwRuntimeExceptions(e);
        } finally {
            GeronimoSingletonService.contextExited(oldWebBeansContext);
        }
<---

Not sure that there is a common solution for it. Thoughts ?
Thanks.
-- 
Ivan

Mime
View raw message