Search code examples
javagradlegretty

Testing WebSockets With The Gretty Gradle Plugin


I created a simple war which includes a servlet (defined in web.xml) and a JSR 356 websocket (defined by annotations).

When I deploy to my tomcat 7.0.59 (via tomcat manager) both the servlet and the websocket work correctly. However when I use the gretty gradle plugin to test out my war the servlet works but the JSR 356 websocket does not. I have tried tomcat 7.0.59, tomcat 8.0.20 and Jetty 9.2.9.v20150224 in gretty. Anything obvious I could be doing wrong here?

I assume I am using the latest gretty version as I am adding gretty to my gradle build file via:

apply plugin: 'war'
apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'

Solution

  • Please check Gretty 1.2.1 - https://github.com/akhikhl/gretty

    It supports websockets out-of-the-box, no configuration needed.

    Gretty also includes two working examples of using websockets:

    https://github.com/akhikhl/gretty/tree/master/examples/websocket

    https://github.com/akhikhl/gretty/tree/master/examples/springBootWebSocket