a4j:push topic 'pushTest' is not configured
healeyb Dec 17, 2011 2:55 PMI'm trying to get a4j:push working with CDI events on 4.1.0.Final. I have:
<a4j:push address="pushTest"
ondataavailable="alert(event.rf.data)"/>
@Inject
@Push(topic = "pushTest")
private Event<String> pushEvent;
public void sendMessage() throws Exception {
pushEvent.fire("let's see if this works 2");
}
web.xml
<context-param>
<param-name>org.richfaces.push.jms.disable</param-name>
<param-value>true</param-value>
</context-param>
pom.xml
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
</dependency>
When I load the page containing a4j:push, I get an alert saying topic 'pushTest' is not configured. When
I call the sendMessage() method the alert isn't opened by a4j:push. In the server log I see this output when
I deploy the application:
server log:
INFO: SESSION CREATED ID: 901939c9b5c1f6777c0ca6a844d2
INFO: Atmosphere is using async support: org.atmosphere.container.Servlet30CometSupportWithWebSocket running under container: "" with WebSocket enabled.
INFO: Installed AtmosphereHandler null mapped to context-path: /*
INFO: Installing Servlet null
INFO: Installing Filter PushHandlerFilter
INFO: Using broadcaster class: org.atmosphere.cpr.DefaultBroadcaster
INFO: Atmosphere Framework 0.8.0-RC1 started.
Is there any additional configuration required? I'm using glassfish 3.1.1 and have enabled comet.
Update: I've added a simple listener and changed the code to use HelloEvent, and the event is getting
fired successfully, so there must be something I'm missing on the a4j:push side of things.
@Stateless
public class HelloListener {
public void listenToHello(@Observes HelloEvent helloEvent){
SQLog.log("HelloEvent: " + helloEvent.getMessage());
}
}
Update 2: when the page containing a4j:push loads I get the javascript alert box with the 'pushTest is not
configured' message referred to above, I ok this an then see this error in the javascript console (chrome browser):
- GET https://localhost:8181/uk.co.sportquest_SportQuest_war_1.0.0/rfRes/org.richfaces.resource.PushResource.xhtml?__richfacesPushAsync=1&pushSessionId=a0c5e133-80a9-4310-ae6c-f37e3c4c8964 500 (Internal Server Error)
- executeRequestjquery-atmosphere.js.xhtml:281
- subscribejquery-atmosphere.js.xhtml:91
- richfaces.Push.pushSessionIdRequestHandlerpush.js.xhtml:112
- jQuery.extend._Deferred.deferred.resolveWithjquery.js.xhtml:1016
- donejquery.js.xhtml:7247
- jQuery.ajaxTransport.send.callbackjquery.js.xhtml:8028
Thanks,
Brendan.