• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot initialize nil class description

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I'm working through a WebObjects course on my own and I've hit a roadblock. I'm trying to get one of the assigned exercises to work but I keep getting the error: "Cannot initialize nil class description". I have a solution as provided with the course and my code seems to match the solution code provided. The assignment solution compiles and runs with no problem.
Here's the exact error:
NSInternalInconsistencyException: initWithEditingContext:classDescription:globalID::
Order 0xa08f10 Cannot initialize with a nil class description.
at com.apple.yellow.eocontrol.EOGenericRecord.<init>
(EOGenericRecord.java:677)
***********************************************
Here's the beginning of my Session class:
import com.apple.yellow.foundation.*;
import com.apple.yellow.webobjects.*;
import com.apple.yellow.eocontrol.*;
public class Session extends WOSession {
protected Order customerOrder;
public Session() {
super();
customerOrder = new Order(null, null, null);
}...
******************************************************
Here's the beginning of my Order class:
import com.apple.yellow.foundation.*;
import com.apple.yellow.eocontrol.*;
import java.util.*;
import java.math.BigDecimal;
public class Order extends EOGenericRecord {
protected NSMutableArray orderItems;
protected Customer theCustomer;
public Order(EOEditingContext context, EOClassDescription classDesc, EOGlobalID gid) {
super(context, classDesc, gid);
orderItems = new NSMutableArray();
theCustomer = new Customer(null, null, null);
}...
************************************************
If I rewrite the code and use the no-arg constructor for these classes, the exercise seesm to work, but we've been explicitly told to use the three-arguement constructors which means they'll likely come into play later on. Any thoughts out there? Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic