Problem with Outer and Inner Classes....or better way?

Right now I'm trying to create an Inner class.

My .java file compiles ok, and I create my jar file too.

But when I try to instantiate the Inner class, it fails:

java.lang.NoClassDefFoundError: com/myco/vlXML/vlXML$vlDocument.

Here's the class code:

publicclass vlXML{

private ArrayList myDocList=new ArrayList();//holds documents

public vlXML(){

}

privateclass vlDocument{

public vlDocument(){

}

//stuff goes here

}

public vlDocument vlDOC(){

returnnew vlDocument();

}

publicvoid addDocument(){

vlXML xxx=new vlXML();

vlDocument myDoc=xxx.vlDOC();

myDocList.add(myDoc);

}

publicint getNumDocs(){

return myDocList.size();

}

}

Then, from a jsp page, I call:

vlXML junk1=new vlXML();

junk1.addDocument();

...and get the error...

Can someone help me figure out why it's failing?

Thanks....

[2007 byte] By [whoita] at [2007-10-3 10:57:14]
# 1
Because in your deployment step you included the .class file for the outer class but not the .class file for the inner class.
DrClapa at 2007-7-15 6:23:17 > top of Java-index,Java Essentials,Java Programming...
# 2

You nailed it - thanks....(duh!)

While I have your attention, if you don't mind, I have another question.

I'm creating a Class (outer) that allows my users to write a specific XML file (according to my own schema).

Within the XML file, they can have multiple instances of certain tags, like "Document". "Document"s can have multiple fields.

Since I don't know how many "Documents" they may want, I was planning on using an Inner Class of "Document", and then simply letting them "add" as many as necessary (thus the original code posted here).

Does that seem like an efficient (logical/reasonable) methodology,

or is there there something better?

Thanks Again...

whoita at 2007-7-15 6:23:17 > top of Java-index,Java Essentials,Java Programming...