1

After help from @BalusC I have my EJB method firing an event on JBoss WildFly 12.0.0.Final (MacOS) using JSF 2.3 running on EE8:

beanManager.fireEvent("updateNotifications" );

the POJO:

@Inject
@Push(channel = "testChannel")
private PushContext pushContext;

public void onPersist(@Observes String notification) {
    logger.info("***** onPersist notification = {}", notification);
    pushContext.send("updateNotifications");
}

receives & prints the message;

16:03:36,682 INFO [com.notifywell.ejb.FoodsCosmeticsMedicinesEJB] (default task-3) >>>>> insertFoodsCosmeticsMedicinesEJB beanManager = Weld BeanManager for NOTiFYwell.ear/NOTiFYwellJAR.jar/ [bean count=39]

16:03:36,695 INFO [com.notifywell.push.PushBean] (default task-3) ***** onPersist notification = updateNotifications

I can’t get it to communicate with XHTML from the Push Send. I’ve tried with both OmniFaces 3.1 & the JBoss WildFly 12 JSF 2.3 and nothing re-renders (XHTML code not shown here). When using OmniFaces 3.1 I can’t get the onmessage to display:

<h:form>
    <o:socket channel="testChannel" onmessage="socketListener"/>
    <h:outputScript>
        function socketListener(message, channel, event) {
            console.log(message);
        }
    </h:outputScript>
</h:form>

If I open the console log in Chrome it's empty there's no “message”.

In WireShark I see:

2601 9.810264 ::1 ::1 HTTP 997 GET /NOTiFYwell/omnifaces.push/testChannel?a1ef3363-dc5a-4153-a4c7-73b0e183713d HTTP/1.1

It is as though the

pushContext.send(notification);

is not getting executed.

NOTiFY
  • 1,255
  • 1
  • 20
  • 36
  • 1
    did you debug network traffic in the browser? – Kukeltje Apr 19 '18 at 06:40
  • Using Wireshark and filtering on tcp.port == 8080 && http. I see my unit test running. Does show the HTTP GET and the response of OK 200. – NOTiFY Apr 19 '18 at 14:19
  • _"It is as though the `pushContext.send(notification)` is not getting executed."_ Debug... – Kukeltje Apr 23 '18 at 13:33
  • uhhhh if you run your app in a container from your ide you should just be able to debug... – Kukeltje Apr 23 '18 at 16:24
  • If you have an [mcve] I can try to reproduce. But I'm not going to try to reproduce. But does the f: websockets work? Does that make a difference? – Kukeltje Apr 23 '18 at 18:59
  • oh cool... I did not help... https://stackoverflow.com/questions/49854566/fwebsocket-in-jsf-2-3 and all the other comments were not help either? Hmmmm.... – Kukeltje Apr 23 '18 at 20:08
  • Did you solve the problem? – Arash Aug 05 '20 at 16:16

1 Answers1

1

I had exactly the same Situation with Wildfly 14.

To resolve this i had to:

  1. undeploy the Application
  2. shutdown the Server
  3. clear the content of the tmp folder in standalone
  4. start server
  5. deploy

Now it works, but if I deploy without steps 1-4 it wont work again. (Maybe Step 3 is not necessary, but i do it because i got so many other errors)

toti08
  • 2,448
  • 5
  • 24
  • 36
Meini
  • 77
  • 3
  • 19