ClassNotFound exception for inner class
I have been developing a binary search tree class using generics, and my class contains several Interfaces and inner classes, including a Tree node class, an interface for a callback (used by my iterators) an interface for a tree iterator, and several iterator classes that implement the tree iterator interface:
Code:
public abstract class BinaryTree<E> implements Tree<E> {
BinaryTreeNode<E> root;
TreeComparator compares;
int numberOfNodes;
int iType;
...
...
...
public interface TreeCallback<E> {
public void visit( BinaryTreeNode<E> node, Object[] arr );
}
interface TreeIterator<E> {
public void traverse( BinaryTreeNode<E> node );
}
public class InOrder<E> implements TreeIterator<E> {
TreeCallback<E> callBack;
Object[] objects;
public InOrder( TreeCallback<E> callBack, Object[] arr ) {
this.callBack = callBack;
objects = arr;
}
public void traverse( BinaryTreeNode<E> node ) {
if( node != null ) {
traverse( node.leftChild );
callBack.visit(node, null);
traverse( node.rightChild );
}
}
}
...
...
...
public void doTraversal( TreeCallback<E> callBack, Object[] arr) {
switch( iType )
{
case IteratorType.INORDER:
new InOrder<E>( callBack, arr ).traverse(root);
case ...
...
...
}
this code compiles fine and gives me no error (I am using eclipse Gallileo). However, when I run this program, at the point the InOrder class (TreeIterator) consturctor is first called:
Code:
case IteratorType.INORDER:
new InOrder<E>( callBack, arr ).traverse(root);
A ClassNotFoundException (arg0: myCollections/BinaryTree$InOrder) is thrown. The class file does in fact exist and is located inside the same bin folder as the enclosing class (which is instantiated without problem).
I am new to Java generics, but from what I've read, I thought that this problem might be related to the class parameters in some way - but I have rewritten the class as a non parameterized class and got the same error.
again, my class is on the same classpath as all of my other classes in the project, so it is clearly not a classpath issue. Somebody please help, I am at my wits end