How to resolve Connection Reset issue in Google calendar API - google-calendar-api

I am using java and google calendar API to insert/update/delete events from my google calendar. It is working fine.. At times it throws Connection Reset error when writing or updating the event via API.
Is there any possibility to resolve this issue.?
Thanks in advance..

If this is a java code, maybe the SO Posts below can help you determine what's wrong and where did you messed up in your code. Since I am not sure what code you are using, I'll give you an example where this error always occur.
SO post 1
"Exception in thread "main" java.net.SocketException: Connection
reset" error occurs when the opponent is forcibly terminated without
calling close().
Maybe there is something in your code that forced the opponent to be terminated without calling the close() function.
If that's the case, you can add this two line in both
Client
skt.close();
and ServerSock
ss.close();
Note: java.io.Closeable implementing object must call close ().
SO post 2
javadoc for SocketException states that
Thrown to indicate that there is an error in the underlying protocol
such as a TCP error
The connection in the server end maybe closed and caused the issue when sending the issue at their end.
To aid debugging you could look at using a tool such as Wireshark to
view the actual network packets. Also, is there an alternative client
to your Java code that you could use to test the web service? If this
was successful it could indicate a bug in the Java code.
As you are using Commons HTTP Client have a look at the Common HTTP
Client Logging Guide. This will tell you how to log the request at the
HTTP level.
Hope 1 of these two answers will help you.

Related

NoHandlerForCommandException: observed when command raised just after application starts

When my spring aplication come up and makes an attempt to issue any command using send method NoHandlerForCommandException is observed. This exception is observed just after the startup of the application and after a few moments it can find the handler and everything works as expected.
How can I know if the command bus and all other command handling components are setup before initiating any command?
I have read somewhere on stackoverflow that in coming version of Axon Framework an event would be emitted after setting up or after receiving the start signal from command handling configuration, has that been introduced?
I believe the issue you are talking about is this one which is not done yet but you can follow it up there.
To your problem, the only way to do that right now is to wait a few seconds before you start your testing (not the best approach).
There are ways to check using Axon Server API if the command handlers are already registered there or not but that's not an easy task and not beautiful as well so I would stick with the wait approach by now until it gets properly fixed.

How to log errors in APIGee

Is there any error logging option in APIGee?
I am enabling a proxy endpoint in APIGee for a customer. If there is any error in the flow, how can I log it to a persistent store?
Specifically, I am using javascript policies and parsing some of the returned by back-end service, format to a different format. If there is any parsing error, where and how can I log it?
I am able to catch the error with try catch block.
Can I send an email in the catch block to a specific email address?
Thanks,
Deepak
You can catch the error in your catch block and then set the appropriate variable to contain the detailed error message you might have ran into.You can use syslog/messagelogging policy to send all the request details along with any parsing exception that you might have. You need some kind of a logging server at your end to be sent the logs to or you could also use public log management services, such as loggly. Refer to this section for more details - http://apigee.com/docs/api-services/content/log-messages-using-messagelogging
Vineet I think you are looking to solve the following problems here:
During the coding process you want to debug and understand what is going on? Something that lets you log.debug equivalent.
You want to also trigger exception flows or external processes when things go wrong in your proxy flow.
For #1 you can assign variables and trace using apigee's debug view. Any flow variable assignment in Apigee policies is printed in the debug view, if the policy is executed. So that provides you with log.debug mechanism, whenever you trace.
For #2 you can take a variety of approaches based on rest of your systems and processes. The previous answer by #Mike Dunker is a good approach. I can suggest a few more alternates
As an alternate you can also use Apigee's analytics views to monitor errors, albeit after the fact.
You can set up external monitoring scripts on your backend or on the apigee endpoint based on some synthetic transaction that touches upon the entire logic of your flow. When the services return error you can measure metrics and/or raise alert from your monitoring system.
If you have an on-premise installation of Apigee, you may want to consume apigee log files on the servers and raise appropriate actions on errors.
You can raise a desired error message to a JMS queue when error happens. Refer to Apigee's JMS support here

Strange behavior of RemoteObject after application built, no fault no result

When i run it in Flash Builder (debug mode) the remote object called successfully. but whenever i build the application (AIR application), then the remote object will return no result nor fault, the busy cursor is showing about 3 seconds. then no clue at all.
Any idea how to get advance fault or something than regular fault event or result event?
or anyone have the same experience?
UPDATE:
Actually it was failed only for ONE service method, for other method (some of them took longer time to call) the service call is work fine.
CASE SOLVED
So the problem was not on the service call, but on my result conversion that cause the advanced datagrid failed to render.
Best regards
ktutnik.
Try using a software like Charles to see what happens during the network call.

Do you do client-side logging?

How do you capture errors that happen on client side when building RIA apps using Flex and Silverlight? What are the common practices? I have seen some asynch js calls to a web service implemented but would like to know how the community is dealing with it.
First, I use client side logging all of the times.
the way I handle it depends on the entire application.
if I use an AMF gateway then there's a call for an application error, with every error that occurs the server is notified, in the server side a bug is open in BugZilla (this is what we use, you can use any other hook you want).
If I use a web-service based application then there's a web-service call for a client error.
one would say you shouldn't sample the server with every error, I disagree with this comment because an error in the client side is rare, it goes thorough QA before being released to the client so I want to know immediately on every error the client is experiencing.
In Silverlight I like to use a WebClient to log back to a web service somewhere -- you can do this directly in the Silverlight application without calling out to JavaScript.
To catch exceptions that are fired when your code isn't on the stack, you can use the Application.UnhandledException event.
I've used the same approach as Avi Tzurel - you need to know on the server side when an error appeared in the Flex client. If you want to collect more data (all the log messages, warnings) I would use an internal buffer and I will flush it asynchronously.
Anyway, you need to take into consideration if your customers are ok with this approach..maybe you need their agreement before sending the error message to the server.
I basically percolate all errors to the top, and capture them in the unhandled exception. I display a friendly message to the user. However, throughout my application I implement an ILogger interface. This interface can be initialized with various levels and handles any messaging. You can set it up so the user can add an init param to determine whether or not to transmit the errors to a service, and I typically have the logger write the messages with Debug.WriteLine if the debugger is attached to make it very easy to trace issues in debug mode.
In Silverlight you may want to consider the Logging and Exception Handling Application Blocks from the Silverlight Integration Pack for Enterprise Library.

Flex httpservice faults

I've been given a Flex application which made use of a RESTFUL service.
I've managed to create a SQLite DB which stored data from the service and now I would like the application to be able to run offline and make use of the data existing in it's local DB. This works fine the only problem is that the httpService object throws a fault when it cannot connect.
If I don't provide a method to handle the fault event then it is displayed in an error window.
If I provide a blank method to handle the fault then it is still displayed in an error window.
How can I get it to stop displaying this error Window?
Regards,
Craig
Check for a network connection before making the httpservice request.
Flex 3 - Adobe Flex 3 Help - Network Connectivity
That way, when an exception occurs it's really an unexpected behavior instead of something that could be regular program usage.
Never Mind... Problem was that something else was generating the same fault...

Resources