Solved

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

Posted on 2011-09-12
6
713 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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