users@glassfish.java.net

[gf-users] Re: Websockets: got 404 on server, but works on localhost (glassfish 4.1 latest)

From: Mladen Adamović <mladen.adamovic_at_gmail.com>
Date: Thu, 12 Feb 2015 20:00:20 +0100

On Thu, Feb 12, 2015 at 6:01 PM, Pavel Bucek <pavel.bucek_at_oracle.com> wrote:

> http://test.heroesofcadwick.com/?url=ws://test.heroesofcadwick.com/
> Websockets/web/test
>
> So do you have any redirect in place? It seems like your app is deployed
> on context path "/WebSockets", but the index.jsp is accessible directly
> from http://test.heroesofcadwick.com/ ...
>
>
I don't have any 301 or 302 redirects in that Websocket application.
That context path always had an issue in Glassfish, i.e. both
http://www.heroesofcadwick.com/
and http://www.heroesofcadwick.com/Heroes/ does work, but for unclear
reasons that
@ServerEndpoint(value = "/web/test")
listenens only on http://www.heroesofcadwick.com//Heroes/web/test
instead of http://www.heroesofcadwick.com/

I have custom iptables since I'm running Glassfish as glassfish user due to
security reasons.
iptables -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 8080

Basically, I know know the workaround for my problem but still that looks
like another Context Path problem.
Context path had one issue always for me, that If I'm accessing
http://www.heroesofcadwick.com (for example) and have link with <a
href="something.html">, it gets forwared to
http://www.heroesofcadwick.com/Heroes/something.html
I never know how to fix it or do other people experience same problem.

Thanks for your help!