简体   繁体   中英

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

I'm trying to push a message from server to client that way :

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

My problem is that i've the following error

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

But I think that this is due to a issue at the initialization of the projet :

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

I've try to add jar atmosphere file... Without success. Have I done something wrong ? I'm using glassfish 3.1.

Thanks !

Primefaces MigrationGuide inform: "PrimeFaces Push is reimplemented, PushContext is deprecated, use EventBus instead along with the new Push API."

In this case, on pom.xml, put the 2.2.1 atmosphere version. Probably you are using a old atmosphere version. If you trying to use the Primefaces 5.0, put the code below:

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM