0 Replies Latest reply on Nov 3, 2011 7:24 AM by navigateur

    Strange bug during Errai broadcast

    navigateur

      When I broadcast an object, one of its methods, which I am not even calling, is being executed by Errai upon broadcast.

      The broadcast call is:

      MessageBuilder.createMessage()
               .toSubject("Client")
               .signalling()
               .with(MyMessageType.OBJECT, theObject)
               .noErrorHandling()
               .sendGlobalWith(dispatcher);
        
      System.out.println("Broadcasting command done");

       

      I know something is being carried out afterwards, because I get another console message from the object itself AFTER "Broadcasting command done" e.g. "object method being called now", even though no part of my code calls it at any point after the broadcast! Not only that, as soon as I remove the broadcast command, that method is never executed, so I know it's due to this broadcast command.

       

      And this happens every single time, without fail, and it's the same method every time (it's not a getter or setter or anything, just one of my own methods - an overridden abstract method in my case. The object is sent in the abstract type form). The error is serious, because the method tries to change the state of things (I get a NullPointerException in my case), but there could be other, more serious cases in future.

       

      What should be done?