Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grizzly2WebSocketSupport: pathInfo in HttpServletRequestImpl null #581

Closed
dermarens opened this issue Aug 30, 2012 · 2 comments
Closed

Grizzly2WebSocketSupport: pathInfo in HttpServletRequestImpl null #581

dermarens opened this issue Aug 30, 2012 · 2 comments

Comments

@dermarens
Copy link
Contributor

getPathInfo() in org.glassfish.grizzly.servlet.HttpServletRequestImpl returns null and causes

java.lang.NullPointerException
at org.atmosphere.container.Grizzly2WebSocketSupport$Grizzly2WebSocketApplication.onConnect(Grizzly2WebSocketSupport.java:144)
at org.glassfish.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:136)
at org.glassfish.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:174)
at org.glassfish.grizzly.websockets.WebSocketFilter.handleServerHandshake(WebSocketFilter.java:318)
at org.glassfish.grizzly.websockets.WebSocketFilter.handleHandshake(WebSocketFilter.java:277)
at org.glassfish.grizzly.websockets.WebSocketFilter.handleRead(WebSocketFilter.java:199)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547)
at java.lang.Thread.run(Thread.java:662)

This can be reproduced with e.g. the atmosphere-samples/chat application.

@dermarens
Copy link
Contributor Author

You might want some more infos about the request:
HttpRequestPacket (
method=GET
url=/realtime/atmosphere/chat
query=X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.0&X-Atmosphere-Transport=websocket&X-Cache-Date=0&Content-Type=application/json&negotiating=true
protocol=HTTP/1.1
content-length=-1
headers=[
host=localhost:8080
user-agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0
accept=text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
accept-language=en-us,en;q=0.5
accept-encoding=gzip, deflate
dnt=1
connection=keep-alive, Upgrade
sec-websocket-version=13
origin=http://localhost:8080
sec-websocket-key=T8x4ah8rcn+7UvhotcK1Zw==
pragma=no-cache
cache-control=no-cache
upgrade=websocket]
)

so the parts of the Uri should be:
contextPath = /realtime
servletPath= /atmosphere
pathInfo = /chat

but all 3 are null in the request object below the HttpServletRequest

@dermarens
Copy link
Contributor Author

This is fixed with efb847e
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant