I don't see why having this in a Direct Action should cause this error either. The first thing I would do is to log out the name of the class that is failing to cast properly and also its contents (e.g. toString()).

Chuck


On May 26, 2006, at 3:43 PM, Timmy wrote:

All:

I have a very basic project set up to simply search our ldap directory. I used the JNDI Adaptor to reverse engineer our ldap directory and the model framework works great. No problems.

In trying to expand on the project and make it more flexible I moved the exact same search logic from Main.java into DirectAction.java. The only changes I made were to pass the search string from Main to my DirectAction. Now when executing a search I get the following exception on inetOrgPerson.mail().

<snip>
Error: java.lang.ClassCastException: com.webobjects.foundation.NSMutableArray
Reason: com.webobjects.foundation.NSMutableArray

java.lang.ClassCastException: com.webobjects.foundation.NSMutableArray
        at inetOrgPerson_EOBase.mail(inetOrgPerson_EOBase.java:84)
        at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
at KeyValueCodingProtectedAccessor.methodValue (KeyValueCodingProtectedAccessor.java:54) at com.webobjects.foundation.NSKeyValueCoding $_MethodBinding.valueInObject(NSKeyValueCoding.java:1160) at com.webobjects.eocontrol.EOCustomObject.valueForKey (EOCustomObject.java:1559) at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey (NSKeyValueCoding.java:498) at com.webobjects.foundation.NSKeyValueCodingAdditions $DefaultImplementation.valueForKeyPath (NSKeyValueCodingAdditions.java:212) at com.webobjects.eocontrol.EOCustomObject.valueForKeyPath (EOCustomObject.java:1675) at com.webobjects.foundation.NSKeyValueCodingAdditions $Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149) at com.webobjects.foundation.NSKeyValueCodingAdditions $DefaultImplementation.valueForKeyPath (NSKeyValueCodingAdditions.java:217) at com.webobjects.appserver.WOComponent.valueForKeyPath (WOComponent.java:1600) at com.webobjects.appserver._private.WOKeyValueAssociation.valueInCompone nt(WOKeyValueAssociation.java:46) at com.webobjects.appserver._private.WOString.appendToResponse (WOString.java:55) at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToRespo nse(WODynamicGroup.java:121) at com.webobjects.appserver._private.WORepetition.appendToResponse (WORepetition.java:273) at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToRespo nse(WODynamicGroup.java:121) at com.webobjects.appserver._private.WOConditional.appendToResponse (WOConditional.java:70) at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToRespo nse(WODynamicGroup.java:121) at com.webobjects.appserver._private.WODynamicGroup.appendToResponse (WODynamicGroup.java:130) at com.webobjects.appserver.WOComponent.appendToResponse (WOComponent.java:992) at com.webobjects.appserver.WOComponent._appendPageToResponse (WOComponent.java:1388) at com.webobjects.appserver.WOComponent._generateResponseInContext (WOComponent.java:1356) at com.webobjects.appserver.WOComponent.generateResponse (WOComponent.java:1351) at com.webobjects.appserver._private.WOActionRequestHandler._handleReques t(WOActionRequestHandler.java:259) at com.webobjects.appserver._private.WOActionRequestHandler.handleRequest (WOActionRequestHandler.java:142) at com.webobjects.appserver.WOApplication.dispatchRequest (WOApplication.java:1306) at com.webobjects.appserver._private.WOWorkerThread.runOnce (WOWorkerThread.java:173) at com.webobjects.appserver._private.WOWorkerThread.run (WOWorkerThread.java:254)
        at java.lang.Thread.run(Thread.java:613)


</snip>

The exception happens whether I search for a valid inetOrgPerson or not - so even where no results would be expected.

If I leave the search code in my Main component it works fine and there are no exceptions. Does anyone have an idea that could point me in the direction of figuring this out? What seems strange to me is that the model framework seems to be expecting different results under the two scenarios. I'd really like this to be a direct action so that I an easily have our webmaster call it from our school's site as a whole.

thanks in advance for any wisdom,

Tim

-------
Tim Worman
Programmer/Analyst
UCLA Graduate School of Education and Information Studies
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]

--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to