undefined.socket.css socket.js undefined

UI Components for JSF
Post Reply
romeromfm
Posts: 2
Joined: 10 Oct 2013, 22:15

12 Feb 2015, 22:39

I've already done some googling about this problem, but unfortunately I haven't found a solution yet.

First of all, I'm using Primefaces 5.1, Primefaces PUSH 2.0, Glassfish 4.1, JSF 2.2 in my project.

The WebSocket works fine but only after cleaning cache by pressing CTRL + F5. If I don't, the browser crashes and I get the following messages (that's why it only works after CTRL + F5):

Code: Select all

GET http://localhost:8080/zzz/javax.faces.resource/socket/socket.css.jsf?ln=primefaces&v=5.1 2015-02-11 13:55:08.854jquery.js.jsf?ln=primefaces&v=5.1:25 

GET http://localhost:8080/zzz/javax.faces.resource/socket/socket.js.jsf?ln=primefaces&v=5.1 404 (Not Found)

I'm using facelets in my xhtml files. So, I have a main-template.xhtml where I've put the JavaScript to handle the WebSocket requests, as you can see below:

Code: Select all

    <h:head>
    
    <!-- some stuff here... -->
    
        <script type="text/javascript">
            console.log('> Alive');
            function handleMessage(data) {
                /*data.severity = 'info';
                PF('growl_info_wdgt').show([data]);*/
    
                console.log('handleMessage - ' + data);
                receiveMessage([{name:'msgData', value:data}]);
            }
    
            function handleOpen(data) {
                console.log('handleOpen - ' + data);
            }
    
            function handleClose(data) {
                console.log('handleClose - ' + data);
            }
    
            /*I've seen this code as workaround approach for a 
                similar problem with Primefaces Mobile, as you can see
                in this link: http://stackoverflow.com/questions/27645923/why-is-my-pprogressbar-not-displayed-only-the-number/27667540#27667540
                Without using this workaround, the message error is the
                same as shown in the previous link;

            */
            var originalPrimeFacesCw = PrimeFaces.cw;
            PrimeFaces.cw = function(name, id, options, resource) {
                resource = resource || name.toLowerCase();
                originalPrimeFacesCw.apply(this, [name, id, options, resource]);
            };
        </script>
    </h:head>
In my page.xhtml is where I have a webSocket listener, as shown below:

Code: Select all

    <p:socket
        channel="/zzz"
        onMessage="handleMessage"
    />
So, can someone help me with this problem?

Thanks in advance. :)

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

16 Feb 2015, 18:42

searched google for

site:forum.primefaces.org outputscript push.js

and found

push.js not appearing in response
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

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests