簡體   English   中英

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

[英]java.lang.NoClassDefFoundError: org/atmosphere/cpr/AsyncSupportListenerAdapter

我試圖通過這種方式將消息從服​​務器推送到客戶端:

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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM