File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Cannot initialize nil class description Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot initialize nil class description" Watch "Cannot initialize nil class description" New topic

Cannot initialize nil class description

David Lang

Joined: Dec 10, 2000
Posts: 2
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.
Here's the beginning of my Session class:
public class Session extends WOSession {
protected Order customerOrder;
public Session() {
customerOrder = new Order(null, null, null);
Here's the beginning of my Order class:
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.
I agree. Here's the link:
subject: Cannot initialize nil class description
It's not a secret anymore!