JSF: контекст webbeans с аннотацией типа области «@sessionscoped» не существует

#jsf #jsf-2.2 #apache-tomee

Вопрос:

Я пытаюсь развернуть приложение на основе EJB, JSF и гибернации на веб-сервере TomEE Plus.

В настоящее время тайм-аут сеанса установлен на 30 минут

Я получаю следующее исключение, когда пытаюсь получить доступ к приложению после 30 минут простоя

введите описание изображения здесь

в чем проблема и как ее решить?

Журнал приложений:

 DEBUG : 07.05.2021:1628 (43.737) [[]http-nio-8080-exec-3] AuthenticationFilter: uri...: /home/faces/orderableItems.xhtml
DEBUG : 07.05.2021:1628 (43.738) [[]http-nio-8080-exec-3] AuthenticationFilter: ...checking isTokenValid
DEBUG : 07.05.2021:1628 (43.739) [[]http-nio-8080-exec-3] AuthenticationFilter: .fetching token from cookie..length.4
DEBUG : 07.05.2021:1628 (43.739) [[]http-nio-8080-exec-3] AuthenticationFilter: isTokenValid fetched from cookie:.idToken
DEBUG : 07.05.2021:1628 (43.741) [[]http-nio-8080-exec-3] AuthenticationFilter: TOKEN is VALID
DEBUG : 07.05.2021:1628 (43.753) [[]http-nio-8080-exec-3] Logoff: IRBO Debug: Invalidating session.
DEBUG : 07.05.2021:1628 (43.763) [[]http-nio-8080-exec-3] Logoff: IRBO Debug: Session Invalidated.
DEBUG : 07.05.2021:1628 (43.809) [[]http-nio-8080-exec-3] AuthenticationFilter: EXITING......................
DEBUG : 07.05.2021:1629 (14.370) [[]http-nio-8080-exec-6] AuthenticationFilter: Session ID...: 12FD15A0FD37FCA7403F6550EEFB4021
DEBUG : 07.05.2021:1629 (14.449) [[]http-nio-8080-exec-6] AuthenticationFilter: uri...: /home/
DEBUG : 07.05.2021:1629 (14.499) [[]http-nio-8080-exec-6] AuthenticationFilter: ...checking isTokenValid
DEBUG : 07.05.2021:1629 (14.502) [[]http-nio-8080-exec-6] AuthenticationFilter: REDIRECTING........ to login page
DEBUG : 07.05.2021:1629 (14.518) [[]http-nio-8080-exec-6] AuthenticationFilter: EXITING......................
DEBUG : 07.05.2021:1629 (27.992) [[]http-nio-8080-exec-8] AuthenticationFilter: Session ID...: 12FD15A0FD37FCA7403F6550EEFB4021
DEBUG : 07.05.2021:1629 (27.996) [[]http-nio-8080-exec-8] AuthenticationFilter: uri...: /home/
DEBUG : 07.05.2021:1629 (27.996) [[]http-nio-8080-exec-8] AuthenticationFilter: ...checking isTokenValid
DEBUG : 07.05.2021:1629 (27.997) [[]http-nio-8080-exec-8] AuthenticationFilter: .fetching token from cookie..length.1
DEBUG : 07.05.2021:1629 (28.784) [[]Thread-22] ConfidentialClientApplication: [Correlation ID: 40eca6b3-9764-40f3-9cf9-3251fe8a838e] Access Token and Refresh Token were returned
DEBUG : 07.05.2021:1629 (28.790) [[]http-nio-8080-exec-8] AuthenticationFilter: token generated redirecting to redirectUrl........http://localhost:8080/home
DEBUG : 07.05.2021:1629 (28.790) [[]http-nio-8080-exec-8] AuthenticationFilter: EXITING......................
DEBUG : 07.05.2021:1629 (28.810) [[]http-nio-8080-exec-10] AuthenticationFilter: Session ID...: 12FD15A0FD37FCA7403F6550EEFB4021
DEBUG : 07.05.2021:1629 (28.813) [[]http-nio-8080-exec-10] AuthenticationFilter: uri...: /home/
DEBUG : 07.05.2021:1629 (28.814) [[]http-nio-8080-exec-10] AuthenticationFilter: ...checking isTokenValid
DEBUG : 07.05.2021:1629 (28.815) [[]http-nio-8080-exec-10] AuthenticationFilter: .fetching token from cookie..length.3
DEBUG : 07.05.2021:1629 (28.816) [[]http-nio-8080-exec-10] AuthenticationFilter: isTokenValid fetched from cookie:.idToken
DEBUG : 07.05.2021:1629 (28.818) [[]http-nio-8080-exec-10] AuthenticationFilter: TOKEN is VALID
ERROR : 07.05.2021:1629 (28.995) [[]http-nio-8080-exec-10] AuthenticationFilter: Authentication Filter Issue - WebBeans context with scope type annotation @SessionScoped does not exist within current thread
ERROR : 07.05.2021:1629 (29.000) [[]http-nio-8080-exec-10] AuthenticationFilter: Authentication Filter Issue - javax.servlet.ServletException: WebBeans context with scope type annotation @SessionScoped does not exist within current thread
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:236)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:350)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:226)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
        at java.lang.Thread.run(Thread.java:748)
Caused by: 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:329)
        at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:89)
        at org.apache.webbeans.intercept.SessionScopedBeanInterceptorHandler.getContextualInstance(SessionScopedBeanInterceptorHandler.java:76)
        at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.get(NormalScopedBeanInterceptorHandler.java:71)
        at org.apache.myfaces.cdi.view.ViewScopeBeanHolder$OwbNormalScopeProxy0.generateUniqueViewScopeId(org/apache/myfaces/cdi/view/ViewScopeBeanHolder.java)
        at org.apache.myfaces.cdi.impl.CDIManagedBeanHandlerImpl.generateViewScopeId(CDIManagedBeanHandlerImpl.java:92)
 

Комментарии:

1. Можете ли вы сообщить версию TomEE?