- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我有一个使用 vaadin 和 vaadin-cdi 组件的 Java EE 7 应用程序。
没有 vaadin push 这是我的配置:
// 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 组件之前,这里一切正常
<dependency org="com.vaadin" name="vaadin-push" rev="&vaadin.version;" />
然后我在 wildfly 尝试访问我的应用程序时遇到此错误
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 文件,如下所示:
<?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 和 wildfly 8.2
最佳答案
Vaadin 引入了一种新模式,WEBSOCKET_XHR
(WebSockets
从服务器到客户端,XHR
从客户端到服务器) 允许设置 cookie,使用 CDI/Spring
等的请求范围
参见 https://vaadin.com/download/release/7.6/7.6.0/release-notes.html
由 Marcus Hellberg 回答并摘自 this thread of vaadin forum . (我发现把它放在这里很重要,因为我之前在论坛上已经在 StackOverflow 中完成了第一。)
关于java - Vaadin + CDI + 推送(大气)不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28967099/
我想用 CDI 实现工厂模式。这里我们有一个商业案例示例: A client provides a string representing a type. Depending on this type
我在这里的部分问题是使用正确的词汇,所以我提前为这可能是一个简单的术语问题道歉。 假设我有一个 Person接口(interface)和 PersonBean实现该接口(interface)的类。 进
我想我了解 CDI 的工作原理,为了深入研究它,我想尝试将它与现实世界的示例一起使用。我被一件事困住了,我需要你的帮助才能让我理解。我非常感谢您在这方面的帮助。 我有自己的工作流框架,使用 Java
来自 Guice 背景,我知道可以使用范围从范围中播种对象值。 scope.seed(Key.get(SomeObject.class), someObject); 我想可以通过注册一个从 Abs
JSR-299 (CDI) 引入了资源的(不幸命名的)概念:http://docs.jboss.org/weld/reference/1.0.0/en-US/html/resources.html#d
规范说,当作用域的上下文即将被销毁时,CDI 容器会删除 SFSB。它如何准确地删除 EJB?它似乎没有调用带有@Remove 注释的方法。 @Stateful public class Custom
我有一个手动初始化的对象(遗留代码)。我想将此对象放入应用程序上下文,以使其通过 CDI 可用。 如何在不编写 CDI 扩展的情况下做到这一点? 最佳答案 使用生产者。制作一个 @Produces 您
我有一个关于在 Java EE 中拥有一个尽可能不耦合的系统的最佳实现的问题,问题是使用 CDI 事件还是 CDI 拦截器更好,显然对于安全性之类的事情来说拦截器,对于日志,例如根据具体情况的两者中的
我正在尝试做简单的事情。注塑合格String (或 File )在 CDI 中。 所以我有一个限定符: @Retention(RetentionPolicy.RUNTIME) @Target({FIE
使用 Wildfly 8.2.0.Final(我相信它使用 Weld 2.2),我在 Maven 多模块项目中用 2 个简单的类重现了这个问题。一个生成一个 javax.ws.rs.client.Cl
我正在使用 picketlink 对项目中的用户进行身份验证。我还创建了一个 @produces 注释方法,因此我可以在其他地方注入(inject)经过身份验证的用户。现在,我正在使用 envers,
是否可以在使用 new 关键字创建的类中获取 CDI bean 的实例?我们目前正在对一个旧应用程序进行一些改进,我们总是得到一个 ContextNotActiveException每次我们做 pro
我正在尝试在 WildFly 8.1.0.Final 上使用 CDI 运行 Liquibase 脚本,但出现此错误: Unsatisfied dependencies for type Resourc
在没有值的情况下使用 CDI @Named 有什么意义吗?难道这不就相当于一起使用@Qualifier和@Default吗? @Named public class GifFileEditor imp
我在 JBoss-7 环境中使用 ReastEasy,目前正在实现安全功能。我正在使用带有 SSL 连接的 HTTP Basic。添加和评估 header 参数很容易(感谢 Passing param
我正在开发一些应用程序,它由三层组成: 数据库访问层(JPA + Hibernate 作为提供者) 业务逻辑层 表示层 (JSF 2.0) 在开始之前,我已经阅读了 David Geary 和 Cay
在 CDI 中,我能够注入(inject)具有特定范围的 bean,即定义 bean 类的范围。但是,如果我创建没有任何作用域的 bean 类,并且在注入(inject)时为该 bean 赋予作用域,
我们想使用 Jglue 框架对我们的 CDI 应用程序进行单元测试。我们使用 gradle 进行构建。 我们准备了这样的东西: 1) 要测试的类: @Default public class Rate
我已经有一个 session 范围的 CDI bean,它保持当前登录的用户数据。 现在,从另一个请求范围内,我想访问这个 bean 以获取一些数据。我有一些操作要做,这取决于用户登录。这是我需要的唯
有一个包 A,并且包 A 中有一个类 MyClass。我们假设 pax-cdi+weld 已打开。 我可以在不使用@Inject和其他CDI注释的情况下获取MyClass内bundle A的BeanM
我是一名优秀的程序员,十分优秀!