Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-08-12 Thread Ajith Vitharana
Hi All Seems the issue [1] is due to the same reason (please correct if i'm wrong) So can we apply same kind of fix to resolve [1] ? [1] https://wso2.org/jira/browse/BAM-1383 -Ajith On Fri, Mar 20, 2015 at 2:33 PM, Rasika Perera rasi...@wso2.com wrote: Hi Tharindu, Correct. As we

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-20 Thread Lakmali Baminiwatta
Hi all, Isn't it better to handle this error rather than hiding the logs through log4j.properties? I think option 4 is better and has minimal changes to existing logic. ex: We can put a try/catch block and handle below before the XHR request. var httpClient = new

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-20 Thread Rasika Perera
Hi Tharindu, Correct. As we discussed, we are making two network calls for the same functionality. Assuming that the network call is costly, when number of log-in users increasing and fetching Human Tasks available on BPS server, network traffic is increased. However, It might not affect very

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-20 Thread Tharindu Dharmarathna
Hi Rasika, Thank you for the clarification , and as our offline chat we are sending multiple network calls to the BPS is that not become issue come into the production ? . Thanks and Regards Tharindu. On Fri, Mar 20, 2015 at 11:37 PM, Rasika Perera rasi...@wso2.com wrote: Hi Lakmali, +1 for

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-20 Thread Rasika Perera
Hi Lakmali, +1 for the explanation. In your solution, I think HTTP HEAD[1] is better to testing accessibility of the server endpoint. var httpClient = new Packages.org.apache.http.impl.client.DefaultHttpClient(); var *httpHead* = new Packages.org.apache.http.client.methods.*HttpHead* (endpoint);

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-19 Thread Ruchira Wageesha
Following are the possible options that I can think. 1. Patching XHR to get rid of the log message 2. Hiding the error from log4j, but AFAIK, then it will not log any error from XHR 3. Using any Java's http-client directly from Jaggery[a] to do the HTTP calls instead of XHR 4. Using any Java's

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-19 Thread Lakmali Baminiwatta
Hi Ruchira, In APIM and APPM we talk to the BPS server and fetch Human Tasks available. For that when the user is login to the admin-dashboard jaggery app, we do a login call to BPS server using XMLHttpRequest. At this point, if the BPS is not running we are getting this connection refused error

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-19 Thread Rasika Perera
Hi Tharindu, According to chat we had, IMO if your intention is to avoid error messages from XMLHttpRequestHostObject.java rather than patching XHR, you can add following to your log4j property file. log4j.logger.your package = DEBUG|INFO|OFF|WARN...

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-19 Thread Rasika Perera
[Please ignore my previous reply, it was incomplete] Hi Tharindu, According to chat we had, IMO if your intention is to avoid error messages from XMLHttpRequestHostObject.java rather than patching XHR, you can add following to your log4j property file. log4j.logger.your package =

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-17 Thread Tharindu Dharmarathna
Hi Ruchira, We want to carch the exception according to connection refused exception from the jaggery side . Due to logging of this exception from Hostobject We couldn't remove this exception come from the console. Is there any way of check a server is up and running from jaggery side . If

Re: [Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-17 Thread Ruchira Wageesha
What is the issue with going try/catch blocks? /Ruchira On Tue, Mar 17, 2015 at 5:56 PM, Tharindu Dharmarathna tharin...@wso2.com wrote: Hi all, According to public jira [1] how can we handle connection refused exception come from this issue . This come from the send method. code

[Dev] [DEV][Jaggery] how to handle exception come from XMLHttpRequestHostObject

2015-03-17 Thread Tharindu Dharmarathna
Hi all, According to public jira [1] how can we handle connection refused exception come from this issue . This come from the send method. code snippest for this issue try{ var xhr = new XMLHttpRequest(); var site = require(/site/conf/site.json); var endpoint =