Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR http11.Http11Protocol - Error reading request, ignored #56

Open
spierepf opened this issue Feb 8, 2014 · 0 comments
Open

ERROR http11.Http11Protocol - Error reading request, ignored #56

spierepf opened this issue Feb 8, 2014 · 0 comments

Comments

@spierepf
Copy link

spierepf commented Feb 8, 2014

I've written a simple example based on your documentation but I cannot get it to work.

I keep getting the following exception on the server side

| Error 2014-02-08 14:16:57,862 [http-bio-8080-exec-7] ERROR http11.Http11Protocol - Error reading request, ignored
Message: null
Line | Method
->> 339 | invokeWebSocketProtocol in org.atmosphere.websocket.DefaultWebSocketProcessor


| 83 | onTextData in org.atmosphere.container.TomcatWebSocketHandler
| 1145 | runWorker . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run . . . . . . . . . . in java.lang.Thread

Here are the files I changed from a standard grails 2.3.5 app:

MyEvents.groovy:

events = {
    'savedTodo' namespace: 'browser', browser:true // allows browser push on this topic
}

MyService.groovy

package sandbox

import grails.transaction.Transactional

@Transactional
class MyService {
    //will receive client events from 'saveTodo' topic
    @grails.events.Listener(namespace='browser') saveTodo(Map data) {
        println data
        //...
        event([namespace: 'browser', topic: 'savedTodo', data: data]) // will trigger registered browsers on 'savedTodo' topic
    }
}

and index.gsp

    <body>
        <r:require module="grailsEvents"/>
        <r:script>
            var grailsEvents = new grails.Events("http://localhost:8080/sandbox");
            //grailsEvents.send('saveTodo', data); //will send data to server topic 'saveTodo'
            //grailsEvents.on('savedTodo', function(data){...}); //will listen for server events on 'savedTodo' topic
        </r:script>
        <button onclick="grailsEvents.send('saveTodo', {'key1': 'value1', 'key2': 'value2'});">Hello World</button>
    </body>

Also, I set the following in my BuildConfig.groovy:

        mavenRepo "https://oss.sonatype.org/content/repositories/snapshots/"
        build ":tomcat:7.0.42"
        compile ":events-push:1.0.M7"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant