Abstract causes server exception
Abstract causes server exception
- Subject: Abstract causes server exception
- From: Ian Joyner <email@hidden>
- Date: Fri, 2 Sep 2005 11:15:35 +1000
Since I found the solution to my own problem, but could not find it
documented in either the Omni list or here, I thought I'd write it up
in case others hit the same several-hour wasting problem.
I created a new model in my project and most of the entities were
subclasses of a generic entity, so I created in EOModeler the generic
entity with abstract set and subclassed the entity. When I ran this,
I got an exception on the server side:
[2005-09-02 10:20:44 EST] <WorkerThread5> Server exception: null
[2005-09-02 10:20:44 EST] <WorkerThread5> java.lang.NullPointerException
at
com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationE
ditingContext(EODatabaseChannel.java:770)
at
com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationE
ditingContext(EODatabaseChannel.java:806)
What I found was that subclassing in EOModeler had not reset the
abstract setting (a property that should not be preserved). This is
strange because properties like client-side attribute are not
preserved when subclassing.
Perhaps this could be documented in the next WebObjects book, but I
can think of three things Apple could do to improve WO in order to
avoid this kind of (at worst project-killing) grief.
1) Fix EOModeler so that abstract is reset when subclassing and all
the many little niggles with EOModeler like this.
2) Put a run time check at all the places like line 770 so that at
line 770 (or earlier in the call chain) a fetch against an abstract
entity is rejected. That is put much more DBC into WO (or just
rewrite the whole thing in Eiffel!)
3) Integrate checks into the build process or into Interface Builder
so that you are not allowed to do anything that might result in a
fetch against an abstract entity in the first place (this is the
difficult option).
I think if all these traps for the unwary/newbie that are documented
in these groups made their way into Apple's code so that the traps
did not exist in the first place, WO would be a much better
development environment akin to type checking in languages.
I don't know if you can categorize these kinds of issues as "bugs",
so how does one get this message to Apple? Does anyone from Apple
actually read these groups?
Ian Joyner
Sportstec
_______________________________________________
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