Wednesday, January 20, 2016

incorrect response header at com.jnbridge.jnbcore.c.b.a.a

There have been many times I've found myself writing some glue code in C# to provide integration into a system that ColdFusion otherwise couldn't do. Usually, this works smoothly; I actually prefer the C# integration better than the Java integration.

But then, every so often, it crashes for no clear reason. The error message is just "incorrect response header" and the stack trace isn't much more helpful:
com.jnbridge.jnbcore.c.b: incorrect response header at com.jnbridge.jnbcore.c.b.a.a(Unknown Source) at com.jnbridge.jnbcore.DotNetSideProxy.int(Unknown Source) at com.jnbridge.jnbcore.DotNetSideProxy.objectVirtualCall(Unknown Source) at com.bitfauna.StringLonginator.StringLonginator.Embiggen() at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:126) at coldfusion.runtime.dotnet.DotNetProxy.invoke(DotNetProxy.java:38) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432) at
and on and on.

I'm here to help you begin the healing process. You are not alone!

Sadly, I don't have a fix. What I do have is an explanation, in the hopes that you can work around this. This error pops up (very consistently) when you are trying to return a large string back from .NET. I've written a small test program to activate the bug.

According to my tests, returning a string of length 49994 or greater will cause the crash, while anything smaller is safe. Hopefully, you can keep your string below the threshold of doom. If not, you might want to go complain to Adobe on this old thread.


Here's the CFML code:
And this is the component it calls:

No comments:

Post a Comment