2014-04-22 15:31 GMT+04:00 Thom Hehl <th...@corrisoft.com>: > > 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 >> >> > 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?
1. What exactly version of Tomcat you are using? https://wiki.apache.org/tomcat/FAQ/Linux_Unix#Q5 2. Does you copy of Tomcat has the following libraries in its lib directory? tomcat-websocket.jar websocket-api.jar 3. Loading of what class fails? Your class, or some of its dependencies? What is stacktrace when class loading fails? > 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.) All websockets in Tomcat 8 are JSR-356. ("Old-school" were in Tomcat 7, where both them and JSR-356 are available now). Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org