I'm using atmosphere 2.1.9 with primefaces version 5.0, and wildfly8. Amosphere is provided by my server. (used as wildfly module).
I have a bean NotifyResourceBean which receive some message :
Code: Select all
@PushEndpoint ("/notify")
public class NotifyResourceBean {
@OnOpen
public void onOpen(RemoteEndpoint r, EventBus eventBus) {
}
@OnClose
public void onClose(RemoteEndpoint r, EventBus eventBus) {
}
@OnMessage(encoders = {JSONEncoder.class})
public FacesMessage onMessage(FacesMessage message) {
return message;
}
Code: Select all
EventBus eventBus = EventBusFactory.getDefault().eventBus();
eventBus.publish("/notify", "test"));
Everything works well when i start my application by eclipse. I have a folder called nameApp.war in the standalone folder of wildfly. NotifyResourceBean receive all the message.
When i package my app in a war file (via maven), atmosphere can't find the annotation @PushEndPoint in my WEBINF/classe folder. I have the following error : "No Annotated class using @PushEndpoint found. Push will not work"
The architectury of my folders and file is exactly the same as before, except that is now packaging. (I unzip the war file to compare).
The configuration for atmophere in web.xml :
Code: Select all
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
<param-value>org.atmosphere.cache.UUIDBroadcasterCache</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.annotation.packages</param-name>
<param-value>org.primefaces.push</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.cpr.packages</param-name>
<param-value>package_off_my_app</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>Push Servlet</servlet-name>
<url-pattern>/primepush/*</url-pattern>
</servlet-mapping>
Many thanks,
Sarah