Primepush + Wildfly不起作用。气氛找不到带注释的课程

时间:2014-10-06 19:12:59

标签: jsf-2 primefaces wildfly primepush

我正在使用下一个配置:

  1. Application Server - Wildfly 9.0
  2. Primefaces 5.1 RC1,Atmosphere 2.2.2 - 作为模块添加(添加了所有依赖项)。 我已停止使用此配置,因为任何其他设备都会因错误堆而崩溃。
  3. 我将使用primepush,我已完成所有操作,例如http://www.primefaces.org/showcase/push/notify.xhtml,但它对我不起作用。

    我为primepush conf的web.xml部分:

    <filter-mapping>
       <filter-name>PrimeFaces FileUpload Filter</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <servlet>
       <servlet-name>Push Servlet</servlet-name>
       <servlet-class>org.primefaces.push.PushServlet</servlet-class>
       <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>
    

    我的项目类中有@PushEndpoint注释,在xhtml文件中我有套接字连接到同一个通道。部署后我没有任何错误,但第一行中有一个奇怪的字符串

    21:25:24,433 ERROR [org.primefaces.push.PushServlet] (MSC service thread 1-8) No Annotated class     using @PushEndpoint found. Push will not work.
    21:25:24,433 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0021: Registered web context: /oasa
    21:25:24,556 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0016: Replaced deployment "oasa.war" with deployment "oasa.war"
    21:25:24,701 INFO  [org.atmosphere.cpr.AtmosphereFramework] (Thread-150) Latest version of Atmosphere's JavaScript Client 2.2.4
    

    谷歌搜索后,我找到了添加到我的web.xml的解决方案

    <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>MY_PACKAGE_WITH_PUSH_ENDPOINTS</param-value>
    </init-param>
    

    所有部署正常,但是当我使用

    发送消息时
    EventBusFactory.getDefault().eventBus().publish(MY_CHANNEL, MY_VARIABLE);
    

    以下是我在wildfly控制台上的内容:

    22:02:54,284 ERROR [io.undertow.request] (default task-19) UT005023: Exception handling request to /MY_PROJECT/primepush/MY_CHANNEL: org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /MY_PROJECT/primepush/MY_CHANNEL
    at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355)
    at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:154)
    at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:104)
    at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
    at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2063)
    at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:211)
    at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:197)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:129) [undertow-websockets-jsr-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:259) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:246) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:75) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:165) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:737) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
    
    22:02:55,634 WARN  [org.atmosphere.websocket.DefaultWebSocketProcessor] (default task-20) Failed invoking AtmosphereFramework.doCometSupport(): org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for http://localhost:8080/MY_PROJECT/primepush/MY_CHANNEL
    at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355)
    at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:154)
    at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:104)
    at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
    at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2063)
    at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:568)
    at org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:213)
    at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:192)
    at io.undertow.websockets.jsr.EndpointSessionHandler.onConnect(EndpointSessionHandler.java:84) [undertow-websockets-jsr-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.websockets.jsr.JsrWebSocketFilter$1.handleUpgrade(JsrWebSocketFilter.java:121) [undertow-websockets-jsr-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.protocol.http.HttpReadListener.exchangeComplete(HttpReadListener.java:285) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.protocol.http.HttpServerConnection.exchangeComplete(HttpServerConnection.java:212) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.HttpServerExchange.invokeExchangeCompleteListeners(HttpServerExchange.java:1141) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.HttpServerExchange.terminateResponse(HttpServerExchange.java:1361) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.Connectors.terminateResponse(Connectors.java:98) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.protocol.http.ServerFixedLengthStreamSinkConduit.channelFinished(ServerFixedLengthStreamSinkConduit.java:51) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.exitFlush(AbstractFixedLengthStreamSinkConduit.java:300) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.flush(AbstractFixedLengthStreamSinkConduit.java:234) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.xnio.conduits.ConduitStreamSinkChannel.flush(ConduitStreamSinkChannel.java:162)
    at io.undertow.channels.DetachableStreamSinkChannel.flush(DetachableStreamSinkChannel.java:118) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.xnio.channels.Channels.flushBlocking(Channels.java:63)
    at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:607) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:483) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:566) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:307) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:246) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:75) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:165) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:737) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
    
    22:02:55,649 WARN  [org.atmosphere.websocket.protocol.SimpleHttpProtocol] (default task-20) org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for http://localhost:8080/MY_PROJECT/primepush/MY_CHANNEL. Unable to deliver the websocket messages to installed component. Status 500 Message Server Error
    

    无论如何,websockets对我不起作用......

    请告知如何解决这个问题。

    P.S。我刚刚重复了野生动物8.1决赛的所有步骤。我有相同的图片 - 所有错误都像在wildfly 9.0案例中那样....

    P.P.S。 module.xml

    气氛

    <module xmlns="urn:jboss:module:1.3" name="org.atmosphere">
        <resources>
            <resource-root path="atmosphere-runtime-2.2.2.jar"/>
        </resources>
    
        <dependencies>
           <module name="javax.servlet.api"/>
           <module name="javax.websocket.api" export="true"/>
           <module name="org.slf4j" export="true"/>
        </dependencies>
    </module>
    

    primefaces

    <module xmlns="urn:jboss:module:1.3" name="org.primefaces" slot="5">
        <resources>
            <resource-root path="primefaces-5.1.RC1.jar"/>
        </resources>
    
        <dependencies>
            <module name="javax.api"/>
            <module name="javax.annotation.api"/>
            <module name="javax.faces.api"/>
            <module name="org.apache.commons.fileupload"/>
            <module name="org.atmosphere"/>
        </dependencies>
    </module>
    

0 个答案:

没有答案