Hi guys,
I extract my problem to a little war project on github. https://github.com/suikast42/websockettest.
If I push a message on a channel I get the wraning shown below.
WARN [org.atmosphere.cpr.MetaBroadcaster] (EJB default - 2) No Broadcaster matches /testchannel. Message {"data":""} WILL BE LOST. Make sure you cache it or make sure the Broadcaster exists before.
And my site is not up to date after the event. As the warning says. It losts.
My Runtime:
PF 4.0.10
Atmosphere 2.1.1
Wildfly 8.0.0.Final
Primepush not works on Wildfly 8
If I switch from then its works partial
...
<init-param>
<param-name>org.atmosphere.useWebSocket</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>false</param-value>
</init-param>
...
to
<init-param>
<param-name>org.atmosphere.useWebSocket</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>true</param-value>
</init-param>
I thought that the webserver undertow from wildfly 8 supports websockets ?? I'm wrong??
...
<init-param>
<param-name>org.atmosphere.useWebSocket</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>false</param-value>
</init-param>
...
to
<init-param>
<param-name>org.atmosphere.useWebSocket</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>true</param-value>
</init-param>
I thought that the webserver undertow from wildfly 8 supports websockets ?? I'm wrong??
I have it working without any of those init params... What version of PF(push) are you using and what version of atmosphere? And what is your pom? (things you should normally report in your initial post )
I use PF push 2.0/PF 5.0
web.xml
pom.xml
I use PF push 2.0/PF 5.0
web.xml
Code: Select all
<context-param>
<param-name>primefaces.PUSH_SERVER_URL</param-name>
<param-value>http://127.0.0.1:8080</param-value>
</context-param>
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<load-on-startup>0</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>Push Servlet</servlet-name>
<url-pattern>/primepush/*</url-pattern>
</servlet-mapping>
Code: Select all
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
+1 Ronald; that's good to know and thanks for sharing.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
Look at the bottom of my post. There're a list of the versions.kukeltje wrote:I have it working without any of those init params... What version of PF(push) are you using and what version of atmosphere? And what is your pom? (things you should normally report in your initial post )
First of all. The snapshot solution is not acceptable. I can't shipp a snapshot lib in the production envivornment.
The second think is I can't test this because I can't find the 5-0.SNAPSHOT in the maven repo. Did you build this from the showcase sources?
I try a strange thing.
I change the pushchannel from /testchannel to /*. That's works as excpected. Biut this can't be a solution .
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
+1 (yes, it is the solution).suikast42 wrote:I change the pushchannel from /testchannel to /*. That's works as excpected. Biut this can't be a solution .
Last edited by smithh032772 on 06 Apr 2014, 13:31, edited 2 times in total.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
what is google +1suikast42 wrote:What should that be +1 ??
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
Sorry, I must have clearly missed thatsuikast42 wrote:Look at the bottom of my post. There're a list of the versions.
Well, what is better? A working snapshot or a non-working 'release'... Oh did you upgrade to 4.0.11 already? Hope you are not relying on datatable dbclick select events . What I mean is, when is something production quality? For me it is always: if it works, it works...suikast42 wrote: First of all. The snapshot solution is not acceptable. I can't shipp a snapshot lib in the production envivornment.
Yessuikast42 wrote: The second think is I can't test this because I can't find the 5-0.SNAPSHOT in the maven repo. Did you build this from the showcase sources?
Are you suresuikast42 wrote:
I try a strange thing.
I change the pushchannel from /testchannel to /*. That's works as excpected. Biut this can't be a solution .
Code: Select all
<p:socket id="socket" channel="#{pushEventBroker.channelTest}"...
Will try to check later tonight if I find the time
The base of the problem was that I fired events in postconstruct of the sessionscoped bean. It seems so that atmosphere's broadcaster is not ready at this moment.
If I wait for fire events then it works as expected.
If I wait for fire events then it works as expected.
Code: Select all
Broadcaster lookup = BroadcasterFactory.getDefault().lookup(channelID);
if (lookup == null) {
// Maybe broadcaster not ready wait for a second
new Thread(new Runnable() {
@Override
public void run() {
try {
logger.warn("Atmosphere not ready wait");
Thread.sleep(1000);
} catch (InterruptedException e) {
}
logger.warn("Fire delayed push");
pushContext.push(channelID, obj);
}
}).start();
} else {
logger.warn("Fire push");
pushContext.push(channelID, obj);
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 16 guests