Hi

should be fixed in tomorrow snapshot

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/7/27 zmirc <[email protected]>

> I encounter a similar error on 1.6.0 build 27.07. It does not always
> happen.
>
> I have a filter that redirects everything from /lm/* to /login-lm.xhtml if
> @SessionScoped UserSessionB does not have "authenticated" field true (see
> isAuthenticated()). This field is primitive (boolean not Boolean) and it's
> set when a user is logged in. As I can see, it's something wrong with
> @SessionScoped bean.
> This is running in production on 1.5.2 without errors.
>
> Filter code:
> @WebFilter(filterName = "Security")
> public class SecurityFilter implements Filter {
>
>     private static final Logger LOG =
> LoggerFactory.getLogger(SecurityFilter.class);
>     @Inject
>     UserSessionB usB;
>
>     @Override
>     public void doFilter(ServletRequest req, ServletResponse resp,
> FilterChain chain) throws IOException, ServletException {
>         if (!usB.isAuthenticated()) {
>             ((HttpServletResponse) resp).sendRedirect("/login-lm.xhtml");
>             LOG.debug("Access denied: {}", ((HttpServletRequest)
> req).getRequestURI().toString());
>         } else {
>             try {
>                 chain.doFilter(req, resp);
>             } catch (IOException | ServletException t) {
>                 LOG.error(null, t);
>             }
>         }
>     }
>
> //////////////////////////////////
> //////////////////////////////////
>
> Error:
> Jul 27, 2013 7:22:13 PM org.apache.openejb.cdi.CdiAppContextsService
> lazyStartSessionContext
> WARNING: Could NOT lazily initialize session context because of null
> RequestContext
> Jul 27, 2013 7:22:13 PM org.apache.openejb.server.httpd.EndWebBeansListener
> cleanupRequestThreadLocals
> SEVERE: WebBeans context with scope type annotation @SessionScoped does not
> exist within current thread
> javax.enterprise.context.ContextNotActiveException: WebBeans context with
> scope type annotation @SessionScoped does not exist within current thread
>         at
>
> org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:330)
>         at
>
> org.apache.tomee.catalina.cdi.SessionNormalScopeBeanHandler$UpdateInfo.session(SessionNormalScopeBeanHandler.java:111)
>         at
>
> org.apache.tomee.catalina.cdi.SessionNormalScopeBeanHandler$UpdateInfo.updateBean(SessionNormalScopeBeanHandler.java:92)
>         at
>
> org.apache.tomee.catalina.cdi.SessionNormalScopeBeanHandler$1$1.run(SessionNormalScopeBeanHandler.java:52)
>         at
>
> org.apache.openejb.server.httpd.EndWebBeansListener.cleanupRequestThreadLocals(EndWebBeansListener.java:88)
>         at
>
> org.apache.openejb.server.httpd.EndWebBeansListener.requestDestroyed(EndWebBeansListener.java:139)
>         at
>
> org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:6137)
>         at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:207)
>         at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
>         at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>         at
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
>         at
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>         at
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:722)
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-StandardSession-expire-tp4659384p4664402.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to