• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot initialize nil class description

 
David Lang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic