首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Vaadin + CDI + Push (大气)无效

Vaadin + CDI + Push (大气)无效
EN

Stack Overflow用户
提问于 2015-03-10 15:01:19
回答 1查看 1.5K关注 0票数 4

我有一个Java 7应用程序,它使用vaadin和vaadin组件。

没有vaadin推送,这是我的配置:

代码语言:javascript
运行
复制
// the Servlet
@WebServlet(value = "/*", asyncSupported = true)
public class MyServlet extends VaadinCDIServlet {
    @Override
    protected void servletInitialized() throws ServletException {
        super.servletInitialized();
    }
}
// ... Then I have a @CDIUI anotated class.

在这里,所有操作都很好,直到我将@Push添加到我的@CDIUI分析类并在类路径中添加了vaadin-push组件。

代码语言:javascript
运行
复制
<dependency org="com.vaadin" name="vaadin-push" rev="&vaadin.version;" />

然后,我在试图访问我的应用程序的通配符中得到了这个错误。

代码语言:javascript
运行
复制
11:38:46,738 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 7771ms - Started 464 of 511 services (92 services are lazy, passive or on-demand)
11:38:53,423 WARNING [com.vaadin.server.DefaultDeploymentConfiguration] (default task-2) 
=================================================================
Vaadin is running in DEBUG MODE.
Add productionMode=true to web.xml to disable debug features.
To show debug window, add ?debug to your application URL.
=================================================================
11:38:53,461 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Installed AtmosphereHandler com.vaadin.server.communication.PushHandler$1 mapped to context-path: /*
11:38:53,461 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.server.communication.PushHandler$1
11:38:53,463 INFO  [org.atmosphere.util.IOUtils] (default task-2) META-INF/services/org.atmosphere.cpr.AtmosphereFramework not found in class loader
11:38:53,465 WARNING [org.atmosphere.cpr.AtmosphereFramework] (default task-2) SessionSupport error. Make sure you define org.atmosphere.cpr.SessionSupport as a listener in web.xml instead
11:38:53,477 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Atmosphere is using org.atmosphere.util.VoidAnnotationProcessor for processing annotation
11:38:53,487 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Auto detecting WebSocketHandler in /WEB-INF/classes/
11:38:53,494 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
11:38:53,500 INFO  [org.atmosphere.container.JSR356AsyncSupport] (default task-2) JSR 356 Mapping path /{path}
11:38:53,503 INFO  [io.undertow.websockets.jsr] (default task-2) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /{path}
11:38:53,506 INFO  [io.undertow.websockets.jsr] (default task-2) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /{path}/{path0}
11:38:53,506 INFO  [io.undertow.websockets.jsr] (default task-2) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /{path}/{path0}/{path1}
11:38:53,507 INFO  [io.undertow.websockets.jsr] (default task-2) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /{path}/{path0}/{path1}/{path2}
11:38:53,507 INFO  [io.undertow.websockets.jsr] (default task-2) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /{path}/{path0}/{path1}/{path2}/{path3}
11:38:53,507 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Installing Default AtmosphereInterceptor
11:38:53,507 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
11:38:53,508 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
11:38:53,508 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
11:38:53,509 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
11:38:53,509 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Dropping Interceptor org.atmosphere.interceptor.HeartbeatInterceptor
11:38:53,510 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
11:38:53,510 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
11:38:53,511 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
11:38:53,511 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
11:38:53,512 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
11:38:53,512 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2)    org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
11:38:53,512 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
11:38:53,515 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
11:38:53,515 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
11:38:53,515 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
11:38:53,515 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Broadcaster Polling Wait Time 100
11:38:53,515 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Shared ExecutorService supported: true
11:38:53,515 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Messaging Thread Pool Size: Unlimited
11:38:53,516 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Async I/O Thread Pool Size: 200
11:38:53,516 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
11:38:53,516 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
11:38:53,519 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Invoke AtmosphereInterceptor on WebSocket message true
11:38:53,519 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) HttpSession supported: true
11:38:53,520 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Atmosphere is using DefaultAtmosphereObjectFactory for dependency injection and object creation
11:38:53,520 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: WildFly 8.2.0.Final - 1.1.0.Final using javax.servlet/3.0 and jsr356/WebSocket API
11:38:53,520 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Atmosphere Framework 2.2.4.vaadin4 started.
11:38:53,522 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-2) Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT 

我甚至添加了这样一个web.xml文件:

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
            http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">

    <listener>
        <listener-class>org.atmosphere.cpr.SessionSupport</listener-class>
    </listener>

    <context-param>
        <param-name>org.atmosphere.cpr.SessionSupport</param-name>
        <param-value>true</param-value>
    </context-param>
</web-app>

但是错误仍然是一样的。我真的不明白。我做错什么了?

我使用的是最新的vaadin 7.4.1、vaadin-cdi 1.0.1和野蝇8.2。

EN

回答 1

Stack Overflow用户

发布于 2017-10-13 14:49:23

Vaadin引入了一种新的模式WEBSOCKET_XHR (从服务器到客户端的WebSockets,从客户端到服务器的XHR ),它允许设置cookie,使用带有CDI/Spring的请求作用域等。

请参阅https://vaadin.com/download/release/7.6/7.6.0/release-notes.html

Marcus 回答,并从这是瓦丁论坛的主题中提取。(我发现把它放在这里很重要,因为我以前在StackOverflow论坛上做过第一篇文章。)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28967099

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档