I'm trying to get http status codes (esp. 404) by getResponseCode() from HttpUrlConnection in Java 1.1.
This is the first step after creating the connection by URL.openConnection()
But I only get the "good" codes as 200 and not any error codes, while a browser shows the normal http error.
Instead the program throws a FileNotFoundException "at"
Any Ideas?

You can get the error codes without exceptions if you set the request method on your connection via the HttpURLConnection to HEAD. Here is an example:
URL siteURL = new URL("");
HttpURLConnection urlConn = (HttpURLConnection)siteURL.openConnection();
String responseCode = urlConn.getResponseCode();
I hope this helps.

Similar Messages

  • Error while receiving by HTTP (error code: 400, error text: ICM_HTTP_CONNECTION_FAILED

    Hi experts,
    I have a big issue in production server,
    the Queues are stuking in smq2 " command to tRFC/qRFC: execute LUW again"
    if i am reprocess or press F6 it is going manually.
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
    - <SAP:Error xmlns:SAP="" xmlns:SOAP="" SOAP:mustUnderstand="1">
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText><html><head><title>Application Server Error</title> <style type="text/css"> body { font-family: arial, sans-serif;} </style> </head> <BODY text="#172972" link="#808080" vlink="#808080" alink="#8e236b" bgcolor=white leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"> <table height="61" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td background="http://xidist:8000/sap/public/icman/img/bluebar_tile.gif" height="30"><table> <tr> <td width=5></td> <td width=20% nowrap><font face=arial size="-1" color=white>SAP NetWeaver Application Server </font></td><td width=75% align="right" nowrap><font face=arial size="-1" color="white"><a href="">Help </font></td><td width=5% nowrap></font></td> </tr></table> </td><td rowspan=2 width=122 height=61 valign=top><img src= "http://xidist:8000/sap/public/icman/img/theme.jpg" width=122 height=61 border=0 alt="SAP"></td> </tr><tr><td background="http://xidist:8000/sap/public/icman/img/graybar_tile.jpg" height="31">  </td></tr> </table> <br><br> <table width=800> <tr><td width=50 nowrap> </td><td> <H2><b>404 Resource not found</b></H2><br>Partner not reached<br><br><hr> <table border="0"> <tr><td>Error:</td><td>-20</td></tr> <tr><td>Version:</td><td>7000</td></tr> <tr><td>Component:</td><td>ICM</td></tr> <tr><td>Date/Time:</td><td>Wed May 14 15:50:24 2014 </td></tr> <tr><td>Module:</td><td>icxxconn.c</td></tr> <tr><td>Line:</td><td>2341</td></tr> <tr><td>Server:</td><td>xidist_GXI_00</td></tr> <tr><td>Error Tag:</td><td>{004654a1}</td></tr> <tr><td>Detail:</td><td>Connection request from (110/28816/0) to host: xidist, service: 50000 failed (NIESERV_USED) EX-T110, U28816, 001 PIAFUSER,, 15:50:24, M0, W1, , 1/0</td></tr> </table> <p></p> </td></tr></table> <table><tr><td width=50 nowrap></td> <td nowrap><FONT SIZE=-1><a href="">&copy; 2001-2009, SAP AG</a></FONT> </td></tr></table> </body></html></SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error while receiving by HTTP (error code: 400, error text: ICM_HTTP_CONNECTION_FAILED)</SAP:Stack>
    Kiran polani

    Dear Sriram Ramani,
    in ths case some scenarios are working good. proxy to soap, idoc to soap and jdbc to proxy, proxy to jdbc all are working with out error.
    but my problem is in Soap to RFC case..
    for all RFC communication channels are working but some time it is throwing RFC_COMMUNICATION_ERROR and messages are stucks in smq2 with retry.
    when i check with retry error with in sxmb_moni log showing ICM_HTTP_CONNECTION_FAILED with error code 400.
    not for all signals for few signals for some time..
    Why it is happening i can't understand.
    in repository it is saying Repsitory object hmi failed and address already in use.
    is there any problem with loading IR objects.
    Please suggest me good suggestion for this type of issue what can do for this to resolve.
    Kiran Polani

  • Error while receiving by HTTP (error code: 110)  ?

    Hi Experts,
    I am working on IDOC to file Scenario.
    I am getting this error in SXMB_MONI. What may be the reason.
    <SAP:Error xmlns:SAP="" xmlns:SOAP="" SOAP:mustUnderstand="">
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error while receiving by HTTP (error code: 110, error text: )</SAP:Stack>
    Best Regards,

    Check these threaads:
    Re: XI Error when upgraded to SP14 (Error Code 110) CLIENT_RECEIVE_FAILED

  • HTTP Error Code 500 Internal Server Error creating connection

    Hi, i have an error when i try to create a database connection
    i have windows 7
    php 5
    mysql 5
    if i try to connect to mysql with a icode i gererate it connects perfect.
    if i use for example ems mysql manager it connects perfect to the databases
    but when i try to create a connection in dreamweaver it appears:
    HTTP Error Code 500 Internal Server Error
    i dont know what to do.
    i have done a lot of steps for solve other errors:
    - chance mysql passwords for old_password
    - remove cache file
    any idea ??

    I would look at your log files on your server to see what is the issue.
    You most likely will have a php error log and a server error log.  That will point you in the right direction.

  • How to use : bind character in DB adapter Select Query SOA11g. Getting Error code :17003 .java.sql.SQLException: Invalid column index error

    Hi All,
    The Actual query to perform is below.
    SELECT name,number from emp  WHERE CASE WHEN :1='T' AND term_date IS Not NULL THEN 1 WHEN :1='A' AND term_date IS NULL THEN 1 WHEN :1='ALL' THEN 1 ELSE  1 END = 1;
    I have tried in DB adapter like below as a parameter for :1 as #vInputParam
    SELECT name,number from emp  WHERE CASE WHEN #vInputParam='T' AND term_date IS Not NULL THEN 1 WHEN #vInputParam='A' AND term_date IS NULL THEN 1 WHEN #vInputParam='ALL' THEN 1 ELSE  1 END = 1;
    Getting Error code :17003 .java.sql.SQLException: Invalid column index error.
    Please suggest me on using ':' bind character in DB adapter Select Query SOA11g.
    Can someone help me on this please?

    Could you please make sure your binding style(Oracle Positional,Oracle named..etc) of the Seeded VO and Custom Vo are same.
    This is the option you will get when you are extending your vo. So make sure that both are same.
    You can refer the below link too
    VO extension leads to "Invalid column index" exception

  • Getting the error: Error while receiving by HTTP error code: 110

    I have developed an interface which actually gets data from SCM system and in BPM to gets additional data from R/3. There are five synchronous call to this R/3 to get different sets of data. I am using only one communciation channle from BPM to R/3. The interface works perfectly OK in the development system. When the interface is migrated to the test system I found that the four calls work perfectly fine while the last call error out as below and the J2ee server goes down:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
    - <SAP:Error xmlns:SAP="" xmlns:SOAP="" SOAP:mustUnderstand="1">
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error while receiving by HTTP (error code: 110, error text: )</SAP:Stack>
    Any input/help will be appreciated. I have tried increasing timeout/connection alive time but still not get resolved.
    Thanks in advance,

    Hi Prateek,
    Thanks. But this note I have checked before and this seems not related. I actually found out the system logs in SM21 and saw the "Operating system call recv failed (error no. 10054)". What I did then is I seach notes related to this error and found a numebr of SAP notes. And I have informed the Basis guys to look into the notes and the system logs. They are working on this and they are deleting the old messages which have errored out. They are suspecting the system memory or too many old messages would have caused this issue.
    If you have any knowledge of why this error would have occurred please let me know.

  • HTTP error code: 110

    Hi ALL
    Can any body give me details regarding  what doest this error code indiacte?
    " Error while receiving by HTTP error code: 110"
    any related document or SAP note will be helpfull?
    Thanks in advance

    Hi Sudhir
    Thanks for the reply. I have already gone through this thread.
    I am not using any HTTP adapter. i am using IDOC adsapter only.
    and this error occured on my production server. So we cant say like the thread you mentioned that this time it need any HTTPS connection configured coz it was working fine already.
    Although this problem was solved by restarting the server.But its not advisable to refresh server on production frequently..also i want to know the complete description of this error ?
    what this error stands for? what is the permannet solution of this?
    Also if there is any supporting document or SAP Note to clarify this , will be highly appreciated/
    any input experts?

  • MySQL Connection - Select Database - HTTP Error Code 405 Method Not Allowed?

    We've set up a MySQL database with our host and can connect to that, and create, edit, delete tables using HeidiSQL, without a problem.
    However when we attempt to set up the connection in the Databases tab of our Applications panel in Dreamweaver we receive the following error:
    HTTP Error Code 405 Method Not Allowed
    We have entered the following in the MySQL Connection box:
    Name: <name of our connection>
    Server: <IP address of our database>
    Username: <our database username>
    Password: <our database password>
    When we click the "Select" option next to the Database field, that's when we receive the above mentioned error.
    We noticed that there was a fix posted by Adobe at:
    ...but that link is long since dead, however it does seem to indicate that Adobe are/were aware of this issue.
    Can anyone help?  We're trying to move from Classic ASP / MSSQL to PHP / MySQL but have hit a barrier right from the off, which isn't very encouraging.  Hope someone can ease our concerns with PHP and MySQL.
    Much appreciated.

    Thank you SnakEyez02.
    I had the Testing Server set to Local/Network but didn't have MySQL installed locally.  Changed that setting to FTP and it picked up on the database correctly.
    When using MSSQL it doesn't matter whether you choose Local/Network or FTP it just picks up the online database regardless.  I guess this must just be a difference between it and MySQL.
    Thanks for the advice.  Much appreciated.

  • HTTP Error Code 400 Bad Request error when connecting to SQL db

    I realized I should move this to a new post since it was a new question...
    I am trying to connect to a distributed SQL database from CS4.
    Let me show you how the connection is built... and then maybe someone can tell me what I am doing wrong...
    First I go to the database panel:
    I click on the '+' sign to add an MS SQL Server Connection:
    That brings up the SQL Server Connection window where I am supposed to replace the placeholders with my server values:
    After I enter the correct values and click test, I get the error (HTTP Error Code 400 Bad Request)... These values work from SQL Server Management Studio on the same PC.
    Just as a side note... I tried one other thing that makes me think SOMETHING is wrong here:
    If I choose as OLE DB Connection instead... and click the 'Build...' button and then enter the values in the Data Link Properties Window (OLE DB Provider for SQL Server, and then the connection info on the Connection tab) and then click Test Connection on the Data Link Properties window, it says my test succeeded. Then I click 'ok' which takes me back to the OLE DB Connection windows with the connection string pre-filled, and click test on THAT window and I get the same HTTP Error Code 400 Bad Request error...
    Hopefully that is enough detail that someone can can tell me what I have broken?

    You will get a better response if you ask this question on the DW Application Dev forum. This forum mainly covers client-side issues.

  • Why am I getting http error code 413 when I try to upload a photo?

    I am trying to upload a picture from my computer to the web site. I have done this 19 times before, but suddenly I'm getting "http error code: 413" and my picture won't upload. I've tried closing Firefox, updating all my plug-ins, and rebooting the computer, none of which has helped. When I Google this error, I don't understand what I'm reading.

    Hello tschuss!
    I'm so sorry to hear that your update has not successfully completed! I can certainly help to point you in the right direction. Click the link to access the Software Upgrade Assistant, which will provide instructions for how to complete the update if it has failed.
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • List of all HTTP error codes returned by EWS

    Hi everybody,
    I need all the HTTP error codes returned by Exchange when we use Exchange Web Services.
    Thanks & regards,
    Talib Hussain

    We don't have a document that lists every possible error. EWS runs through IIS on the CAS server, so theoretically you could receive any HTTP error that IIS can return.

  • Received HTTP error code 400 while fetching source feed. - Just Started 2 weeks ago; preventing iTunes podcast from updating

    Good day.
    When trying to update my feed, I received an HTTP error code 400 while fetching source feed message. Nothing has changed on my end as I've been using Dropbox for the feed and the files since last year and was able to successfully update the feed up to two weeks ago.
    I did run through all the tools on the Feedburner page (validator, podmedic, feedmedic) received a clean bill of health on the feed and I've looked at both Feeburner's site as well as Dropbox's support page to see if anything could have changed (requiring https or some other format for the feed), but no luck so far.
    The strange thing is that on the feed itself, it's listed as  However, when I tried to 'RESYNC' it, the 400 error was displayed and it's listed as which is says it cannot reach.
    Any suggestions would help as I've not been able to update my iTunes podcast for two weeks now.

    The URL you give redirects to
    This appears to be a viable feed. However it contains this tag:
    That will redirect iTunes (though nothing else) to the enclosed URL, and that is a web page containing a display of the feed and a download button, which is no use to iTunes. Consequently on attempting to subscribe in iTunes with any of these URLs the feed comes up empty. You need to get rid of these redirects and provide a direct link to the feed file; and you should not use https (encrypted connection) but http. Also, Dropbox isn't a good place to host your files, but if you really must use it you have to serve as a direct access in the same way as a web page, not as sharing. You have your media files on Dropbox as well, and the URL redirects to an https version, though it does play in a browser. This itself may cause problems; and if your podcast gets popular you will run into problems as Dropbox isn't really geared to do this sort of thing.

  • HTTP Error Code 405

    Hi I am new to web design and just started learning
    Dreamweaver 8 and have hit a little bump in the road. I have been
    following a book (Dreamweaver 8 Unleashed) as a teaching tool and
    have come to the point in the totorial where I need to connect a
    database to my web page. I'm running on windows vista premium with
    IIS 7, ASP.NET, and Microsoft Access 2007. I follow all the steps
    to connect the Access Database but when I try to test the
    connection string, I get an HTTP Error Code 405 Method Not Allowed.
    I have tried to use my limited knowledge to try and solve the
    problem, but am all out of ideas. If anyone could help me solve
    this problem I would be extremely grateful. It's really frustrating
    to be stuck like this and not able to move forward.

    > Thanks for the reply. I have to head to class here in a
    few minutes so I
    > will try the things you mentioned when I get home. Out
    of curiousity, why
    > do you recommend I switch to SQL over Access?
    Access will be just fine for you to learn data access. It
    runs bazillions of
    production sites, regardless of how much it is pooh-poohed by
    old-timers. After you get more comfortable with the process,
    you can
    download SQLEXPRESS for your development.
    In Internet Explorer, go to Tools - Internet Options -
    Advanced, and uncheck
    "Show friendly error messages" so IE will display the true
    error message.
    Then, in Computer Management - Services and Applications -
    Information Server - Web Sites - Default Web Site - IIS - ASP
    - Compilation,
    change "Send Errors To Browser" to TRUE.
    Lastly - navigate the file system to
    C:\Windows\ServiceProfiles\NetworkService\AppData\Local and
    give that folder
    Change permission for IUSR.

  • MySQL Connection "HTTP Error Code 403 Forbidden"

    I can't seem to connect to my MySQL database on Go Daddy. I
    have the db set up for remote access and can connect just fine with
    Sequel Pro. But, when I try to connect to build my application in
    Dreamweaver I always get "HTTP Error Code 403 Forbidden". I've
    spent a good chunk of the last 3 days banging my head against this
    problem. At this point I'm thinking of dumping Dreamweaver. I
    thought these things were supposed to be easy? Yes, I'm very
    All help is greatly appreciated.

    Pls check if your database name is already taken by someone
    else on GoDaddy. GoDaddy has a policy that a database name taken on
    any website hosted by them cannot be taken by another user.
    If your database name was accepted by GoDaddy, see if the
    first few lines of your SQL file contain code like:
    CREATE DATABASE . . . or
    USE . . .
    If such lines are there, delete them so that the code starts
    Save the SQL file and try to upload it.
    Good luck!

  • Simulate HTTP Error code

    Our clients wants to test a given set of HTTP error codes. Is there a way to simulate these ? We know the HTTP error code that clients want to simulate in the payload, but how do we simulate those.

    If I understand right, you want to force web server to return error code 503 or 500 . This is what you can do
    1. edit the obj.conf or your virtual server specific obj.conf
    2. Add the following line under <Object name="default">
    Error code="200" fn="set-variable" error="503"
    this would return 503 even for successful serving (which would cause 200 to be returned by the default).
    Now, this would cause all urls to respond with 503. If this is not what you want, then you can do something like (however, you need Web Server 7 Update 1)
    <Object name="default">
    <If $uri =~ 'whatever you want to match'>
    Error code="200" fn="set-variable" error="503"
    this would cause only the matched uri to return with error code 503
    hope this helps

Maybe you are looking for

  • Can't download drivers for Vista

    I've tried downloading the drivers for my HP2610 all in one printer to my laptop which is still running Vista. Every time I get an error that the file was deleted because it contains a virus. The error comes from Windows, but I can't determine what p

  • Button Event doesn't work after interactive pdf form creation

    Hi everyone, I have an interactive form created after clicking on a button in view 1. The interactive form ui element is then in a view 2, with a button "back" to return to view 1. The problem is that this button no longer works (it worked on 2004, i

  • Why are there pending messages that can't be consumed?

    Hi all, I am using Glassfish with a self made monitoring/stress-testing application. In this app I can define consumers and producers, so I can somehow see the behavior of the system under many different conditions. But something odd is happening: th

  • Aperture 3 and Facebook exporting???  doesn't update

    So I tried the new Facebook exporter from Aperture 3. You can only put pics in a new Facebook album, or drag them into an album that you have created from within Aperture 3. But when I add photos by dragging them, they do not show up on Facebook. Ape

  • Business Activity table

    Hi All, I was just trying to figure out where exactly the dates 'From' and 'To' in business activity transcation are stored , i checked some of the table like crmd_orderadm_h but couldn;t get the one. Best Regards, Sanju