PrimePush テクノロジを使用した反例アプリケーションを開発しています。Jboss 7.1.1でPromefaces 5.0とAtmosphere 2.1.6を使用しています
私は、Primefaces 3.4.2 と大気 1.0.8 Push で動作することを発見しました。しかし、私はprimefaces 5.0を使用する必要があります
だから私は公式のPrimefaces反例を使っています
@ManagedBean
@ApplicationScoped
public class GlobalCounterView implements Serializable{
private volatile int count;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public void increment() {
count++;
EventBus eventBus = EventBusFactory.getDefault().eventBus();
eventBus.publish("/counter", String.valueOf(count));
}
}
これが私のweb.xmlです
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.useWebSocket</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.cpr.sessionSupport</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
<param-value>org.atmosphere.cache.HeaderBroadcasterCache</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.cpr.broadcastFilterClasses</param-name>
<param-value>org.atmosphere.client.TrackMessageSizeFilter</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.resumeOnBroadcast</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>Push Servlet</servlet-name>
<url-pattern>/primepush/*</url-pattern>
</servlet-mapping>
次に、高度な IO を使用するように Jboss を構成しました
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="true">
しかし、アプリケーションをデプロイしてカウントボタンをクリックすると、これらのエラーが発生します
10:31:50,019 INFO [org.atmosphere.cpr.AtmosphereFramework] (MSC service thread 1-8) Installed AtmosphereInterceptor @PushEndpoint Interceptor with priority AFTER_DEFAULT
10:31:50,031 INFO [org.jboss.web] (MSC service thread 1-8) JBAS018210: Registering web context: /pushcomment
10:31:51,515 INFO [org.atmosphere.cpr.AtmosphereFramework] (Thread-71) Latest version of Atmosphere's JavaScript Client 2.2.2
10:33:03,976 INFO [org.hibernate.validator.util.Version] (http-localhost-127.0.0.1-8080-2) Hibernate Validator 4.2.0.Final
10:33:05,594 ERROR [org.atmosphere.container.JBossWebCometSupport] (http-localhost-127.0.0.1-8080-1) HttpEvent is null, JBoss APR Not Properly installed
10:33:05,595 WARN [org.atmosphere.cpr.AtmosphereFramework] (http-localhost-127.0.0.1-8080-1) Failed using comet support: org.atmosphere.container.JBossWebCometSupport, error: JBoss failed to detect this is a Comet application because the APR Connector is not enabled.
Make sure atmosphere-compat-jboss.jar is not under your WEB-INF/lib and You must use the atmosphere- native-runtime dependency in order to use native Comet Support
there is no context.xml under WEB-INF Is the NIO or APR Connector enabled?
10:33:05,598 ERROR [org.atmosphere.cpr.AtmosphereFramework] (http-localhost-127.0.0.1-8080-1) If you have more than one Connector enabled, make sure they both use the same protocol, e.g NIO/APR or HTTP for all. If not, org.atmosphere.container.BlockingIOCometSupport will be used and cannot be changed.
10:33:05,601 WARN [org.atmosphere.cpr.AtmosphereFramework] (http-localhost-127.0.0.1-8080-1) Using org.atmosphere.container.BlockingIOCometSupport
10:33:05,603 ERROR [org.atmosphere.cpr.AsynchronousProcessor] (http-localhost-127.0.0.1-8080-1) Invalid request state. Websocket protocol not supported
この構成で PrimePush を使用できますか? できない場合、jboss 7.1.1 で Web ページにデータをプッシュする別の方法はありますか?