0 Replies Latest reply on Apr 11, 2012 9:35 AM by Jérémy Caramelle

    Richfaces push CDI

    Jérémy Caramelle Newbie

      Hello,

       

      I'm trying to reproduce Richfaces showcase about CDI push :

      http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=push&sample=pushCdi&skin=blueSky

       

      I've copied the given source code but I'm getting the following exception when I launch the consumer xhtml page :

       

      java.lang.IllegalArgumentException: Subtopic name '' does not match pattern ([a-zA-Z0-9_]+|#\{.+\})

                at org.richfaces.application.push.TopicKey.<init>(TopicKey.java:76)

                at org.richfaces.application.push.TopicKey.<init>(TopicKey.java:58)

                at org.richfaces.application.push.TopicKey$1.apply(TopicKey.java:39)

                at org.richfaces.application.push.TopicKey$1.apply(TopicKey.java:37)

                at com.google.common.collect.Iterators$8.next(Iterators.java:782)

                at org.richfaces.application.push.impl.SessionImpl.createSubscriptions(SessionImpl.java:181)

                at org.richfaces.application.push.impl.SessionImpl.subscribe(SessionImpl.java:177)

                at org.richfaces.resource.PushResource.encode(PushResource.java:88)

                at org.richfaces.resource.UserResourceWrapperImpl.encode(UserResourceWrapperImpl.java:188)

                at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:222)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:591)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                at java.lang.Thread.run(Thread.java:619)

       

      And nothing is displayed.

       

      Why the subtopic name is found empty ? It is initialized like this :

       

            @Inject

          @Push(topic = PUSH_CDI_TOPIC, subtopic = "#{pushBean.userIdentifier}")

          Event<String> pushEvent;

       

          @PostConstruct

          public void initialize() {

              if (userIdentifier == null) {

                  userIdentifier = getUUID().replace("-", "");

              }

          }

       

      Thanks for your repplies.