我在 Wildfly 9.0.2 上使用 Vaadin 7.5.8。在我们的应用程序中,我们需要 Push 支持,所以我添加了 maven 依赖项
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
并将 PushMode 参数添加到 servlet 初始化。
@WebServlet(value = {"/ui/*", "/VAADIN/*"}, asyncSupported = true, initParams = {
@WebInitParam(name = "UIProvider", value = "com.vaadin.cdi.CDIUIProvider"),
@WebInitParam(name = "pushmode", value = "automatic")})
在应用程序启动时,我将看到我们应用程序的登录页面。从这一点开始,导致服务器通信的每个操作都以以下错误结束:
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:330) ~[openwebbeans-impl-1.2.7.jar:1.2.7]
at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:88) ~[openwebbeans-impl-1.2.7.jar:1.2.7]
at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.get(NormalScopedBeanInterceptorHandler.java:70) ~[openwebbeans-impl-1.2.7.jar:1.2.7]
at com.vaadin.cdi.internal.BeanStoreContainer$$OwbNormalScopeProxy0.getUIBeanStore(com/vaadin/cdi/internal/BeanStoreContainer.java) ~[na:1.0.3]
at com.vaadin.cdi.internal.UIScopedContext.get(UIScopedContext.java:97) ~[vaadin-cdi-1.0.0.alpha2.jar:1.0.3]
at org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:754) ~[openwebbeans-impl-1.2.7.jar:1.2.7]
at org.apache.webbeans.inject.instance.InstanceImpl.get(InstanceImpl.java:139) ~[openwebbeans-impl-1.2.7.jar:1.2.7]
当我从 servlet 配置中删除 push 参数时,一切正常。我的推送配置有问题吗?