Results 1 to 1 of 1
- 11-30-2009, 05:25 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 3
- Rep Power
- 0
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:
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:Java 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 ... ... ... }
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).Java Code:case IteratorType.INORDER: new InOrder<E>( callBack, arr ).traverse(root);
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
Similar Threads
-
Client to Server, ClassNotFound Package Problem
By pwnzer in forum New To JavaReplies: 3Last Post: 11-07-2009, 09:17 PM -
Exception class
By mmarkym in forum New To JavaReplies: 2Last Post: 11-06-2009, 01:58 AM -
exception class
By arulmozs in forum AWT / SwingReplies: 2Last Post: 10-29-2009, 02:18 PM -
ClassNotFound.com, as the name suggests, helps to avoid ClassNotFoundException in yo
By kalluriravi in forum Reviews / AdvertisingReplies: 0Last Post: 10-12-2009, 05:39 AM -
classnotfound
By mirror666 in forum New To JavaReplies: 1Last Post: 11-11-2008, 02:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks