Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-24 Thread Thusitha Thilina Dayaratne
Hi,

First I would like to apologize for the inconvenience.
On 4/24/15 7:40 AM, Thusitha Thilina Dayaratne wrote:
> Furthermore I've tried following things out and both options works
> without issue.
>
> 1. Running tomcat distributed examples in my server 2. Running the
> war file that I built inside Tomcat
>
> I've mistaken here. My war file doesn't run on Tomcat either.
>
>
> When I used the following dependency to build the example webapp,
> instead of 302 I'm getting 404 error.
>
>  javax.websocket
> javax.websocket-api
> 1.0 provided 
>
> Am I having wrong dependency here? If so what are the dependencies
> that I should include when do the build?

>>You aren't getting very many responses, here.

>>The problem is that you are asking for solutions to problems that
>>nobody understands. You are asking us "why doesn't this work", but you
>>haven't told us what it is.

>>Imagine that I am writing a web application that needs to process
>>financial transactions (e.g. DEBIT, CREDIT), and it's not working for
>>some reason. If I asked you "why does my web application return 404",
>>but didn't provide any code, or any explanation of the architecture,
>>or any of that, you would have no idea what could possibly be wrong
>>with my code. It could be simple a configuration problem. It could be
>>a complete misunderstanding of how a web application works. It could
>>be a very rarely-seen bug that only occurs when users with an account
>>number that happens to be a prime number plus one try to do a DEBIT
>>operation.

>>So, take a step back.

>>The Tomcat distributed examples work. That's great: it means that
>>Tomcat itself is capable of running Websocket applications.

>>Your application does not work: it seemed to be returning a 302 error
>>which may suggest that the Websocket library hasn't properly initialized
.

>>Are you using Tomcat in an embedded way, or are you launching it from
>>the traditional bin/startup.sh, etc. way? Are you trying to side-load
>>the Websocket library, or are you expecting that Tomcat will
>>auto-detect and initialize it? Does your own code include anything
>>other than servlets that request an upgrade to a Websocket connection
>>and then do their thing?


>>Remember that none of us has even a passing understanding of what you
>>are trying to build, how you are building it, what the Maven
>>dependencies are (or even mean, in some cases), etc. You need to tell
>>us all of that to give us some context.

>>Then we might be able to help you.

I will rephrase my question
I'm using embedded tomcat version 8.0.20. We have created an application
server on top of that and we are packing tomcat provided example webapp
with that.
I get the source of the example webapp in Tomcat (I don't change any code
in that and use that as it is provided) and use Maven in order to build the
sample webapp. In that for websocket I'm using following dependency


  javax.websocket
  javax.websocket-api
  1.0
  provided

I've bundle following tomcat websocket dependencies as OSGi bundle and
using that in the server.

org.apache.tomcat.embed
tomcat-embed-jasper
8.0.20
true


org.apache.tomcat
tomcat-websocket-api
8.0.20
true

This OSGi bundle is available with the server.

After building the example webapp, when I try to run the wesocket examples
in that webapp on my server, I'm getting

Info: WebSocket connection closed, Code: 1006


In the browser console it prints (for echo programmatic option in the echo
sample)

WebSocket connection to 'ws://
> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
> during WebSocket handshake: Unexpected response code: 302


I tried to deploy the same example which is distributed with Tomcat
distribution on my server.
It run on my server without any issue.

Thanks
Best Regards

2015-04-24 19:25 GMT+05:30 Christopher Schultz 

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Thusitha,
>
> On 4/24/15 7:40 AM, Thusitha Thilina Dayaratne wrote:
> > Furthermore I've tried following things out and both options works
> > without issue.
> >
> > 1. Running tomcat distributed examples in my server 2. Running the
> > war file that I built inside Tomcat
> >
> > I've mistaken here. My war file doesn't run on Tomcat either.
> >
> >
> > When I used the following dependency to build the example webapp,
> > instead of 302 I'm getting 404 error.
> >
> >  javax.websocket
> > javax.websocket-api
> > 1.0 provided 
> >
> > Am I having wrong dependency here? If so what are the dependencies
> > that I should include when do the build?
>
> You aren't getting very many responses, here.
>
> The problem is that you are asking for solutions to problems that
> nobody understands. You are asking us "why doesn't this work", but you
> haven't told us what it is.
>
> Imagine that I am writing a web application that needs to process
> financial transactions (e.g. DEBIT, CREDIT), and it's not working for
> some reason. If I asked you "why does my web applicati

Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Thusitha,

On 4/24/15 7:40 AM, Thusitha Thilina Dayaratne wrote:
> Furthermore I've tried following things out and both options works
> without issue.
> 
> 1. Running tomcat distributed examples in my server 2. Running the
> war file that I built inside Tomcat
> 
> I've mistaken here. My war file doesn't run on Tomcat either.
> 
> 
> When I used the following dependency to build the example webapp,
> instead of 302 I'm getting 404 error.
> 
>  javax.websocket 
> javax.websocket-api 
> 1.0 provided 
> 
> Am I having wrong dependency here? If so what are the dependencies
> that I should include when do the build?

You aren't getting very many responses, here.

The problem is that you are asking for solutions to problems that
nobody understands. You are asking us "why doesn't this work", but you
haven't told us what it is.

Imagine that I am writing a web application that needs to process
financial transactions (e.g. DEBIT, CREDIT), and it's not working for
some reason. If I asked you "why does my web application return 404",
but didn't provide any code, or any explanation of the architecture,
or any of that, you would have no idea what could possibly be wrong
with my code. It could be simple a configuration problem. It could be
a complete misunderstanding of how a web application works. It could
be a very rarely-seen bug that only occurs when users with an account
number that happens to be a prime number plus one try to do a DEBIT
operation.

So, take a step back.

The Tomcat distributed examples work. That's great: it means that
Tomcat itself is capable of running Websocket applications.

Your application does not work: it seemed to be returning a 302 error
which may suggest that the Websocket library hasn't properly initialized
.

Are you using Tomcat in an embedded way, or are you launching it from
the traditional bin/startup.sh, etc. way? Are you trying to side-load
the Websocket library, or are you expecting that Tomcat will
auto-detect and initialize it? Does your own code include anything
other than servlets that request an upgrade to a Websocket connection
and then do their thing?

Without this information, nobody will be able to help you.

It's frustrating to have to beg for information in order to help
people. You have posted a lot of questions recently on this list where
the responses are all of the form "I can't help because you haven't
provided enough information". Your responses tend to ask new questions
and not really provide that vital information to help you.

None of us are paid for the time we spend answering questions on this
mailing list -- at least, nobody that I know of. At some point, people
stop bothering to ask, because they just expect that you are going to
ignore the requests for more information and they will still be unable
to help.

So, again: take a step back.

Remember that none of us has even a passing understanding of what you
are trying to build, how you are building it, what the Maven
dependencies are (or even mean, in some cases), etc. You need to tell
us all of that to give us some context.

Then we might be able to help you.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOktUAAoJEBzwKT+lPKRYwS0P/RswUwhyBqD+B8R4TPQz+Mua
vsMi6vuCmX+9NrVM2iUrArLxbhsg3fCkHOqGRPmYHGomhXrNdBV5O69Uw6wFItB6
l+ZneFKvK5W4b30BKwLtvaSycqy8LonSFo0dxE9fAVIsACpF7BqxEO6RJHyZKbiA
aVHZY32xadX5DfN1I7h+eNwsET68dg1208tzleB3n1lepcdRWgZA73eeI/91quIr
f2qd0Ui/a9q+CoXopo3kuGLmGU1t2rwkPV6IU+ViDe9A4s32749mrKTYbMDmevWD
ItyUpKE0o69sGKq7FR8tt0q8oR3UD0XldbO+hLc73iNPKUFdVLx0vreDdn+kgvyd
thbQKuJlFa13Y/3BTWlHUFl2xekxwP8Qsy3E1Q/WH8wer45Oizzu3/kpGW6o29FO
HYxI+ZwrKi6yUp7kB1Xde1In6/vd/3/ja7GKKQxetleyC8JGS0p391VvggUKdybO
T/g5xt/b5rZm+nVfjSB4Cv7PSXLe9/LKOmD6Lq9on2SredXIpR8j1WzCN3vufC3H
uyayIEonW2fB0Fkwim/9Ku410vUrHGLFK4g9QkR/wN6Z04/Qr+RhnFlKEfPmuwYH
COAE8ap1D4q/lVdTFNvbk3HpozLfw+4Sfrz6R11fha6XwxFGxyNIbWsUuUt/Zy3a
jYzRJ3hwlnMkjZWe5Wdc
=brQN
-END PGP SIGNATURE-

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



Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-24 Thread Thusitha Thilina Dayaratne
Hi,

Hi,

> Hi,
>
> I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> example and when I'm trying to run it in my server for all 4 examples
> (Echo, chat, etc..)
> I'm getting
>
>> Info: WebSocket connection closed, Code: 1006
>
>
> In the console it prints
>
> WebSocket connection to 'ws://
>> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> during WebSocket handshake: Unexpected response code: 302
>
>
> This same war file is running perfectly on Tomcat distribution.
>
> Can someone tell me what could be the reason for this?

>>It looks like you haven't deployed the WebSocket examples correctly. My
>>guess is you are seeing the 302 redirect to
>>/examples/websocket/echoProgrammatic/ you'd get if this was being
>>handled as a static resource.
>>Thanks for quick response. But I think you misunderstood what I mean.
>>I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
failed: Error during WebSocket handshake: Unexpected response code: 302
>>I'm getting that for the echo sample programmatic API option.

>>For each and every websocket sample I'm getting Info: WebSocket
connection closed, Code: 1006
>>And in the console it says something like
>>WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
... failed:
Error during WebSocket handshake: Unexpected response code: 302

>>>When I tried to deploy the sample distributed with Tomcat it works fine
in my server.
>>>Seems that I did something wrong while building the sample. Can someone
help me out?

Furthermore I've tried following things out and both options works without
issue.

   1. Running tomcat distributed examples in my server
   2. Running the war file that I built inside Tomcat

I've mistaken here. My war file doesn't run on Tomcat either.


When I used the following dependency to build the example webapp, instead
of 302 I'm getting 404 error.


javax.websocket
javax.websocket-api
1.0
provided


Am I having wrong dependency here? If so what are the dependencies that I
should include when do the build?

Thanks
Best Regards


2015-04-24 11:13 GMT+05:30 Thusitha Thilina Dayaratne <
thusithathil...@gmail.com>:

> Hi,
>
> > Hi,
> >
> > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> > example and when I'm trying to run it in my server for all 4 examples
> > (Echo, chat, etc..)
> > I'm getting
> >
> >> Info: WebSocket connection closed, Code: 1006
> >
> >
> > In the console it prints
> >
> > WebSocket connection to 'ws://
> >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
> >> during WebSocket handshake: Unexpected response code: 302
> >
> >
> > This same war file is running perfectly on Tomcat distribution.
> >
> > Can someone tell me what could be the reason for this?
>
> >>It looks like you haven't deployed the WebSocket examples correctly. My
> >>guess is you are seeing the 302 redirect to
> >>/examples/websocket/echoProgrammatic/ you'd get if this was being
> >>handled as a static resource.
> >>Thanks for quick response. But I think you misunderstood what I mean.
> >>I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
> failed: Error during WebSocket handshake: Unexpected response code: 302
> >>I'm getting that for the echo sample programmatic API option.
>
> >>For each and every websocket sample I'm getting Info: WebSocket
> connection closed, Code: 1006
> >>And in the console it says something like
> >>WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
> ... failed:
> Error during WebSocket handshake: Unexpected response code: 302
>
> >>>When I tried to deploy the sample distributed with Tomcat it works fine
> in my server.
> >>>Seems that I did something wrong while building the sample. Can someone
> help me out?
>
> Furthermore I've tried following things out and both options works without
> issue.
>
>1. Running tomcat distributed examples in my server
>2. Running the war file that I built inside Tomcat
>
> The only thing that doesn't work is when try to run the war file that I
> built in my server.
>
> 2015-04-24 10:59 GMT+05:30 Thusitha Thilina Dayaratne <
> thusithathil...@gmail.com>:
>
>> Hi,
>>
>> > Hi,
>> >
>> > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
>> > example and when I'm trying to run it in my server for all 4 examples
>> > (Echo, chat, etc..)
>> > I'm getting
>> >
>> >> Info: WebSocket connection closed, Code: 1006
>> >
>> >
>> > In the console it prints
>> >
>> > WebSocket connection to 'ws://
>> >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> >> during WebSocket handshake: Unexpected response code: 302
>> >
>> >
>> > This same war file is running perfectly on Tomcat distribution.
>> >
>> > Can someone tell me what could be the reason for this?
>>
>> >>It looks like you haven't d

Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-23 Thread Thusitha Thilina Dayaratne
Hi,

