From: Ahmed A. <asa...@ya...> - 2017-05-02 08:00:38
|
Hi Ian, We have this error on the test suite as well, and the reason is because the client-side tries to connect to non-existing WebSocket URL. However, if you have this error, with a correct server-side part, then it needs to be tackled. Please try to isolate a minimal case as in https://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocketTest.java#l41 Ahmed From: Ian Clarke <ian...@gm...> To: htm...@li... Sent: Monday, May 1, 2017 6:34 PM Subject: [Htmlunit-user] Help with UpgradeException #yiv7784256793 * a:hover{cursor:pointer;} #yiv7784256793 body {} _filtered #yiv7784256793 {}#yiv7784256793 to {position:relative;}#yiv7784256793 #yiv7784256793 a {word-wrap:normal;}#yiv7784256793 .yiv7784256793background-contain {background-size:contain;}@media screen and (max-width:600px){#yiv7784256793 .yiv7784256793container {}#yiv7784256793 .yiv7784256793container, #yiv7784256793 .yiv7784256793palm-one-whole {width:100% !important;min-width:100% !important;}#yiv7784256793 .yiv7784256793palm-one-half {width:50% !important;min-width:50% !important;}#yiv7784256793 blockquote .yiv7784256793container, #yiv7784256793 blockquote .yiv7784256793container div, #yiv7784256793 blockquote .yiv7784256793container table {width:auto !important;min-width:0 !important;position:relative;}#yiv7784256793 img {max-width:100%;}#yiv7784256793 .yiv7784256793border-outer, #yiv7784256793 .yiv7784256793border-middle, #yiv7784256793 .yiv7784256793border-inner, #yiv7784256793 .yiv7784256793inner, #yiv7784256793 .filtered99999 {width:100% !important;}#yiv7784256793 .yiv7784256793innercell {padding:8px !important;}#yiv7784256793 .yiv7784256793palm-block {display:block;}#yiv7784256793 td.yiv7784256793palm-one-whole {display:inline-block;padding:0;}#yiv7784256793 td.yiv7784256793palm-one-whole:first-child:not {margin-bottom:16px;}#yiv7784256793 td.yiv7784256793hostname {padding-top:3px !important;}}@media screen and (min-width:601px){#yiv7784256793 .yiv7784256793preview-card {max-width:600px !important;}}@media screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a )screen and ( _filtered_a )screen and ( _filtered_a ){#yiv7784256793 .yiv7784256793container {width:100% !important;min-width:100% !important;}#yiv7784256793 .yiv7784256793p, #yiv7784256793 .yiv7784256793small, #yiv7784256793 li, #yiv7784256793 font .filtered99999 , #yiv7784256793 font .filtered99999 {font-size:1em !important;}}@media screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a )and ( _filtered_a )screen and ( _filtered_a ){#yiv7784256793 .yiv7784256793message-wrapper {padding-top:6px;}#yiv7784256793 .yiv7784256793apple-only .filtered99999 {display:block;max-height:none !important;line-height:normal !important;overflow:visible;height:auto !important;width:100% !important;position:relative;}#yiv7784256793 .yiv7784256793no-apple {display:none;}#yiv7784256793 form {font-size:inherit;}#yiv7784256793 input .filtered99999 {height:43px;padding-left:4px !important;}#yiv7784256793 button:hover {cursor:pointer;}}@media screen and ( _filtered_a ){#yiv7784256793 .yiv7784256793apple-mail-form {display:block;background-color:white;}}#yiv7784256793 * .filtered99999 .yiv7784256793outlook-com-hidden {display:none;}#yiv7784256793 * .filtered99999 .yiv7784256793outlook-com-button {display:block;}#yiv7784256793 * .filtered99999 .yiv7784256793outlook-com-only {display:block;max-height:none !important;line-height:normal !important;overflow:visible;height:auto !important;width:100% !important;position:relative;}#yiv7784256793 .yiv7784256793ExternalClass {width:100%;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793outlook-com-button {display:block;}#yiv7784256793 .yiv7784256793ExternalClass button {height:auto;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793outlook-com-hidden {display:none;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793outlook-com-only {display:block;max-height:none !important;line-height:normal !important;overflow:visible;height:auto !important;width:100% !important;position:relative;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793ecxlabels {display:none;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793ecxlabels {display:none;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793ecxarrow {display:none;}#yiv7784256793 .yiv7784256793ExternalClass cite >div + div {padding:0 0 4px 0;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793h1 {padding-bottom:5px;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793h2 {padding-bottom:5px;}#yiv7784256793 .yiv7784256793ExternalClass .yiv7784256793h3 {padding-bottom:5px;}#yiv7784256793 .yiv7784256793ExternalClass .filtered99999 {width:280px !important;} | I seem to get this exception fairly consistently on startup. I'm using htmlunit to tests a page that is delivered to the client, and the client then connects to the server via a websocket. But it's unclear what the root cause is, here is the full exception: May 01, 2017 12:55:58 AM com.gargoylesoftware.htmlunit.javascript.host.WebSocket runSEVERE: WS connect errorjava.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 0 null at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2237) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket$1.run(WebSocket.java:151) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745)Caused by: org.eclipse.jetty.websocket.api.UpgradeException: 0 null at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:513) at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193) at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185) at org.eclipse.jetty.client.HttpExchange.notifyFailureComplete(HttpExchange.java:269) at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:240) at org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:141) at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:735) at org.eclipse.jetty.client.HttpDestination.abort(HttpDestination.java:444) at org.eclipse.jetty.client.HttpDestination.close(HttpDestination.java:366) at org.eclipse.jetty.client.HttpClient.doStop(HttpClient.java:247) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160) at org.eclipse.jetty.websocket.client.WebSocketClient.doStop(WebSocketClient.java:376) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket.close(WebSocket.java:347) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket.close(WebSocket.java:325) at com.gargoylesoftware.htmlunit.html.HtmlPage.cleanUp(HtmlPage.java:328) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:516) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:459) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at io.kweb.routing.RoutingSpec$1$3.invoke(RoutingSpec.kt:59) at io.kweb.routing.RoutingSpec$1$3.invoke(RoutingSpec.kt:20) at io.kotlintest.specs.FreeSpec.minus(FreeSpec.kt:23) at io.kweb.routing.RoutingSpec$1.invoke(RoutingSpec.kt:58) at io.kweb.routing.RoutingSpec$1.invoke(RoutingSpec.kt:20) at io.kotlintest.specs.FreeSpec.minus(FreeSpec.kt:23) at io.kweb.routing.RoutingSpec.<init>(RoutingSpec.kt:24) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at java.lang.Class.newInstance(Class.java:438) at io.kotlintest.KTestJUnitRunner.<init>(KTestJUnitRunner.kt:9) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)Caused by: java.nio.channels.AsynchronousCloseException ... 42 more May 01, 2017 12:56:13 AM com.gargoylesoftware.htmlunit.javascript.host.WebSocket runSEVERE: WS connect errorjava.lang.InterruptedException at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2225) at com.gargoylesoftware.htmlunit.javascript.host.WebSocket$1.run(WebSocket.java:151) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745) Process finished with exit code 0 Ian Clarkehttp://blog.locut.us/ | ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |