Re: Using websocket with Tomcat 7.0.37

2013-04-08 Thread eric . robert . c


- Mail original -
> De: "Howard W. Smith, Jr." 
> À: "Tomcat Users List" 
> Envoyé: Lundi 8 Avril 2013 14:19:50
> Objet: Re: Using websocket with Tomcat 7.0.37
> 
> On Mon, Apr 8, 2013 at 7:01 AM, Muralidhar Yaragalla <
> java.yaraga...@gmail.com> wrote:
> 
> > See if you are following the examples shown on tomcat7.0 docs then
> > you are
> > wasting time. The JSR is not yet implemented in tomcat but the
> > examples
> > shown are according to JSR that is currently open. Tomcat7.0 has a
> > propitiatory solution for websockets. if you want to use websockets
> > study
> > the examples that comes with the tomcat distribution. That will
> > help you to
> > use websockets in tomcat7.
> >

Actually, it was just a stupid mistake of mine. I tried to package the 
project from command line instead of the integrated Maven in Eclipse.
This gave me an error of missing class, because I didn't add this 
dependency to my pom.xml : 


org.apache.tomcat
tomcat-coyote
7.0.39
provided


Once I added it, it solved my problem.


> And on that note, I fully recommend The Atmosphere Framework
> github[1] and
> google-groups mail list[2].
> 
> github - for tutorials,documentation, code samples, downloads
> 
> google groups mail list for your questions and for 'research' (search
> the
> mail list as many questions, related to using atmosphere framework,
> have
> been asked and answered, there)
> 
> [1] https://github.com/Atmosphere/atmosphere
> [2]
> https://groups.google.com/forum/?fromgroups#!forum/atmosphere-framework


I will take a look at this too ! Thanks a lot ;)

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



Re: Using websocket with Tomcat 7.0.37

2013-04-08 Thread Howard W. Smith, Jr.
On Mon, Apr 8, 2013 at 7:01 AM, Muralidhar Yaragalla <
java.yaraga...@gmail.com> wrote:

> See if you are following the examples shown on tomcat7.0 docs then you are
> wasting time. The JSR is not yet implemented in tomcat but the examples
> shown are according to JSR that is currently open. Tomcat7.0 has a
> propitiatory solution for websockets. if you want to use websockets study
> the examples that comes with the tomcat distribution. That will help you to
> use websockets in tomcat7.
>
>
And on that note, I fully recommend The Atmosphere Framework github[1] and
google-groups mail list[2].

github - for tutorials,documentation, code samples, downloads

google groups mail list for your questions and for 'research' (search the
mail list as many questions, related to using atmosphere framework, have
been asked and answered, there)

[1] https://github.com/Atmosphere/atmosphere
[2] https://groups.google.com/forum/?fromgroups#!forum/atmosphere-framework


Re: Using websocket with Tomcat 7.0.37

2013-04-08 Thread Muralidhar Yaragalla
See if you are following the examples shown on tomcat7.0 docs then you are
wasting time. The JSR is not yet implemented in tomcat but the examples
shown are according to JSR that is currently open. Tomcat7.0 has a
propitiatory solution for websockets. if you want to use websockets study
the examples that comes with the tomcat distribution. That will help you to
use websockets in tomcat7.


On Mon, Apr 8, 2013 at 2:41 PM,  wrote:

> Hi all !
>
> I would like to use web socket, and I started looking to do so with tomcat
> API.
> I'm currently using Tomcat 7.0.37 on Windows Seven, integrated in Eclipse
> Juno.
>
> I tried to follow the example code from tomcat documentation, and read the
> associated JavaDoc for package org.apache.catalina.websocket. The example
> is
> supposed to be a chat application. Here is the link for the documentation :
> http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html
>
>
> I'm also using maven for the project, so I added this to my pom.xml :
>
> 
> org.apache.tomcat
> tomcat-catalina
> 7.0.39
> provided
> 
>
> First thing that's weird, I get an error message in Eclipse for this line :
>
> private class MyMessageInbound extends MessageInbound
>
> The error message is "The hierarchy of the type MyMessageInbound is
> inconsistent",
> but I'm still able to compile and launch the webapp from Eclipse.
>
> I also added the configuration in the web.xml as follow:
>
> 
> wsChat
> websocket.chat.ChatWebSocketServlet
> 1
> 
>
> 
> wsChat
> /websocket/chat
> 
>
> So, I'm able to launch the webapp, but when I go to the chat page, I get
> an error
> on the chat board saying "Info: WebSocket closed.". Tomcat log give me the
> following message:
>
> SEVERE: Servlet.service() for servlet [wsChat] in context with path
> [/websocket-tuto] threw exception [L''exécution de la servlet a lancé une
> exception]
> with root cause
> java.lang.NoSuchMethodError:
> websocket.chat.ChatWebSocketServlet$MyMessageInbound.(Lwebsocket/chat/ChatWebSocketServlet;Luwebsocket/chat/ChatWebSocketServlet$MyMessageInbound;)V
> at
> websocket.chat.ChatWebSocketServlet.createWebSocketInbound(ChatWebSocketServlet.java:34)
> at
> org.apache.catalina.websocket.WebSocketServlet.doGet(WebSocketServlet.java:121)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> Anyone see what could be my problem, or what I'm doing wrong ?
>
> Thanks !
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*


Using websocket with Tomcat 7.0.37

2013-04-08 Thread eric . robert . c
Hi all !

I would like to use web socket, and I started looking to do so with tomcat API. 
I'm currently using Tomcat 7.0.37 on Windows Seven, integrated in Eclipse Juno.

I tried to follow the example code from tomcat documentation, and read the 
associated JavaDoc for package org.apache.catalina.websocket. The example is 
supposed to be a chat application. Here is the link for the documentation :
http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html


I'm also using maven for the project, so I added this to my pom.xml :


org.apache.tomcat
tomcat-catalina
7.0.39
provided


First thing that's weird, I get an error message in Eclipse for this line :

private class MyMessageInbound extends MessageInbound

The error message is "The hierarchy of the type MyMessageInbound is 
inconsistent", 
but I'm still able to compile and launch the webapp from Eclipse.

I also added the configuration in the web.xml as follow:


wsChat
websocket.chat.ChatWebSocketServlet
1



wsChat
/websocket/chat


So, I'm able to launch the webapp, but when I go to the chat page, I get an 
error 
on the chat board saying "Info: WebSocket closed.". Tomcat log give me the 
following message:

SEVERE: Servlet.service() for servlet [wsChat] in context with path 
[/websocket-tuto] threw exception [L''exécution de la servlet a lancé une 
exception] 
with root cause
java.lang.NoSuchMethodError: 
websocket.chat.ChatWebSocketServlet$MyMessageInbound.(Lwebsocket/chat/ChatWebSocketServlet;Luwebsocket/chat/ChatWebSocketServlet$MyMessageInbound;)V
at 
websocket.chat.ChatWebSocketServlet.createWebSocketInbound(ChatWebSocketServlet.java:34)
at 
org.apache.catalina.websocket.WebSocketServlet.doGet(WebSocketServlet.java:121)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Anyone see what could be my problem, or what I'm doing wrong ?

Thanks !

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