> Hi,
>
> I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> example and when I'm trying to run it in my server for all 4 examples
> (Echo, chat, etc..)
> I'm getting
>
>> Info: WebSocket connection closed, Code: 1006
>
>
> In the console it prints
>
> WebSocket connection to 'ws://
>> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> during WebSocket handshake: Unexpected response code: 302
>
>
> This same war file is running perfectly on Tomcat distribution.
>
> Can someone tell me what could be the reason for this?

>>It looks like you haven't deployed the WebSocket examples correctly. My
>>guess is you are seeing the 302 redirect to
>>/examples/websocket/echoProgrammatic/ you'd get if this was being
>>handled as a static resource.
>>Thanks for quick response. But I think you misunderstood what I mean.
>>I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
failed: Error during WebSocket handshake: Unexpected response code: 302
>>I'm getting that for the echo sample programmatic API option.

>>For each and every websocket sample I'm getting Info: WebSocket
connection closed, Code: 1006
>>And in the console it says something like
>>WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
... failed:
Error during WebSocket handshake: Unexpected response code: 302

>>>When I tried to deploy the sample distributed with Tomcat it works fine
in my server.
>>>Seems that I did something wrong while building the sample. Can someone
help me out?

Furthermore I've tried following things out and both options works without
issue.

   1. Running tomcat distributed examples in my server
   2. Running the war file that I built inside Tomcat

The only thing that doesn't work is when try to run the war file that I
built in my server.

2015-04-24 10:59 GMT+05:30 Thusitha Thilina Dayaratne <
thusithathil...@gmail.com>:

> Hi,
>
> > Hi,
> >
> > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> > example and when I'm trying to run it in my server for all 4 examples
> > (Echo, chat, etc..)
> > I'm getting
> >
> >> Info: WebSocket connection closed, Code: 1006
> >
> >
> > In the console it prints
> >
> > WebSocket connection to 'ws://
> >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
> >> during WebSocket handshake: Unexpected response code: 302
> >
> >
> > This same war file is running perfectly on Tomcat distribution.
> >
> > Can someone tell me what could be the reason for this?
>
> >>It looks like you haven't deployed the WebSocket examples correctly. My
> >>guess is you are seeing the 302 redirect to
> >>/examples/websocket/echoProgrammatic/ you'd get if this was being
> >>handled as a static resource.
> >>Thanks for quick response. But I think you misunderstood what I mean.
> >>I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
> failed: Error during WebSocket handshake: Unexpected response code: 302
> >>I'm getting that for the echo sample programmatic API option.
>
> >>For each and every websocket sample I'm getting Info: WebSocket
> connection closed, Code: 1006
> >>And in the console it says something like
> >>WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
> ... failed:
> Error during WebSocket handshake: Unexpected response code: 302
>
> When I tried to deploy the sample distributed with Tomcat it works fine in
> my server.
> Seems that I did something wrong while building the sample. Can someone
> help me out?
>
> Thanks
> Best Regards
>
> 2015-04-23 14:06 GMT+05:30 Thusitha Thilina Dayaratne <
> thusithathil...@gmail.com>:
>
>> Hi
>>
>> > Hi,
>> >
>> > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
>> > example and when I'm trying to run it in my server for all 4 examples
>> > (Echo, chat, etc..)
>> > I'm getting
>> >
>> >> Info: WebSocket connection closed, Code: 1006
>> >
>> >
>> > In the console it prints
>> >
>> > WebSocket connection to 'ws://
>> >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> >> during WebSocket handshake: Unexpected response code: 302
>> >
>> >
>> > This same war file is running perfectly on Tomcat distribution.
>> >
>> > Can someone tell me what could be the reason for this?
>>
>> It looks like you haven't deployed the WebSocket examples correctly. My
>> guess is you are seeing the 302 redirect to
>> /examples/websocket/echoProgrammatic/ you'd get if this was being
>> handled as a static resource.
>> Thanks for quick response. But I think you misunderstood what I mean.
>> I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
>> failed: Error during WebSocket handshake: Unexpected response code: 302
>> I'm getting that for the echo sample programmatic API option.
>>
>> For each and every websocket sample I'm getting Info: WebSocket
>> connection 

Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-23 Thread Thusitha Thilina Dayaratne
Hi,

> Hi,
>
> I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> example and when I'm trying to run it in my server for all 4 examples
> (Echo, chat, etc..)
> I'm getting
>
>> Info: WebSocket connection closed, Code: 1006
>
>
> In the console it prints
>
> WebSocket connection to 'ws://
>> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> during WebSocket handshake: Unexpected response code: 302
>
>
> This same war file is running perfectly on Tomcat distribution.
>
> Can someone tell me what could be the reason for this?

>>It looks like you haven't deployed the WebSocket examples correctly. My
>>guess is you are seeing the 302 redirect to
>>/examples/websocket/echoProgrammatic/ you'd get if this was being
>>handled as a static resource.
>>Thanks for quick response. But I think you misunderstood what I mean.
>>I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
failed: Error during WebSocket handshake: Unexpected response code: 302
>>I'm getting that for the echo sample programmatic API option.

>>For each and every websocket sample I'm getting Info: WebSocket
connection closed, Code: 1006
>>And in the console it says something like
>>WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
... failed:
Error during WebSocket handshake: Unexpected response code: 302

When I tried to deploy the sample distributed with Tomcat it works fine in
my server.
Seems that I did something wrong while building the sample. Can someone
help me out?

Thanks
Best Regards

2015-04-23 14:06 GMT+05:30 Thusitha Thilina Dayaratne <
thusithathil...@gmail.com>:

> Hi
>
> > Hi,
> >
> > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> > example and when I'm trying to run it in my server for all 4 examples
> > (Echo, chat, etc..)
> > I'm getting
> >
> >> Info: WebSocket connection closed, Code: 1006
> >
> >
> > In the console it prints
> >
> > WebSocket connection to 'ws://
> >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
> >> during WebSocket handshake: Unexpected response code: 302
> >
> >
> > This same war file is running perfectly on Tomcat distribution.
> >
> > Can someone tell me what could be the reason for this?
>
> It looks like you haven't deployed the WebSocket examples correctly. My
> guess is you are seeing the 302 redirect to
> /examples/websocket/echoProgrammatic/ you'd get if this was being
> handled as a static resource.
> Thanks for quick response. But I think you misunderstood what I mean.
> I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
> failed: Error during WebSocket handshake: Unexpected response code: 302
> I'm getting that for the echo sample programmatic API option.
>
> For each and every websocket sample I'm getting Info: WebSocket
> connection closed, Code: 1006
> And in the console it says something like
> WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
> ... failed:
> Error during WebSocket handshake: Unexpected response code: 302
>
> 2015-04-23 12:58 GMT+05:30 Mark Thomas :
>
>> On 23/04/2015 05:51, Thusitha Thilina Dayaratne wrote:
>> > Hi,
>> >
>> > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
>> > example and when I'm trying to run it in my server for all 4 examples
>> > (Echo, chat, etc..)
>> > I'm getting
>> >
>> >> Info: WebSocket connection closed, Code: 1006
>> >
>> >
>> > In the console it prints
>> >
>> > WebSocket connection to 'ws://
>> >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> >> during WebSocket handshake: Unexpected response code: 302
>> >
>> >
>> > This same war file is running perfectly on Tomcat distribution.
>> >
>> > Can someone tell me what could be the reason for this?
>>
>> It looks like you haven't deployed the WebSocket examples correctly. My
>> guess is you are seeing the 302 redirect to
>> /examples/websocket/echoProgrammatic/ you'd get if this was being
>> handled as a static resource.
>>
>> Mark
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>
>
> --
>
>



--


Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-23 Thread Thusitha Thilina Dayaratne
Hi

> Hi,
>
> I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> example and when I'm trying to run it in my server for all 4 examples
> (Echo, chat, etc..)
> I'm getting
>
>> Info: WebSocket connection closed, Code: 1006
>
>
> In the console it prints
>
> WebSocket connection to 'ws://
>> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> during WebSocket handshake: Unexpected response code: 302
>
>
> This same war file is running perfectly on Tomcat distribution.
>
> Can someone tell me what could be the reason for this?

