2 Replies Latest reply on Mar 27, 2015 11:16 AM by pgy

    Server to Client event: no subscribers to deliver to for subject: cdi.event:Dispatcher

    pgy Newbie

      Hello,

      I try a simple application with Server -> Client event with Errai 3.1.2-Final, GWT 2.7.0, Wildfly 8.2.0.Final (I have also tried with Errai 3.2.0-SNAPSHOT with same result).

      In the browser console, I have the following message: no subscribers to deliver to for subject: cdi.event:Dispatcher

      There is no error log on the server side.


      This is the code:


      Shared TimeEvent class:

      @Portable
      public class TimeEvent {
      
          private Date date;
      
          public TimeEvent() {
          }
      
          public TimeEvent(Date date) {
              this.date = date;
          }
      
          public Date getDate() {
              return date;
          }
      
          public void setDate(Date date) {
              this.date = date;
          }
      
      }
      

       

      Server side:

      @Stateless
      public class TimeService {
      
          @Inject Event<TimeEvent> timeEvent;
          Logger logger = Logger.getLogger(this.getClass().getName());
          
          @Schedule(second = "*/15", minute = "*", hour = "*")
          void onTimer() {
              Date date = new Date();
              logger.info(date.toString());
              
              timeEvent.fire(new TimeEvent(date));
          }
          
      }
      

       

      Client side:

      @EntryPoint
      public class Skel  {
          
          Label time = new Label(" -- empty --");
          
          @PostConstruct
          void init() {
              RootLayoutPanel.get().add(time);
          }
          
          
          public void onTimeEvent(@Observes TimeEvent event) {
              time.setText(event.getDate().toString());
          }
          
      }
      

       

      Thanks for your help.