Hi,
Now I have some kind of an issue with the configuration of Vaadin itself, as I can see the following error messages in the console log:
WebSocket connection to 'ws://localhost:8080/app/PUSH?v-uiId=0&v-csrfToken=19ad1e55-5182-4668-8ae8-9923cee819dc&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.13.vaadin3-jquery&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json;%20charset=UTF-8&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 500
Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent).
Websocket closed, wasClean: false
Websocket failed. Downgrading to Comet and resending
and then in every couple of seconds I get
vaadinPush.js?v2017_02_01_09_36:26 GET http://localhost:8080/app/PUSH?v-uiId=0&v-csrfToken=19ad1e55-5182-4668-8ae8…plication%2Fjson%3B%20charset%3DUTF-8&X-atmo-protocol=true&_=1485941974997 500 (Internal Server Error)
Could you please point me out how to fix this?
Thank you for your help:
Gabor
Do you use Jetty or Tomcat? Is there any jetty jar in your tomcat instance?
If you use Jetty, have you installed WebSockets module for Jetty? It is required and If you cannot install WebSockets module then you can use fallback to the long-polling mechanism using cuba.web.pushLongPolling application property set to true. See also: Server Push Settings - CUBA Platform. Developer’s Manual
If you use tomcat, please DO NOT add jetty jars to your project!
Please remove jetty dependency, undeploy your application, then deploy it again and attach list of JAR files inside your tomcat/shared/lib and tomcat/webapps/app-core/WEB-INF/lib and tomcat/webapps/app/WEB-INF/lib. It seems that there is jetty jar file in your classpath that leads to incorrect initialization of Atmosphere framework.
Removed the dependency, and cleared the build directory, cleaned up, rebuilt, and yes you are right, there is two jetty files in the tomcat/shared/lib:
Morning Yuriy,
so I have tracked down the htmlunit package and it’s used by my partner developer, who has written some webpage parsers in core module with the help of it. And apparently this is the reason that the issue occurs only development and staging environments, where all modules are running on the same machine so Vaadin will find the jetty in the shared lib, and gets confused, but on the live environment they are separated, and it’s not on the web module’s environment, therefore it works fine there.
My question is now is it possible to force these packages to be downloaded into the “app-core/WEB-INF/lib” dir somehow? Maybe then Vaadin wouldn’t see them on the devmachines…
You can set jars that have to go to webapps/app-core/WEB-INF/lib using appJars() list in your build.gradle file inside of configure(coreModule) { section, but there you have to mention all jars of html unit and all its dependencies.
Also, if you actually do not use these features of html unit for WebSockets then you can exclude jetty jars from dependencies using Gradle exclude syntax: Learning the Basics
Amazing knowledge, thank you!
Now the jetty files are gone from shared/lib, also I have made absolutely sure that no file contains “jetty” in their names left in the whole tomcat directory structure (scanned it through with mc)
But now it still gives the same error message …
What else could cause this issue?