Flex and CF gave me this error: flex.data.adapters.ChangeObjectImpl / java.lang.NoClassDefFoundError

Over at Flextras.com I created an AutoCompleteComboBox Flex Component. One of the major benefits of the AutoCompleteComboBox over other options is the ability to pull data from a database. I have it working, it went through our beta testers, and was released over a month ago.

But, no demo for this functionality exists on the site, yet. How come? Because I couldn't get Flex Remoting to work with ColdFusion on the production site. Everything worked fine on my local dev box. Everything worked fie on my development / staging server. I kept getting this error when trying to do anything on the production box:


Message: flex.data.adapters.ChangeObjectImpl
Type: java.lang.NoClassDefFoundError

This error was being e-mailed to be via the error handler in the Application.cfc. There was also a stack trace as part of the error e-mail, along with other information such as session information and cgi variables. None of it was any help in diagnosing the error.

I believe this is what was happening:

  1. Flex App makes remote call
  2. ColdFusion throws error because it has no idea how to translate CFs array of CFCs into the Flash Player's array of AS Objects.
  3. Error handler e-mailed me the error. The error handler ran succesfully, but returns no value.
  4. Because the error was caught, The Flash Player sees that the remote call has run succesfully. It executes the result handler, with a null result.
But, I still had no idea what was causing the error. Googling around offered very little help. Looking at packets with ServiceCapture was no help. All it would tell me was that nothing was being returned from the method call. It was registering as a successful call, so the result handler was being fired not the fault handler.

After some trial and error I discovered a few things, in no particular order:

  • If the remote method returned a simple value, such as a string, it worked without an issue.
  • If the remote method returned a query object, it worked without an issue.
  • If the remote method returned a mapped object, it caused the "ChangeObjectImpl" "NoClassDefFoundError" error.

So, why was this error happening? After Googling some more, I came across this link. It appears that someone fixed a similar error by moving cfgatewayadapter.jar and concurrent.jar from flex/jars to Coldfusion/lib/ .

I let my host know; he move the files, restarted the server, and bam! Everything started working. Huh? Why? Does anyone have any idea? Why wasn't this stuff configured from the start? Why did moving these files address the issue?

I'm glad it's done and I can finally post up the sample for all to see. But, now I'm having issues with the case sensitivity of a CF Mapping. It was originally set up in all lower case, not mixed case like my dev machine. ColdFusion doesn't care, but Flex does. The host told me they changed the case on the server. I Restarted the machine. Remoting is st ill returning the CFC w/ the mapping in all lowercase. Any ideas on that one?

I know I've been light at blogging on this blog, and I apologize for that. Most of my "Creative" energies for blogging are being sapped by the Flextras Friday Lunch weekly Q&A session, The Flex Show, and creating demos for Flextras.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
TJ Downes's Gravatar Hey Jefferey, sounds to me like a misconfiguration in the jvm.config. Obviously CF needs to know where the web-inf/flex folder is and add it to the classpath for those to be available, so it appears that someone probably removed that path from the java.args argument in the jvm.config
# Posted By TJ Downes | 6/23/09 12:07 PM
Jeffry Houser's Gravatar TJ,

Your theory on a misconfiguration seems logical to me.

It is a manged server, so I have no direct access to it and did not set it up myself. I'm not sure how such a misconfiguration could have taken place.

It was definitely a frustrating, "flailing blindly in the dark" style experience.
# Posted By Jeffry Houser | 6/23/09 1:28 PM
David Buhler's Gravatar Without digging into that config file, there are 3 or 4 different types of results you can alter the forced-case on.

You'll need to verify the host changed the case on the right node.
# Posted By David Buhler | 6/23/09 6:40 PM
Jeffry Houser's Gravatar David,

The issue w/ mapping casing was solved. Basically, the host deleted the mapping, recreated it, and restarted the server.
# Posted By Jeffry Houser | 6/23/09 11:40 PM
All Content Copyright 2005, 2006, 2007, 2008, 2009 Jeffry Houser. May not be reused without permission
BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.002.