Solved

CFHTTP fails with error: "I/O Exception: null"

Posted on 2011-09-12
6
680 Views
Last Modified: 2012-05-12
Good afternoon,

I'm having some issues with Coldfusion MX7.  An http request that worked for quite a long time now fails with "Connection Failure. Status code unavailable. " and errordetail: "I/O Exception: null".

Submitting the url in my browser returns a successful response, so I've no idea what the problem might be...

Here is the original code, which results in "Variable GEOCODED not defined.":
    <cfhttp url="http://geocoder.us/service/csv/geocode?zip=#url.zip#" method="GET" timeout="10" name="geocoded" columns="LATITUDE, LONGITUDE, CITY, STATE, ZIP" delimiter="," firstrowasheaders="no">        
    <cfdump var="#geocoded#" label="geocoded" />

Open in new window



I tried to simplify things so I could track down what might be happening:
<cfhttp url="http://geocoder.us/service/csv/geocode?zip=#url.zip#" method="GET" timeout="10" result="test">        
<cfdump var="#test#" label="test" />   

Open in new window


This yields the struct:
test - struct
Charset 	[empty string]
ErrorDetail 	I/O Exception: null
Filecontent 	Connection Failure
Header 	[undefined struct element]
Mimetype 	Unable to determine MIME type of file.
Responseheader 	
test - struct [empty]
Statuscode 	Connection Failure. Status code unavailable.
Text 	YES 

Open in new window


Any nudges in the right direction would be greatly appreciated!
0
Comment
Question by:TomEA
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 36523084
Make sure you are not behind proxy, the error is connection failure. If you are behind proxy then use ProxyPort and ProxyServer attributes for CFHTTP..
0
 
LVL 1

Author Comment

by:TomEA
ID: 36523174
Good thought, but no proxies here!
0
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 36523220
I did a test of the above URL and was able to connect.. so it has definitely to do with your network blocking it..


Charset       [empty string]
ErrorDetail       [empty string]
Filecontent       33.143792, -96.83938, Frisco, TX, 75034
Header       HTTP/1.1 200 OK Content-Type: text/plain Connection: close Vary: Accept-Encoding Date: Mon, 12 Sep 2011 14:57:10 GMT Server: Apache/2.2.9 (Debian) mod_perl/2.0.4 Perl/v5.10.0
Mimetype       text/plain
Responseheader       
test - struct
Connection       close
Content-Type       text/plain
Date       Mon, 12 Sep 2011 14:57:10 GMT
Explanation       OK
Http_Version       HTTP/1.1
Server       Apache/2.2.9 (Debian) mod_perl/2.0.4 Perl/v5.10.0
Status_Code       200
Vary       Accept-Encoding
Statuscode       200 OK
Text       YES
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 36523232
Here is what I tried..

<cfhttp url="http://geocoder.us/service/csv/geocode?zip=75034" method="GET" timeout="10" result="test">        
<cfdump var="#test#" label="test">

Open in new window

0
 
LVL 36

Accepted Solution

by:
SidFishes earned 250 total points
ID: 36523381
I can confirm you code works for me.

what I tried

  <cfhttp url="http://geocoder.us/service/csv/geocode?zip=90210" method="GET" timeout="10" name="geocoded"
columns="LATITUDE, LONGITUDE, CITY, STATE, ZIP" delimiter="," firstrowasheaders="no">        
    <cfdump var="#geocoded#" label="geocoded" />


which returned
geocoded - query
        CITY       LATITUDE       LONGITUDE       STATE       ZIP
1       Beverly Hills       34.088808       -118.40612       CA       90210


I can cause an 500 server error (which might be displayed as a connection failure with debugging off) by not passing in a value for url.zip so maybe hard code a value to check that...
0
 
LVL 1

Author Closing Comment

by:TomEA
ID: 36524786
This led me on the road to the solution!  If the zipcode is not found, the web service returns a blank page, which I presume coldfusion was interpreting as a connection failure.  I added some logic to determine if a proper response had been returned and went on with my day.  Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now