Vaadin websocket not upgrading in version 8 - vaadin

See error from console:
WebSocket connection to 'ws://localhost:8090/vaadinServlet/PUSH?v-uiId=0&v-csrfToken=27328352-6365-44a4-b980-1ca2d7a5bc1c&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.3.2.vaadin1-javascript&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: 200
This is after upgrading to vaadin 8.0.0
Push annotation and manual enabling of Push do not seem to make a difference. It reverts to long polling.
My best guess is it is a version problem. You can see it mentions atmosphere 2.3.2 in the error, but vaadin-push 8.0.0 imports atmosphere 2.5.4

As of my understanding vaadin does have two atmosphere products integrated within vaadin-push, both forked by vaadin. One for the server side (https://github.com/vaadin/atmosphere) and one for the client side (https://github.com/vaadin/atmosphere-javascript). I assume that they do not need to be in sync. E.g. I saw that atmosphere-samples-2.4.2 has been released using atmosphere-2.4.2 and atmosphere-javascript-2.3.0.
There's also an issue https://github.com/vaadin/framework/issues/8734, which states about the problem with vaadin-push through websocket (and also the version question). Hopefully they take care of this soon.

Related

Azure SignalR Service Connection is not active

I updated our signalr packages from 2.4.0 and added RunAzureSignalR instead of RunSignalR. Added this code in de Startup.cs
app.Map("/signalr", map =>
{
var hubConfiguration = new HubConfiguration
{
EnableDetailedErrors = true
};
map.RunAzureSignalR(typeof(Startup).FullName, hubConfiguration, options =>
{
options.ConnectionString = AppApiSettings.SignalRServiceConnectionString;
});
});
But when I try to send a message to the hub I get an exception The connection is not active, data cannot be sent to the service.. Can't find any reason this would happen or why the service would not run.
When I use RunSignalR (self hosted) everything runs great.
Any help would be greatly appreciated.
It turns out Azure Service only support TLS1.2 for security concerns.
Please add following code to your Startup:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
The hint for this solution was found on a github ticket: https://github.com/Azure/azure-signalr/issues/279
"No server available" indicates that your app server has trouble connecting to Azure service. You can enable tracing from the app server side with the following to see if any error throws.
GlobalHost.TraceManager.Switch.Level = SourceLevels.Information;
A sample here: https://github.com/Azure/azure-signalr/blob/dev/samples/AspNet.ChatSample/AspNet.ChatSample.SelfHostServer/Startup.cs#L19
If you are local debugging the server side, you can also uncheck "Just My Code" and break when any CLR exception throws:
System.Security.Authentication.AuthenticationException: "A call to SSPI failed, see inner exception."
- (inner) "The function requested is not supported"
System.ObjectDisposedException: 'Safe handle has been closed'
System.Net.WebException: 'The request was aborted: Could not create SSL/TLS secure channel.'
System.Net.WebSockets.WebSocketException: 'Unable to connect to the remote server'
- (inner) WebException: The request was aborted: Could not create SSL/TLS secure channel.
I recently had the same issue and again the accepted answer didn't help me. My project was a .NET 4.8 MVC application (so TLS version shouldn't be an issue) and following an update of the projects Nuget packages the issue arose.
I knew it was the Nuget updates that had broken my application but I didn't want to go through each one to figure out where the issue was.
Thanks to #cognophile for pointing me in the right direction. For me though I only needed to downgrade the following three Nuget packages to version 5.0.17 to fix the issue. Anything 6.x with these packages caused the issue again.
Microsoft.AspNetCore.Connections.Abstractions
Microsoft.AspNetCore.Http.Connections.Client
Microsoft.AspNetCore.Http.Connections.Common
I've recently had the same issue whereby the negotiation worked with map.RunSignalR(...) but not map.RunAzureSignalR(...) and tried the accepted answer here without resolution. For anyone still experiencing this issue having tried the accepted answer like myself, I found the below to work for a .NET Framework 4.6.1 project.
Navigating to the negotiation link (e.g. .../signalr/negotiate?clientProtocol=2.1&connectionData=...&callback=jQuery...&_=...) in the browser would give a
HTTP 500: Azure SignalR Service is not connected yet, please try again later
Having enabled the exception debugging suggestions from #Youp Hulsebos and the SignalR GitHub (source), I was able to find the following exceptions being thrown from the SignalR registration call in Startup.Configure(...):
Microsoft.Azure.SignalR.Common.ServiceConnectionNotActiveException: 'The connection is not active, data cannot be sent to the service.'
LoaderException - Method 'get_Features' in type 'Microsoft.AspNetCore.Http.Connections.Client.HttpConnection' from assembly 'Microsoft.AspNetCore.Http.Connections.Client, Version=1.0.0.0, Culture=neutral' does not have an implementation.":"Microsoft.AspNetCore.Http.Connections.Client.HttpConnection"
Having found the second of these exceptions and applying some Google-fu, I found this GitHub issue discussing the LoaderException from Microsoft.Azure.SignalR.WebSocketConnectionContext discussing this as the result of upgrading Microsoft.AspNetCore.Http.Connections.Client from 5.0.12.0 to 6.0.0.0.
Having tried downgrading the package to 5.0.12.0, I still encountered the same issue. Having checked the linked issue ([dotnet/aspnetcore#38699]), I downgraded the following packages to 5.0.11.0 and this resolved the issue:
Microsoft.AspNetCore.Connections.Abstractions
Microsoft.AspNetCore.Http.Connections.Client
Microsoft.AspNetCore.Http.Connections.Common
Microsoft.AspNetCore.Http.Features

Problems with Push support in Vaadin

I'm having some serious issues with the Server Push support in Vaadin 7, and it's proving difficult to pin down the problem. I've followed all the steps in the Book of Vaadin on enabling server push, including adding the vaadin-push.jar file to WEB-INF/lib, adding the "asyncSupported = true" parameter to the #WebServlet annotation, and adding the #Push annotation to the UI class. (I've also tried specifying the equivalent in the deployment descriptor.) I also added the org.atmosphere.useWebSocketAndServlet3=true property to the catalina.properties file of my Tomcat 7 server, as suggested in https://vaadin.com/wiki/-/wiki/Main/Working%20around%20push%20issues.
I found the Server Push support to be very quirky, making it difficult to identify the problem. For instance, when developing code, the server will often not automatically re-start; only recognizing new code when I close the browser (not just the browser window), stop the server and re-start Eclipse; missing any of these steps will result in the Server Push not working. Note that this issue only occurs when Server Push is enabled. I read something about sessions not expiring when push is enabled (https://vaadin.com/forum#!/thread/3576361), so maybe that's the reason..
I often encounter suspicious log messages:
Mar 02, 2014 9:25:45 PM com.vaadin.server.communication.PushHandler$3 run
WARNING: Could not find push connection to close: 38450652-2a2b-4221-8300-8313e9c4779a with
transport WEBSOCKET
Mar 02, 2014 9:25:45 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load
java.nio.ByteBuffer.
It does seem that the Atmosphere is finding the async support:
INFO: Atmosphere is using async support:
org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket running under container: Apache
Tomcat/7.0.47
I also found this error; don't know whether it indicates a serious problem (haven't tried resolving it, since I don't want to get into the Atmosphere stuff):
WARNING: No BroadcasterCache configured. Broadcasted message between client reconnection will be
LOST. It is recommended to configure the org.atmosphere.cache.UUIDBroadcasterCache
That said, Firefox works quite well with the Server Push, while Chrome has problems and IE spews errors (surprise!). In particular, Chrome often takes quite a while to communicate a UI interaction (e.g., button push) to the server, whereby a spinner (changing color from yellow to orange to red) appears at the right top. IE simply updates the wrong UI components when multiple windows are open. So, as long as every user employs Firefox there's no problem, but I can't possibly assume that.
I came across this post, where developers vented their frustration on the feature: https://vaadin.com/forum#!/thread/4040408. This is quite a recent post, so it doesn't sound too promising.. The only reason I need the Server Push feature is to allow the ChatBox add-on (https://vaadin.com/directory/-/directory/addon/chatbox) to update in real-time.
Any ideas? Has anyone gotten these kinds of errors and managed to get some workaround? Or even better, has anyone gotten the ChatBox add-on to work with the Server Push?
Thanks,
William
Try Again
Web Push is still a young technology, especially the WebSocket variety. Tomcat for example replaced one WebSocket implementation with another. Vaadin’s adoption of the Atmosphere library and all the other work in Vaadin 7 are relatively new. Much has improved in the months following the posting of this Question. I suggest giving Push another try.
Use the latest versions of your web server. For example, both Tomcat 7 & 8 and Jetty have made significant changes in their support of Push and WebSocket.
Use the latest version of Java 8 and Vaadin (7.3.7 now).
No Need For setPollInterval
No need to call UI::setPollInterval as was mentioned in the comments above. That feature uses only one approach to Push.
All you need is the #Push annotation. And a Thread, or better, a ScheduledExecutorService to update the data for display in your app. Using the #Push annotation engages the Atmosphere library. Atmosphere tries multiple techniques of Push, starting with WebSocket, and automatically uses other techniques as a fall-back.
Working Example
I recently (2015-01) posted a working example of Push working in Vaadin 7.3.7 as an answer to another question. My example is purposely minimal, using a single file to replace the MyUI file’s content in a new default Vaadin app project.

TwimlResponse vs Response in openvbx's twiml.php

A number of older plugins use $Response = new Response() instead of what the current plugin documentation shows: $Response = new TwimlResponse;
I created a plugin using openvbx version 1.2, but when pushing to production, version .9, it looks like it doesn't recognize TwimlResponse as a method.
I replaced TwimlResponse with Response, but it looks like .9 doesn't recognize $_REQUEST['From']. Does anyone know what the method for pulling the call from number was in .9?
Are there any concerns with upgrading our production OpenVBX instance?
It's not a question of OpenVBX per se but instead the Twilio PHP library behind the scenes. As you've seen, there were a number of updates of the library between those OpenVBX releases which are giving you stress now.
My recommendation is to backup your 0.9 install and do a test upgrade to 1.2.x and if everything works as expected do the real upgrade.

MonoDroid async service request

I think my issue is somehow related to the issue described in the post https://stackoverflow.com/questions/12526125/monodroid-wcf-request-response-of-2-asynch-requests-got-mixed. If it is so, the question is when it's going to be fixed. The MonoDroid 4.2.6 seems still having the issue.
My exact problem is this. In the main action I start 5 async service requests. 4 service requests to one service and 1 service request to another service. Before sending the requests I add [ServiceName]Completed event listeners. The event listener for the service with one call is fired and two of the other event listeners are fired but they are fired twice. First time with the .Result equal null and the second time with the valid .Result object. The other two event listeners are never fired. On the service side I correctly receive all 5 requests and the service sends back all the responses.
It is rather difficult to isolate the problem. Two many things were changed in the environment. The last version that worked was running on the Windows 7, using MonoDroid 4.2.4 and VS2010 was used for compiling the project.
Now the problem is revealed under Windows 8, using MonoDroid 4.2.6 and VS2012 was used for compiling the project.
It does sound like this is a bug pure and simple in the Mono code.
Looking at https://bugzilla.xamarin.com/show_bug.cgi?id=7200 it claims this is now available in 6.0.2 in the Beta channel.
If you are still seeing the original problem, then contact Xamarin via Bugzilla - and via support#xamarin.com too if needed - it looks like they are keen to resolve the issue.
Please try Mono for Android 4.2.7, which has a number of related bug fixes.

Received fatal alert: bad_certificate RestAssured

I am using the RestAssured library to make calls to certain REST API's
These are https endpoints and I tried using the "relaxedHTTPSValidation()" method provided in RestAssured to bypass SSL validation
My request looks something like
RequestSpecification req = RestAssured.given().relaxedHTTPSValidation().body().post();
I keep getting the error
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
Doeas anyone have an idea why this is happening ?
Which version are you using? We had the same issue before with an early version. After updating it to the latest the problem was solved.
Un-synched same java version b/w the client and server.
compatibility issues with different versions of SSL & TLS v1, where as client handles only using SSL v3).

Resources