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

NPE on Jetty 9.3 when closing tab with @Push(transport = Transport.WEBSOCKET_XH #7602

Closed
vaadin-bot opened this issue Apr 15, 2016 · 10 comments

Comments

@vaadin-bot
Copy link
Collaborator

Originally by mvysny2


Please see the discussion here for the bug description:

https://vaadin.com/forum#!/thread/10309898

The issue also persists in Vaadin 7.6.4, but only when the tab is closed, as described here:

https://vaadin.com/forum#!/thread/12832757

It seems that this was caused by a bug in Atmosphere:

Atmosphere/atmosphere#1998

which has been fixed in Atmosphere 2.3.3. Newest Atmosphere is 2.4.3 yet Vaadin is still using its custom-patched 2.2.7.

Would you please consider upgrading the Atmosphere to a newer version? Thank you (and I can not thank you enough for creating such a wonderful and easy-to-use framework that Vaadin is).


Imported from https://dev.vaadin.com/ issue #19742

@vaadin-bot
Copy link
Collaborator Author

Originally by proaccountapp


Updated prioritization date.

@vaadin-bot
Copy link
Collaborator Author

Originally by mvysny2


Easily reproducible: just checkout https://github.com/mvysny/pokusy_kotlinee, run it in Jetty and refresh the page multiple times, or close the tab.

@vaadin-bot
Copy link
Collaborator Author

Originally by @Artur-


Have you tried using standard JSR-356 websockets? @WebInitParam(name # "org.atmosphere.cpr.asyncSupport", value"org.atmosphere.container.JSR356AsyncSupport")). Those should work. It seems Atmosphere still has issues with native Jetty websockets in 9.3, also in the latest version

@vaadin-bot
Copy link
Collaborator Author

Originally by @Artur-


Actually JSR 356 seems to have the same problems. Could be a Jetty 9.3 issue

@vaadin-bot
Copy link
Collaborator Author

Originally by mvysny2


Thank you for the information. The effect of the @WebInitParam annotation seem to work for me: I can no longer observe the NPE exception in the log anymore. Please see the log excerpt below:

11:53:02.100 [Scanner-1] WARN  o.jboss.resteasy.resteasy_jaxrs.i18n - RESTEASY002155: Provider class org.jboss.resteasy.plugins.providers.DataSourceProvider is already registered.  2nd registration is being ignored.
11:53:02.100 [Scanner-1] WARN  o.jboss.resteasy.resteasy_jaxrs.i18n - RESTEASY002155: Provider class org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor is already registered.  2nd registration is being ignored.
11:53:02.100 [Scanner-1] WARN  o.jboss.resteasy.resteasy_jaxrs.i18n - RESTEASY002155: Provider class org.jboss.resteasy.plugins.providers.SourceProvider is already registered.  2nd registration is being ignored.
2016-05-02 11:53:02.248:INFO:oejsh.ContextHandler:Scanner-1: Started o.e.j.w.WebAppContext@15667465{/,file:///home/vyzivus/work/my/kotlinee/out/artifacts/kotlinee-example-crud/exploded/kotlinee-example-crud-1.0-SNAPSHOT.war/,AVAILABLE}
[2016-05-02 11:53:02,652] Artifact Gradle : com.github.kotlinee : kotlinee-example-crud-1.0-SNAPSHOT.war (exploded): Artifact is deployed successfully
[2016-05-02 11:53:02,652] Artifact Gradle : com.github.kotlinee : kotlinee-example-crud-1.0-SNAPSHOT.war (exploded): Deploy took 6,686 milliseconds
May 02, 2016 11:53:02 AM com.vaadin.server.DefaultDeploymentConfiguration checkProductionMode
WARNING: 
=================================================================
Vaadin is running in DEBUG MODE.
Add productionMode=true to web.xml to disable debug features.
To show debug window, add ?debug to your application URL.
=================================================================
LastAddedPersonCache created
May 02, 2016 11:53:14 AM com.vaadin.server.communication.PushHandler connectionLost
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.
11:53:21.725 [qtp517052730-44] INFO  o.h.h.i.QueryTranslatorFactoryInitiator - HHH000397: Using ASTQueryTranslatorFactory
May 02, 2016 11:55:17 AM com.vaadin.server.communication.PushHandler connectionLost
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.
May 02, 2016 11:55:20 AM com.vaadin.server.communication.PushHandler connectionLost
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.

There is a new log message regarding the slower UI lookup, but the exception is gone. If I revert to the old code and remove the @WebInitParam annotation, the exception is back, thrown when I simply hit F5 in Firefox:

May 02, 2016 11:56:45 AM org.atmosphere.cpr.AsynchronousProcessor completeLifecycle
SEVERE: Failed to cancel resource: 76c60216-4813-4e9c-bc66-ddecef393dca
java.lang.NullPointerException
	at org.eclipse.jetty.server.Request.extractQueryParameters(Request.java:371)
	at org.eclipse.jetty.server.Request.extractParameters(Request.java:357)
	at org.eclipse.jetty.server.Request.getParameter(Request.java:989)
	at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:194)
	at org.atmosphere.cpr.AtmosphereRequest.getParameter(AtmosphereRequest.java:456)
	at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:194)
	at com.vaadin.server.VaadinService.hasParameter(VaadinService.java:740)
	at com.vaadin.server.VaadinService.doFindOrCreateVaadinSession(VaadinService.java:702)
	at com.vaadin.server.VaadinService.findOrCreateVaadinSession(VaadinService.java:668)
	at com.vaadin.server.VaadinService.findVaadinSession(VaadinService.java:527)
	at com.vaadin.server.communication.PushHandler.connectionLost(PushHandler.java:327)
	at com.vaadin.server.communication.PushAtmosphereHandler.onStateChange(PushAtmosphereHandler.java:60)
	at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:509)
	at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:459)
	at org.atmosphere.cpr.AsynchronousProcessor.endRequest(AsynchronousProcessor.java:566)
	at org.atmosphere.websocket.DefaultWebSocketProcessor.close(DefaultWebSocketProcessor.java:634)
	at org.atmosphere.container.Jetty9WebSocketHandler.onWebSocketClose(Jetty9WebSocketHandler.java:66)
	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onClose(JettyListenerEventDriver.java:98)
	at org.eclipse.jetty.websocket.common.WebSocketSession.notifyClose(WebSocketSession.java:405)
	at org.eclipse.jetty.websocket.common.WebSocketSession.onConnectionStateChange(WebSocketSession.java:436)
	at org.eclipse.jetty.websocket.common.io.IOState.notifyStateListeners(IOState.java:184)
	at org.eclipse.jetty.websocket.common.io.IOState.onAbnormalClose(IOState.java:219)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$OnCloseLocalCallback.onLocalClose(AbstractWebSocketConnection.java:163)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$OnCloseLocalCallback.writeSuccess(AbstractWebSocketConnection.java:153)
	at org.eclipse.jetty.websocket.common.io.FrameFlusher.notifyCallbackSuccess(FrameFlusher.java:406)
	at org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.succeedEntries(FrameFlusher.java:241)
	at org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.succeeded(FrameFlusher.java:231)
	at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:332)
	at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:141)
	at org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.flush(FrameFlusher.java:152)
	at org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.process(FrameFlusher.java:216)
	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
	at org.eclipse.jetty.websocket.common.io.FrameFlusher.enqueue(FrameFlusher.java:381)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:610)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onConnectionStateChange(AbstractWebSocketConnection.java:483)
	at org.eclipse.jetty.websocket.common.io.IOState.notifyStateListeners(IOState.java:184)
	at org.eclipse.jetty.websocket.common.io.IOState.onCloseRemote(IOState.java:356)
	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:121)
	at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:367)
	at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:220)
	at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
	at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:256)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:675)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:505)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
	at java.lang.Thread.run(Thread.java:745)

@vaadin-bot
Copy link
Collaborator Author

Originally by mvysny2


I agree that this may be a bug in Jetty, yet from the discussion at Atmosphere/atmosphere#1998 (comment) I am led to believe that the problem is really on Atmosphere's side.

@vaadin-bot
Copy link
Collaborator Author

Originally by @Artur-


Created Atmosphere/atmosphere#2154

@vaadin-bot
Copy link
Collaborator Author

Originally by @Artur-


A potential workaround would be to use Jetty 9.3.1.v20150714 as this seems to be a problem introduced in Jetty 9.3.2

@vaadin-bot
Copy link
Collaborator Author

Originally by @Artur-


Atmosphere/atmosphere#2154 is actually a non-issue which was caused by a too old Java 8 version.

@vaadin-bot
Copy link
Collaborator Author

Originally by @Artur-


https://dev.vaadin.com/review/13564 updates to 2.2.9.vaadin2 which seems to work with Jetty 9.3, both when using JSR-356 and native websockets

@vaadin-bot vaadin-bot added the bug label Dec 10, 2016
@vaadin-bot vaadin-bot added this to the Vaadin 7.7.0.alpha3 milestone Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant