On 04/21/2014 04:30 PM, Daniel Mikusa wrote:
On Apr 21, 2014, at 9:58 AM, Thom Hehl <th...@corrisoft.com> wrote:

Tomcat 8/Ubuntu 12.04

I have my tomcat deployed with the example echo application. I wrote a tester 
that hits the URL provided and sends a message and then receives the response 
back.

I want to deploy my own websocket. I have done so using the @ServerEndpoint(value = 
"/websocket") annotation. When i try to hit this from my client, I get a http 
404 status.

I looked at the examples again and found that there was this 
ExamplesConfig.java. Aha! I thought, a magic class that makes this 
configuration work. I implemented my own and it does not change the results. It 
does not appear to be calling my config at all because I have 
System.out.println()s in my config and they are not showing up in the log.

I have been through the examples web.xml and cannot find any configuration for 
websockets at all except the listener definition for the old school version of 
web sockets. (I'm assuming this predated JSR-356.)

So how do i configure tomcat so it knows about my web socket?
I don’t think this is really Tomcat specific.  Maybe start with a JSR-356 
tutorial and see if that helps to answer your questions.

   http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm

I also have some examples on Github, if you’re looking for more WebSockets 
examples.

   https://github.com/dmikusa-pivotal/tomcat-8-features

Dan



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

I appreciate the help, but I've been through the tutorials. I've been debugging the code for tomcat 8.05 and this looks like a defect. It finds my class in ContextConfig.checkHandlesTypes and then passes it to Introspection.loadClass(), but the class load fails and so the class isn't added to the list of endpoints. This is the exact thing that happens when I pull the EchoAnnotation endpoint out of the examples webapp and try it independently. Can I get someone to verify, please?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to