Re: Re WOComponent .api files

"Jerry W. Walker" <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hi, William,

On Feb 4, 2007, at 7:52 AM, WILLIAM GARNETT wrote:

> Hi;
>
> And many thanks to Mike & Jerry.

That part was enjoyable, you're welcome.

> So you all agree it's not the .api files.

It's not the .api files, but the fact that they're missing might be  
causing you to miss a binding or bind the wrong thing during  
development.

> Another file that's missing is the .eomodeld~ file (Notice the ~) -  
> which I
> don't think does anything. ???

The .eomodel~ file is a backup file used by EOModeler to back up the  
current EOModel before applying your latest changes. If you make  
another change using EOModeler, it should reappear. It's also not  
used at run time.

> All I know is that it sporadically comes up with ClassCastException.
>
> This is definitely not due to a fault with the code: for example in  
> one case
> the procedure being called does nothing but removeObject( obj )  
> from the
> editingContext and then saveChanges(). No class casting involved  
> there at
> all.

There are all sorts of ways to cause a ClassCastException, but it  
sounds like you might have an error in your EOModel. Look very  
closely at the Value Class (Java) column. Does the type exposed there  
for each of your attributes match the type you're expecting? Also  
check the Value Type column and know the codes so that you can check  
whether EOF is doing the correct conversion from the DB value to your  
Java value.

If either of these columns is not being displayed, be sure that you  
have EOModeler in Table Mode (Choose the Tools->Table Mode menu item)  
and note that the window shows two panes, the top is the attribute  
table and the bottom is the relationship table. At the bottom left of  
each of these two tables is a popdown menu labeled "Add Column...".  
Click it and add the columns you need to the Attributes table. You  
can remove columns later by selecting the column name in the header  
and pressing the delete key.

To understand the Value Type column codes go to:

http://developer.apple.com/documentation/WebObjects/UsingEOModeler/ 
4WorkingWithAttributes/chapter_4_section_3.html#//apple_ref/doc/uid/ 
TP30001018-CH204-DontLinkElementID_207

> I am afraid I do not know how to get a Stack Trace in development  
> mode.
> Could you please tell me how to do that?

The stack trace should be automatic after a ClassCastException. You  
should be able to find it in your run log. If you're using Xcode,  
choose the Debug->Run Log menu item to display the run log and scroll  
to the bottom to see your exception and your stack trace. I would  
also suggest running in development mode with EOAdaptorDebugEnabled  
YES to see the SQL that EOF is generating. You might find some clues  
there.

If you're running under Eclipse and using Mike's Entity Modeler, I'm  
afraid you'll have to wait for advice from Mike (or any others here  
who are developing in that environment). I'm still an old Xcode/ 
EOModeler/WOBuilder developer.   Whoa....  What's that big meteor in  
the sky? A guy could become extinct if that hits the Earth!!!  :-)

Regards,
Jerry

> Thanks again,
>
>
>
> Cheers,
>
> Bill.
>
>
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev


--
__ Jerry W. Walker,
    WebObjects Developer/Instructor for High Performance Industrial  
Strength Internet Enabled Systems

     [email protected]
     203 278-4085        office
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.