It looks like you haven't deployed the WebSocket examples correctly. My
guess is you are seeing the 302 redirect to
/examples/websocket/echoProgrammatic/ you'd get if this was being
handled as a static resource.
Thanks for quick response. But I think you misunderstood what I mean.
I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
failed: Error during WebSocket handshake: Unexpected response code: 302
I'm getting that for the echo sample programmatic API option.

For each and every websocket sample I'm getting Info: WebSocket connection
closed, Code: 1006
And in the console it says something like
WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
... failed:
Error during WebSocket handshake: Unexpected response code: 302

2015-04-23 12:58 GMT+05:30 Mark Thomas :

> On 23/04/2015 05:51, Thusitha Thilina Dayaratne wrote:
> > Hi,
> >
> > I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> > example and when I'm trying to run it in my server for all 4 examples
> > (Echo, chat, etc..)
> > I'm getting
> >
> >> Info: WebSocket connection closed, Code: 1006
> >
> >
> > In the console it prints
> >
> > WebSocket connection to 'ws://
> >> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
> >> during WebSocket handshake: Unexpected response code: 302
> >
> >
> > This same war file is running perfectly on Tomcat distribution.
> >
> > Can someone tell me what could be the reason for this?
>
> It looks like you haven't deployed the WebSocket examples correctly. My
> guess is you are seeing the 302 redirect to
> /examples/websocket/echoProgrammatic/ you'd get if this was being
> handled as a static resource.
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


--


Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-23 Thread Mark Thomas
On 23/04/2015 05:51, Thusitha Thilina Dayaratne wrote:
> Hi,
> 
> I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> example and when I'm trying to run it in my server for all 4 examples
> (Echo, chat, etc..)
> I'm getting
> 
>> Info: WebSocket connection closed, Code: 1006
> 
> 
> In the console it prints
> 
> WebSocket connection to 'ws://
>> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> during WebSocket handshake: Unexpected response code: 302
> 
> 
> This same war file is running perfectly on Tomcat distribution.
> 
> Can someone tell me what could be the reason for this?

It looks like you haven't deployed the WebSocket examples correctly. My
guess is you are seeing the 302 redirect to
/examples/websocket/echoProgrammatic/ you'd get if this was being
handled as a static resource.

Mark


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



Re: "Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-22 Thread Thusitha Thilina Dayaratne
Hi


>I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
example and when I'm trying to run it in my server for all 4 examples
(Echo, chat, etc..)
>I'm getting

> Info: WebSocket connection closed, Code: 1006


>In the console it prints

WebSocket connection to 'ws://
> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
> during WebSocket handshake: Unexpected response code: 302


>This same war file is running perfectly on Tomcat distribution.

>Can someone tell me what could be the reason for this?

I'm able to connect to "ws://echo.websocket.org" But not to the "ws://
localhost:9763/examples/websocket/echoProgrammatic
"
(My server is running 9763)

2015-04-23 10:21 GMT+05:30 Thusitha Thilina Dayaratne <
thusithathil...@gmail.com>:

> Hi,
>
> I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
> example and when I'm trying to run it in my server for all 4 examples
> (Echo, chat, etc..)
> I'm getting
>
>> Info: WebSocket connection closed, Code: 1006
>
>
> In the console it prints
>
> WebSocket connection to 'ws://
>> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
>> during WebSocket handshake: Unexpected response code: 302
>
>
> This same war file is running perfectly on Tomcat distribution.
>
> Can someone tell me what could be the reason for this?
>
> In the pom, my dependency is as follows
> 
> org.apache.tomcat
> tomcat-websocket
> 8.0.20
> 
>
>
> Thanks
> Best Regards
> --
>
>



--


"Info: WebSocket connection closed, Code: 1006" when try to run websocket sample

2015-04-22 Thread Thusitha Thilina Dayaratne
Hi,

I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
example and when I'm trying to run it in my server for all 4 examples
(Echo, chat, etc..)
I'm getting

> Info: WebSocket connection closed, Code: 1006


In the console it prints

WebSocket connection to 'ws://
> 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
> during WebSocket handshake: Unexpected response code: 302


This same war file is running perfectly on Tomcat distribution.

Can someone tell me what could be the reason for this?

In the pom, my dependency is as follows

org.apache.tomcat
tomcat-websocket
8.0.20



Thanks
Best Regards
--