MonoDroid async service request - xamarin.android

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.

Related

"failed to get context" error against real server, works fine with mockserver

Following the ODATA V4 tutorial in step 2: app runs against mockserver, tips are given to run it against a real server. Used the existing index.html as test/mockServer.html and created a new index.html, pointing to ComponentSupport for oninit. Added cors-anywhere and adjusted the manifest. Works well, both mockserver and real.
That was in step 2 and the app worked fine also against a real server. Fast-forward to step 5 and I notice the app fails to load any data when running against a real server. Long story short, the backend is throwing an error, not even "count" together with "top" is accepted. I checked the docs for ODATA, "count" does not seem to be an exclusive option.
Am I fundamentally misunderstanding the way ODATA works? I am especially puzzled by the fact that the mockserver runs fine.
EDIT: created bugreport
As reported in the closing comment of my bugreport, Microsoft has confirmed the issue: "This was due to an error in the version of the OData WebAPI library we were using in the backing service. I have an update with various fixes, including updating to the latest WebAPI library that contains this fix, that I just haven't pushed out to production yet. Let me see when if I can get that deployed."

IIS Worker Process busy using Hangfire

I'm using Hangfire in my MVC webapp. I configured it this way:
GlobalConfiguration.Configuration
.UseMongoStorage(mongoConnectionString, mongoDatabaseName);
app.UseHangfireServer();
When I run the application I see IIS Worker Process takes constantly almost 40% CPU.
Removing it brings the application to works normally.
What's wrong?
Hangfire.Mongo since version 0.2.2 uses a new version of the mongocsharpdriver package that migrated to async API when talking with Mongo. Hangfire still uses synchronous methods, and looks like there is an error in "sync over async" wrapper.
One user reported that after setting the following options everything is fine.
CountersAggregateInterval = TimeSpan.FromMinutes(5);
JobExpirationCheckInterval = TimeSpan.FromHours(1);
However, the fix isn't available currently, and another option is to downgrade the Hangfire.Mongo package to the previous version. Please see the related GitHub issue.

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.

Repeated "java.lang.IllegalStateException: Cannot forward after response has been committed" errors with Grails and Tomcat

Please see my post on the Grails user mailing list. Essentially, I get the error "Cannot forward after response has been committed" with Grails 2.x after every few requests. This happens for all types of URLs, controllers, GSPs, CSS files, JS files and even image files. I have tried Grails 2.0.0 and Grails 2.0.1 with Tomcat 6.0.35 and Tomcat 7.0.25 on Windows XP 32-bit, Windows 7 32-bit and Centos 64-bit. The error comes up on all these combinations.
As I have mentioned in my post, there are no response.redirect or response.forward statements in our code. This is causing severe problem on our production application so need help in determining what else can be looked at to get to the bottom of the problem.
This has been solved. In one of the controllers in the application, response output stream was being directly written to but not closed explicitly after the operation was over. It seems Tomcat and Jetty recycle response objects. When a response object that did not have their output stream closed earlier was recycled for a future request and redirect was performed on it, the redirect would fail.
The code has been changed and the error has disappeared now. The lesson learned is that any time such an error occurs, scan the entire code base for direct access to response output stream and close output stream responsibly before existing controller methods.
You should create a new grails application and move the controllers, domains and etc yourself rather than grails update.
When you do that also make sure you look into the configuration files of grails.
Also take a look at what plugins you have.
Also, when moving the files, try out the application once in a while when it is possible, and perhaps you can detect when the error arises. Start out by trying it in your most basic controller and see if the error is there then as well.
Good luck.

WSS caches old Workflow version

I'm currently developing three workflows that are supposed to handle the status of items in different lists.
Each Workflow is attached to a separate list.
When I'm deploying and debugging in my development Environment, everything works fine.
Except for the case, when an item is created via an incoming mail.
I already figured out, that I have to restart some services and then it'll work, but I'm still not sure wich of the services is caching the workflow.
Afterwards I build a .wsp file which I deploy on a server.
Each time I deploy the solution, I do a retract and delete solution first.
After deployment I'll recreate the workflows on the lists
It seems to me that this has no effect. An older version of the workflow is still triggered, if I create a new instance in the list.
I already restarted the whole server and still no result.
Has anyone an idea what else I could try in order to get this working?
Thanks in advance.
If Timer Service is the one that calls your code, then restart Windows SharePoint Services Timer (OWSTIMER.EXE).
When workflow waits on something, it gets serialized (hydrated). When event happens, OWSTIMER.EXE deserializes (dehydrates) and continues workflow execution.
So timer is the one that wakes workflow up.
So this problem kind of resolved itself.
I was reading an article on Kirk Evanns Blog on an issue with the development of workflows in VS2008 for WSS.
I had not realized that I still had an illeagle reference in my Project properties.
I removed the reference. The second thing I tried was deploying with -upgradesolution rather than doing a retract-delete-add-deploy...
I don't know which of both did the trick, but I can finally see the new workflows kicking in.
Thanks for your help.

Resources