beanFactory error SOLVED finally!!

Finally! I've found the root of this long standing problem. In my case
it happened when trying to store a null value (empty string) into a
numeric field. The populateBean method tries to call
getCanonicalName() on an empty string, and fails... I guess it casts
the empty string to a null and, obviously fails calling any method on
it.

Anyway, I solved it by adding the appropriate setters to the decorator
so when an empty string is passed, a null is persisted.

It didn't make a difference whether you had nullable set to true or
false in transfer.conf.

I had to modify the offending line in the beanFactory.cfc plugin. Line
364, from:
arguments.keyTypeAsString =
arguments.memento[key].getClass().getCanonicalName();
to:
arguments.keyTypeAsString = arguments.memento[key].getClass();

After this, I could see which field was causing the exception.

HTH,

Pedro.

Thanks Pedro, but this bug was resolved in 3.0 a while back, I am guessing you are using 2.6.4 right?

Give 3.0 a whirl

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Yeap, I’m still using 2.6.4. I’m struggling to finish the next release of an app on 2.6.4, once that’s out of the way, I’ll test 3.0.

I have certain limitations that could complicate the transition. We are (still) using CF7, and from the documentation, some plugins require CF8… anyway, I’ll test it as soon as I can :stuck_out_tongue:

Thanks for a great product… and book, which is also very useful,

Pedro.

2010/12/7 Luis Majano <lmajano@gmail.com>

No problem Pedro. Some things in 3.0 are cf8 and above. But the majority is cf7 compatible.