File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot initialize nil class description" Watch "Cannot initialize nil class description" New topic
Author

Cannot initialize nil class description

David Lang
Greenhorn

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.
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot initialize nil class description