CFHTTP bug?

23 September 2010 02:05 (EST)
Can someone confirm that CF 8/9 throws an error (java.lang.ArrayIndexOutOfBoundsException) on simple CFHTTP call?

<cfhttp method="get" url="http://brad.livejournal.com/" />

StackTrace is following:

java.lang.ArrayIndexOutOfBoundsException: 22
HTTPClient.Codecs.base64Decode(Codecs.java:262)
HTTPClient.VerifyMD5.verifyHash(ContentMD5Module.java:155)
HTTPClient.MD5InputStream.real_close(MD5InputStream.java:141)
HTTPClient.MD5InputStream.read(MD5InputStream.java:93)
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
java.io.BufferedInputStream.read(BufferedInputStream.java:317)
coldfusion.tagext.net.HttpTag.getUrlContents(HttpTag.java:1890)
coldfusion.tagext.net.HttpTag.connHelper(HttpTag.java:938)
coldfusion.tagext.net.HttpTag.doEndTag(HttpTag.java:1075)
cftest2ecfm1416521183.runPage(..\path\to\test.cfm:1)
coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:282)
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
coldfusion.CfmServlet.service(CfmServlet.java:198)
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
com.seefusion.Filter.doFilter(Filter.java:49)
com.seefusion.SeeFusion.doFilter(SeeFusion.java:1500)
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
jrun.servlet.FilterChain.service(FilterChain.java:101)
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


Apparently following call works well:

<cfhttp method="get" url="http://www.livejournal.com/" />

Any thoughts on this?

Discussion (7 comments)

Ed Ed: 23 September 2010 02:56 (EST)

i can confirm it. and it does look very weird

Todd Todd: 23 September 2010 03:55 (EST)

I think this is a LiveJournal issue or a combination LJ/CF problem, not specifically a CF bug.


I came across your question while poking around on Google to find an answer for my own problem. I have used the following format to get an XML feed of my journal just fine for at least a year with no problem:

<cfHTTP url="http://brad.livejournal.com/data/rss" method="GET" timeout="30"></cfHTTP>


Only in the past couple of days have I received the java.lang.ArrayIndexOutOfBoundsException error. I don't know if there's a problem at LJ, or if they purposely changed something that clashes with the ColdFusion tag, but I'm looking for a solution, as well.


If you find an answer, I hope you can post it. I'll bookmark this page and do the same if I find anything.

Dmitry Yakhnov Dmitry Yakhnov: 23 September 2010 17:37 (EST)

Hi Todd,

I had no problem fetching LJ data (including RSS) as well, but apparently they have introduced Content-MD5 header on 9 Sep 2010, so CFHTTP tries to calculate MD5 sum and fails.

Have a look for a link from Ed below, we can use Java libs to replace cfhttp until fix is released.

Ed Ed: 23 September 2010 04:11 (EST)

CFHTTP has many "issues" that make it not good enough for all situations. But for this particular example, instead of CFHTTP can be used for example the function i posted here: http://blog.1smartsolution.com//index.cfm/action:posts.entry/id:267/CFHTTP-Frustration

Just checked it and it works fine with the provided URL

Dmitry Yakhnov Dmitry Yakhnov: 23 September 2010 17:39 (EST)

Hi Ed,

Many thanks for the link, I will use your workaround until CF is patched.

Peter J. Farrell Peter J. Farrell: 23 September 2010 04:14 (EST)

If you look at the stack trace, I see VerifyMD5 in it -- if you look at the headers from LiveJournal you see:

Content-MD5 GnVmvkAz8R5aaK2e+eZ7FQ

I think that something is up with CF trying to verify the MD5 hash. I see OpenBD CFML engine working just fine -- so it is definitely a CF issue.

Dmitry Yakhnov Dmitry Yakhnov: 23 September 2010 17:41 (EST)

Hi Peter,

Yes, LJ has introduced Content-MD5 header on 9 Sep 2010, so CF fails to calculate verification hash. I will submit bug report to Adobe later on today.

Add your comment
*
*
*
*
*

Captcha Code Please enter the number on the left.
Sorry for asking you to do so.
Reload image