How to get the error code for http request

I have to implement the if..elso loop depending on the error code return as below.
String host="127.0.0.2"
if the this servers is not found or itis down it should return error code, based on that I have to change the host value to some other server like "127.0.0.4" , Can you let me know how it can be implemented? Please help me.

Here is my requirement...
say.. if client hit " http:\\ 172.0.0.3: 1000/index.jsp" and if the server 172.0.0.3 is not available i will set the server host to some other and request will redirect accoringly like " http:\\ 172.0.0.4: 1000/index.jsp"

Similar Messages

  • I am getting ready to wipe a PC clean but wanted to know how to get the activation code for the Version of Adobe reader that is currently installed on the PC?

    I do not have the activation code for this PC and need to know how to get the software loaded back on it after a clean install of the OS and other programs.

    If you use any additional subscription services to Adobe Reader, they are activated with your Adobe ID & password.

  • Is there any differnce between the Numeric Limit Test source code from TestStand 3.0 to TestStand 3.1? How to get the source code for the Numric Limit Test for both the versions?

    I need to know the differnece between the Numeric Limit Test between the TestStand version 3.0 to 3.1. If there is any differnec in the source code how to find it out? If somebody has the code can you share it?
    Thanks,
    Jeyan

    Hi,
    I don't believe there are any differences between the two versions. But you can check the source code for the Numeric Limit Test in TestStand\Components\NI\StepTypes\CommonSubsteps. But the main part of the step is the Code Module and this bit the users supplies this.
    What has prompted this question?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Anyone know how to get the Authorization Code for Photoshop 7?

    I reinstalled it on a new computer and there's no phone support but also no ability to activate it online, keeps saying the activation system is unavailable. Thanks in advance!

    Yes, you can install it, you have to copy the folder from the old computer and save it to the new computer and then the CD will install. I've tried 3x's to contact Adobe support through Chat here and their chat feature does not work. I'm assuming they just want you to buy their subscriptions online like Microsoft did with Office 365 and then they leave you hanging.

  • How to get the Error message from hr_contact_rel_api.create_contact

    Hello All,
    I am using this API for creating a contact for an employee in R12.
    But, some times i am not able to create the contact successfully, and Unable to figure out proper reason for record erroring out.
    I dont find any out msg data variables for this API in order to check it for the Error.
    So, can any body help me how to get the ERROR Message for such APIs.
    Thanks inAdvance,
    Amarnadh Js

    user12243334 wrote:
    solved the issue on myselfIt would be nice if you could share the solution with us.
    Thanks,
    Hussein

  • Java - Axis2: How to get an error code / error message from the Javascript via SOAP

    Hi
    In our Java applicsation we call a Javascript in a Indesign CS Server using the following code:
    --- SNIP BEGIN ---
    // calls the remote service on the indesign server
    try {
    // create service
    ServiceStub oIndsgnSrvStub = new
    ServiceStub(sIndesignServer);
    // create service parameter
    ServiceStub.RunScriptParameters
    oIndsgnSrvRSParams = new ServiceStub.RunScriptParameters();
    // create arguments with source- and target-file for parameter
    ServiceStub.IDSPScriptArg[] oIndsgnSrvSArgs = new ServiceStub.IDSPScriptArg[2];
    oIndsgnSrvSArgs[0] = new
    ServiceStub.IDSPScriptArg();
    oIndsgnSrvSArgs[0].setName("xml-input");
    oIndsgnSrvSArgs[0].setValue(sSourceFile);
    oIndsgnSrvSArgs[1] = new
    ServiceStub.IDSPScriptArg();
    oIndsgnSrvSArgs[1].setName("output-file");
    oIndsgnSrvSArgs[1].setValue(sTargetFile);
    // define service parameter
    oIndsgnSrvRSParams.setScriptArgs(oIndsgnSrvSArgs);
    oIndsgnSrvRSParams.setScriptFile(sScriptFile);
    oIndsgnSrvRSParams.setScriptLanguage("javascript");
    oIndsgnSrvRSParams.setScriptText("");
    // create runscript
    ServiceStub.RunScript oIndsgnSrvRS = new ServiceStub.RunScript();
    // set parameter
    oIndsgnSrvRS.setRunScriptParameters(oIndsgnSrvRSParams);
    //$$$ there should be an answer returned by the InddSrvr
    // execute SOAP call
    ServiceStub.RunScriptResult oIndsgnSrvRes = oIndsgnSrvStub.RunScript(oIndsgnSrvRS);
    if(oIndsgnSrvRes.getErrorNumber() == 0) {
    oServerProdJob.setProdState(CBP_Constant.REMOTEPRODUCTIONSTATE_SUCCESS);
    bOK = true;
    } else {
    oServerProdJob.setProdState(CBP_Constant.REMOTEPRODUCTIONSTATE_FAILURE);
    bOK = false;
    //$$$ should be set, if there is something returned by inddsrvr
    //oServerProdJob.setErrorMsg(sErrorMsg);
    } catch(Exception e) {
    sError += e.getMessage() + "\n";
    bOK = false;
    --- SNIP END -----
    The problem is that we don't get the error code and/or the error message from the Javascript in oIndsgnSrvRes. The error code is always 0 if I set an Integer value as return in the Javascript. If I set a String, there is an Exception in the Java application.
    Here is the Java script we use:
    --- SNIP BEGIN ---
    main();
    main()
    var sError = "";
    var sXMLInput = "";
    var sLayoutPath = "";
    // get the SDKCodeSnippetRunner object
    var cbpAdapter = app.cbpCbpadapterObject
    if (cbpAdapter) {
    sXMLInput=app.scriptArgs.get("xml-input");
    sLayoutOutputFile=app.scriptArgs.get("output-file");
    sError = cbpAdapter.doProcess(sXMLInput, sLayoutOutputFile);
    return sError; // This give an Exception; if I return an Integer the ScriptResult is always 0
    --- SNIP END -----
    If I try this with the test application from Adobe I get the error code correctly. But in the Java application, using SOAP, I can't get the error code.
    What could be wrong?
    Any ideas?
    Thanks a lot for the support.
    Kind regards
    Hans

    user11340104 wrote:
    Hello -
    i am calling sqlplus from a bash shell script. If the sql statement generates an error, how can I return that error code (unsuccessful) back to the bash shell?
    Well, let google be your friend,
    http://www.google.co.in/search?rlz=1C1GGLS_enIN327IN327&sourceid=chrome&ie=UTF-8&q=sqlplus+error+codes
    There are many threads I guess talking about the same issue.
    HTH
    Aman....

  • When I try to get the key code for office it tells me its already been used.  My mac had a new hard drive in its first year, could it be because of this?  How can I get the office I've paid for but never used?

    My mac had to have a new hard drive in its first year.  Now, when I try to get the key code for office it tells me its already been used.  How do i get the office I've paid for but never used?

    The product key is sent to you by email as part of the purchase confirmation.
    If you have lost it, log into your Microsoft account.

  • I try to export my Imovie and I always get the error code"Unable to prepare project for publishing...File already open with write permission"  it even does it when I am just trying to export to my external hard drive to save the file

    I try to export my Imovie and I always get the error code"Unable to prepare project for publishing...File already open with write permission"  it even does it when I am just trying to export to my external hard drive to save the file

    Thanks!!! I had same error (with -49) and the mac had an external hard drive attached.. and it was doing a backup.  Stopped, disconnected and the project exported!

  • I keep getting the error 40 for my iphone 3GS restore how do you fix it

    I keep getting the error 40 for my iphone 3GS restore how do you fix it

    https://discussions.apple.com/thread/3740515?start=0&tstart=0

  • When trying to download 4.3.3 for iphone 4 with firewall off and antivirus off but i keep on getting the error code 3259 - sometimes it times out after a few seconds other times it will be half anhour - can anyone help?

    Hi,
    When trying to download 4.3.3 for iphone 4 with firewall off and antivirus off i keep on getting the error code 3259 - sometimes it times out after a few seconds other times it will be half an hour - can anyone help?
    Thanks

    Before beginning the download, try temporarily disabling the antivirus, anti-adware, anti-spyware, and any other anti-whatever that is required and is running with that secure OS.

  • HT1904 I have failed to get the gift code for my iPad. So how can I go about that?

    I have failed to get the gift code for my iPad. So how can I get it?

    What gift code?

  • How to get the itunes code of iphone 5s

    how to get the itunes code of iphone 5s
    I am from india ....
    the itune setting doesnot give me none option in my phone ....
    And i dont know the itunes gift code ...
    So pls give me the detail how to get the itunes code and what is it ?

    It would have been better if you had added a reply on your original post instead of starting a new thread : https://discussions.apple.com/thread/5514146?tstart=0
    iTunes gift cards are an alternative way of paying for content from the store, but they aren't available in all countries (and the cards are country-specific, they can only be used in their country of issue). The gift card field on the account set up page is optional, and as gift cards aren't available in India you won't be able to fill it in anyway.
    There are instructions on this page for how to create a new account without giving credit card details and will give you the 'none' option : http://support.apple.com/kb/HT2534 - the instructions won't work with existing accounts, and if you didn't use those instructions when creating your existing account then you will need to enter credit card details before you will be able to use it to download content

  • I just updated my 3gs to the latest iOS 5 update and now I am unable to text certain numbers.  I keep getting the error code 1121611611 invalid number, even though the number I have in my contacts is a 10 digit number.  Any suggestions on fixing this?

    I just updated my 3gs to the latest iOS 5 update and now I am unable to text certain numbers.  I keep getting the error code 1121611611 invalid number, even though the number I have in my contacts is a 10 digit number.  Any suggestions on fixing this?

    PhotogYogi wrote:
    I Have the same issue on a brand new iPad mini 2. My battery is only lasting up to 5 hours. I went on chat with Apple last night and they said my battery is fine and its a Safari issue. I'm literally losing 1% every 3-4 minutes. I tried recalibrating my battery, signing out of iCloud, shutting off all locations, turning off background app refresh, restoring network settings, restoring all, and finally restoring from iTunes with no luck. This is just awful. I got this iPad so I could use it on my long flight for a trip I have coming up, and unfortunately, it's not going to last that long, plus I'm concerned about how many times i will be recharging my battery because of this since battery's do have a life cycle dependent on the number of charges. This is frustrating and needs to be fixed ASAP and addressed by Apple.
    By the way, Apple told me to bring my device to the Apple Store because it's still under warranty. That's great and all, but I'm going to waste my time if there is no fix for this issue.
    Ok so you want Apple to address the problem, but yet you don't want to take it to them just in case they can't fix it? What if they can fix it? Complaining here certainly won't fix it.

  • I have a scanner and i get the error code:201 what does this mean?

    i have a scanner and i get the error code:201 what does this mean?

    More information needed for someone to help... please click below and provide the requested information
    -PPro Information FAQ http://forums.adobe.com/message/4200840

  • Firefox will not show links to flv files. I get the error message for each flv file: "File not found. Firefox can't find the file at (path) .flv." Any mov and swf files in this same path will show. I can see the videos in Safari so the paths are correct.

    Firefox will not show links to flv files. I get the error message for each flv file: "File not found. Firefox can't find the file at http:// (path) .flv." Any mov and swf files in this same path will show. I can see the videos in Safari so the paths are correct.

    Is this a webpage that contains a link to a flv file? Please post a link to the page and tell us which link(s) are the problem flv files or else post a link to the .flv file itself.
    Alternately, click on one of the sample FLV File links on this page and tell us exactly what happens:
    http://www.mediacollege.com/adobe/flash/video/tutorial/example-flv.html
    It might also help if you post the exact error message, including the path to the flv file.
    '''Note:'''
    Depending on how you have Firefox set up, clicking on a FLV File link will either save the FLV file to your computer or Firefox may open it automatically in an external application right after downloading (Firefox may ask you first). Firefox itself can't play FLV files so you need a "helper" application (or a plugin for flv files, if ther is one. You can see if Firefox is already set up to download or open FLV files by going to Firefox Preferences and looking in the Applications list. Find the FLV file type in the list and, if the action is "Open with", it should show the application that can play FLV files (e.g., VLC Media Player or Perian). See [[Managing filetypes]] for more information.

Maybe you are looking for

  • Landscape mode not attainable

    From FILE -> Page Setup -> I select "Landscape," but the view remains in Portrait mode and I am not able to work in Landscape mode. I found one solution here that says I have to set the width and height for Landscape... any ideas as to WHY landscape

  • How do I export bookmarks in 3.6.6. Exporting via the Boomarks menu does NOT work.

    <blockquote>Locked by Moderator as a duplicate/re-post. Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=710076&forumId=1] Thanks - c</blockquote> == Issue == I have another kind of problem with Firefox ==

  • Error when I try to connect to BTFON HotSpot (This...

    Every time I try to connect to BTFON HotSpot through the ipod app, I get the following error. This hotspot is currently unavailable. If I try to connect manually, I get the connected tick, and the bars at top left, but Safari tells me I am not connec

  • Problem with DTT3500 soundset and onboard Soundblaster live! 24-bit

    Hi, I have bought a new PC with an MSI k8n sli platinum MB. this mainboard has a built in soundblaster live!24-bit chip onboard. it works great on headphones and normal 2 set speakers (analog connection). however, when I try to set them up at the DTT

  • G5 1.8 GHz DP

    I recently bought a used G5, which seems to be working fine, with 1 small issue. Any advice on this appreciated.... When I bring it back from sleep mode, the screen appears as usual. When I click anything with the mouse, nothing happens for about 2 m