Re: Configuring a JSR-356 Websocket
2014-04-22 16:43 GMT+04:00 Thom Hehl : > > On 04/22/2014 07:50 AM, Konstantin Kolinko wrote: >> >> 2014-04-22 15:31 GMT+04:00 Thom Hehl : >>> >>> On 04/21/2014 04:30 PM, Daniel Mikusa wrote: On Apr 21, 2014, at 9:58 AM, Thom Hehl wrote: >> >> >> 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 >> > 1. Sorry, tomcat 8.0.5. > 2. Yes. > 3. My class. A class being used was not included on the classpath, which > caused the class not to load. > > The stacktrace is IllegalStateException from ClassNotFoundException. This > stack trace doesn't show up anywhere in tomcat 8.0.5. If you are in debugger, you can go to "threads" view and there should be a way to copy a thread's stacktrace in its context menu. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring a JSR-356 Websocket
On 04/22/2014 07:50 AM, Konstantin Kolinko wrote: 2014-04-22 15:31 GMT+04:00 Thom Hehl : On 04/21/2014 04:30 PM, Daniel Mikusa wrote: On Apr 21, 2014, at 9:58 AM, Thom Hehl 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 I created bug 56442 for this issue. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring a JSR-356 Websocket
On 04/22/2014 07:50 AM, Konstantin Kolinko wrote: 2014-04-22 15:31 GMT+04:00 Thom Hehl : On 04/21/2014 04:30 PM, Daniel Mikusa wrote: On Apr 21, 2014, at 9:58 AM, Thom Hehl 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 1. Sorry, tomcat 8.0.5. 2. Yes. 3. My class. A class being used was not included on the classpath, which caused the class not to load. The stacktrace is IllegalStateException from ClassNotFoundException. This stack trace doesn't show up anywhere in tomcat 8.0.5. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring a JSR-356 Websocket
2014-04-22 15:31 GMT+04:00 Thom Hehl : > > On 04/21/2014 04:30 PM, Daniel Mikusa wrote: >> >> On Apr 21, 2014, at 9:58 AM, Thom Hehl 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
Re: Configuring a JSR-356 Websocket
On 04/22/2014 07:35 AM, Mark Thomas wrote: On 22/04/2014 12:31, Thom Hehl wrote: 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 Why / how does the class load fail? 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 As an experiment, I downloaded and ran tomcat 7.0.52 and dropped my same war file in. When I did so, I got an exception in the log because an interface I implemented wasn't found. This must be the reason the class wasn't loading. I'm going to fix this and test again with tomcat 8, but, for some reason, tomcat 8 was eating the exception and not displaying in the log. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring a JSR-356 Websocket
On 22/04/2014 12:31, Thom Hehl wrote: > 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 Why / how does the class load fail? > 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
Re: Configuring a JSR-356 Websocket
On 04/21/2014 04:30 PM, Daniel Mikusa wrote: On Apr 21, 2014, at 9:58 AM, Thom Hehl 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
Re: Configuring a JSR-356 Websocket
On Apr 21, 2014, at 9:58 AM, Thom Hehl 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