jsf - java.lang.NoClassDefFoundError : org/atmosphere/cpr/AsyncSupportListenerAdapter 错误

标签 jsf primefaces push

我正在尝试以这种方式将消息从服​​务器推送到客户端:

PushContext pushContext = PushContextFactory.getDefault().getPushContext();
pushContext.push("/registrationEvent", "There was another registration");

我的问题是出现以下错误

ava.lang.NoClassDefFoundError: Could not initialize class org.primefaces.push.PushContextFactory

但我认为这是由于项目初始化时的问题:

java.lang.NoClassDefFoundError: org/atmosphere/cpr/AsyncSupportListenerAdapter

我已经尝试添加 jar 氛围文件...但没有成功。我做错了什么吗?我正在使用 glassfish 3.1。

谢谢!

最佳答案

Primefaces MigrationGuide通知:“PrimeFaces Push 已重新实现,PushContext 已弃用,请改用 EventBus 以及新的 Push API。”

在这种情况下,在 pom.xml 上放置 2.2.1 气氛版本。可能您使用的是旧大气版本。如果您尝试使用 Primefaces 5.0,请将代码放在下面:

<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>5.0</version>
</dependency>

<dependency>
    <groupId>org.primefaces.extensions</groupId>
    <artifactId>primefaces-extensions</artifactId>
    <version>2.1.0</version>
</dependency>

<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-runtime</artifactId>
    <version>2.2.1</version>
</dependency>

关于jsf - java.lang.NoClassDefFoundError : org/atmosphere/cpr/AsyncSupportListenerAdapter 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14835535/

相关文章:

c++ - 如何在Qt5中通过http连接到PUSH服务器

java - JSF ValueChangeListener 不工作

java - CANNOT_FIND_FACELET_TAGLIB 对于 xmlns :jsf ="http://xmlns.jcp.org/jsf"

javascript - h :commandButton 中实际操作后的 OnClick 操作

hibernate - p :datatable - update ManyToMany property results in LazyInitializationException

javascript - 使用 Javascript 启用/禁用 primefaces 的 SelectOneMenu

jquery - 为什么我的 jQuery 选择器无法通过 id 找到我的元素?

Git 基本工作流程

css - 如何将背景颜色添加到选定的计划日期

assembly - 汇编代码解释