kukeltje wrote:Are these tests by you or observations from logging on a production system with numerous different users? In that case it could be they don't accept cookies and sessionId is not present for that reason. Can you add an addtional parameter in the push path to differentiate and maybe get some more info
Thanks kukeltje,
Tests are conducting several ways,
1)
Open Chrome browser, just one instance, ensure all are closed,
set url,
some seconds after page is viewed, close browser, (push connection is also viewed closed always).
Repeat from starting until case null session id appears in onOpen, sometimes occurs first time too.
2)
Open different Chrome browser session concurrently running with --user-data-dir each one, open url, until case null session id occurs.
3)
Start server, (ensure configured to do not maintain sessions)
Start browser, set url,
If null session id does not occur, Stop server, close browser and repeat test again.
I have changed code, do not understand clearly your purpose, sorry to say that, may be you can clarify better for me.
Result:
2014-08-14T10:40:55.609-0500|INFO: Session started with 52dd1b5edf86be0b3de4d3e564fc
2014-08-14T10:40:56.281-0500|INFO: Tipo de Browser = Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Lenguage = 0
2014-08-14T10:40:56.430-0500|INFO: Push connection opened with randomSession 3a20b3dc-ceb8-4648-95c6-d8876b3f1029
2014-08-14T10:41:08.589-0500|INFO: Push connection closed with randomSession 3a20b3dc-ceb8-4648-95c6-d8876b3f1029
2014-08-14T10:41:13.684-0500|INFO: Session started with 52e185194931fcd19d4eb762ca8c
2014-08-14T10:41:14.129-0500|INFO: Tipo de Browser = Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Lenguage = 0
2014-08-14T10:41:14.176-0500|INFO: <ERROR> Push connection not recognized, randomSession got <null>
2014-08-14T10:42:27.631-0500|INFO: Session ended with 52dd1b5edf86be0b3de4d3e564fc
2014-08-14T11:16:34.573-0500|INFO: Push connection with null randomSession closed
2014-08-14T11:17:27.682-0500|INFO: Session ended with 52e185194931fcd19d4eb762ca8c
Code xhtml:
Code: Select all
<p:socket id="wdaPushing" onMessage="WDA.pushCallbackFunction" onError="WDA.pushErrorFunction" channel="/events/#{DSession.be}/" />
DSession (bean)
Code: Select all
@ManagedBean(name = "DSession")
@SessionScoped
public class DSessionBean implements AdminConnection.INotifyConnection{
public String getBe()
{
return UUID.randomUUID().toString();
}
public void setBe(String s) {}
PushResource.java
Code: Select all
package wda.utils;
import org.primefaces.push.EventBus;
import org.primefaces.push.RemoteEndpoint;
import org.primefaces.push.annotation.OnClose;
import org.primefaces.push.annotation.OnMessage;
import org.primefaces.push.annotation.OnOpen;
import org.primefaces.push.annotation.PathParam;
import org.primefaces.push.annotation.PushEndpoint;
import org.primefaces.push.annotation.Singleton;
import org.primefaces.push.impl.JSONEncoder;
@PushEndpoint("/events/{randomSession}/")
@Singleton
public class PushResource {
@PathParam("randomSession")
private String randomSession;
@OnMessage(encoders = {JSONEncoder.class})
public PushData onMessage(PushData pushData) {
return pushData;
}
@OnMessage(encoders = {JSONEncoder.class})
public Object onMessage(Object pushData) {
return pushData;
}
@OnOpen
public void onOpen(RemoteEndpoint r, EventBus eventBus) {
if (randomSession == null)
System.out.println("<ERROR> Push connection not recognized, randomSession got <null>");
else
System.out.println("Push connection opened with randomSession " + randomSession);
}
@OnClose
public void onClose(RemoteEndpoint r, EventBus eventBus) {
if (randomSession == null)
System.out.println("Push connection with null randomSession closed");
else
System.out.println("Push connection closed with randomSession " + randomSession);
}
}