jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.52k stars 4.02k forks source link

Websocket + strange behaviour #852

Closed clincks closed 9 years ago

clincks commented 9 years ago

When I create a new application I observe a strange behaviour:

Here the output of the logs: [WARN] org.atmosphere.util.IOUtils - META-INF/services/org.atmosphere.cpr.AtmosphereFramework not found in class loader [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] org.atmosphere.cpr.DefaultAsyncSupportResolver - Found multiple containers, please specify which one to use: org.atmosphere.container.Tomcat7CometSupport, org.atmosphere.container.TomcatCometSupport, until you do, Atmosphere will use:class org.atmosphere.container.Tomcat7CometSupport [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [WARN] com.mangofactory.swagger.plugin.SwaggerPluginAdapter - SwaggerSpringMvcPlugin have already been initialized! [INFO] com.rhcloud.controllino.remote.Application - Started Application in 69.187 seconds (JVM running for 73.84) [DEBUG] com.rhcloud.controllino.remote.aop.logging.LoggingAspect - Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Dec 05 20:48:07 CET 2014, principal=, type=AUTHENTICATION_FAILURE, data={type=org.springframework.security.authentication.AuthenticationCredentialsNotFoundException, message=An Authentication object was not found in the SecurityContext}]] [ERROR] org.atmosphere.cpr.AsynchronousProcessor - Invalid request state. Websocket protocol not supported

The application is working... but the layout of the application is not working at all. Like if no CSS is working... No color at all in the application.

Any idea what is going wrong ?

Thanks.

gzsombor commented 9 years ago

Do you see anything in the browser's web console ? Probably there are javascript loading issues ...

clincks commented 9 years ago

Here the web console logs...

Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:8080/styles/main.css WebSocket connection to 'ws://127.0.0.1:8080/websocket/activity?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.5-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 501 127.0.0.1:8080/bower_components/atmosphere/atmosphere.js:1117 Websocket failed. Downgrading to Comet and resending Failed to load resource: the server responded with a status of 401 (Unauthorized) http://127.0.0.1:8080/protected/authentication_check.gif WebSocket connection to 'ws://127.0.0.1:8080/websocket/activity?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.5-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 501 atmosphere.js:1117 Websocket failed. Downgrading to Comet and resending WebSocket connection to 'ws://127.0.0.1:8080/websocket/activity?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.5-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 501 atmosphere.js:1117 Websocket failed. Downgrading to Comet and resending

gzsombor commented 9 years ago

There is nothing suspicious here - except that downgrading to comet, instead of the websocket transport, however this is a known issue, and shouldn't cause rendering problems. I guess, probably some caching issue, could you try to empty / disable your browser cache, or try a different browser ? I only had similar problems, when I switched between two different 'jhipster' apps, which both run on the same port, so the browser though it should cache every javascript/html, which doesnt matched with the backend.

clincks commented 9 years ago

Same problem with another browser.

Did you noticed the 404 HTTP error ?

jfarcand commented 9 years ago
[WARN] org.atmosphere.cpr.DefaultAsyncSupportResolver - Found multiple containers, please specify which one to use: org.atmosphere.container.Tomcat7CometSupport, org.atmosphere.container.TomcatCometSupport, until you do, Atmosphere will use:class org.atmosphere.container.Tomcat7CometSupport

Workaround with Tomcat 8:

<init-param>
   <param-name>org.atmosphere.cpr.asyncSupport</param-name>
   <param-value>org.atmosphere.container.JSR356AsyncSupport</param-value>
</init-param>

Reall issue is why Tomcat 6/7 classes on the classpath

clincks commented 9 years ago

What is the file I should update ?

I was asking my friend google... but he is not precise...

Thanks a lot

jdubois commented 9 years ago

This is a duplicate of #844