• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: java.lang.ClassCastException when calling an EO's savechanges() method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java.lang.ClassCastException when calling an EO's savechanges() method


  • Subject: Re: java.lang.ClassCastException when calling an EO's savechanges() method
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 13 May 2005 15:11:41 -0700

OK, now we are getting someplace. This is supposed to return a Number. Its not. Check the EOModel to see how this is modeled. You might be missing a Value Type or something. Also, log out the class.

On May 13, 2005, at 3:07 PM, WebObjects wrote:

Tbltasks.java is the .java file created by EOModeler, on line 243-245 is:

    public Number privateindicator() {

Object o = storedValueForKey("privateindicator");
if (0 != null) NSLog.debug.appendln("class of privateindicator " + o.getClass().getName());
        return (Number)storedValueForKey("privateindicator");
    }


Chuck

..."privateindicator" is an Attribute in the Entity

Better trace from console:
[2005-05-13 14:43:46 PDT] <main> Waiting for requests...
[2005-05-13 14:44:02 PDT] <WorkerThread1> java.lang.ClassCastException
at Tbltasks.privateindicator(Tbltasks.java:244)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja va:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso rImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAcce ssor.
java:54)
at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject (NSKe
yValueCoding.java:1160)
at
com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java :1559
)
at
com.webobjects.eocontrol.EOCustomObject.validateForSave(EOCustomObject. java:
1407)
at
com.webobjects.eocontrol.EOCustomObject.validateForUpdate(EOCustomObjec t.jav
a:1490)
at
com.webobjects.eocontrol.EOEditingContext.validateTable(EOEditingContex t.jav
a:2191)
at
com.webobjects.eocontrol.EOEditingContext.validateChangesForSave(EOEdit ingCo
ntext.java:2981)
at
com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges(EOEdit ingCo
ntext.java:3222)
at
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext. java:
3152)
at TestPage.updateRecord(TestPage.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja va:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso rImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAcce ssor.
java:54)
at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject (NSKe
yValueCoding.java:1160)
at
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueF orKey
(NSKeyValueCoding.java:1268)
at
com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1539)
at
com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyVal ueCod
ing.java:498)
at
com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementati on.va
lueForKeyPath(NSKeyValueCodingAdditions.java:212)
at
com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java: 1600)
at
com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponen t(WOK
eyValueAssociation.java:46)
at
com.webobjects.appserver._private.WOSubmitButton.invokeAction(WOSubmitB utton
.java:70)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(W ODyna
micGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamic Group
.java:110)
at com.webobjects.appserver._private.WOForm.invokeAction(WOForm.java:82)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(W ODyna
micGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamic Group
.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1166)
at com.webobjects.appserver.W[2005-05-13 14:44:02 PDT] <WorkerThread1>
<com.webobjects.appserver._private.WOComponentRequestHandler>: Exception
occurred while handling request:
java.lang.ClassCastException
OApplication.invokeAction(WOApplication.java:1375)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWi thPre
paredPage(WOComponentRequestHandler.java:196)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWi thPre
paredSession(WOComponentRequestHandler.java:287)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWi thPre
paredApplication(WOComponentRequestHandler.java:322)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleRequ est(W
OComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleReque st(WO
ComponentRequestHandler.java:432)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.ja va:13
06)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread .java
:173)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.jav a:254
)
at java.lang.Thread.run(Thread.java:552)




on 5/13/05 14:56, Chuck Hill at email@hidden wrote:


On May 13, 2005, at 2:52 PM, WebObjects wrote:

Updated Dev. platform using WO523Developer.dmg, now I get the error on
the
Dev platform as well as Deploy - I guess this is a 'good' thing. Here
is
the stack trace. I cut-n-pasted it from the browser window (it's not
pretty). Again, the error occurs when sending the context the
.saveChanges() command. Is this legible? (thanks!)


No, not really. Can you copy it out of the console in xCode?
File
Line#
Method
Package
Tbltasks.java
244
privateindicator

What is on line 244 of Tbltasks.java?


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
village.net


This email sent to email@hidden

--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development 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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: java.lang.ClassCastException when calling an EO's savechanges() method (From: WebObjects <email@hidden>)

  • Prev by Date: Re: java.lang.ClassCastException when calling an EO's savechanges() method
  • Next by Date: Re: java.lang.ClassCastException when calling an EO's savechanges() method
  • Previous by thread: Re: java.lang.ClassCastException when calling an EO's savechanges() method
  • Next by thread: java.lang.ClassCastException
  • Index(es):
    • Date
    • Thread