views:

118

answers:

1

FIXED

The problem was fixed by simply telling netbeans to do a clean rebuild of my application. Thanks for your comments guys.


I've tried to create a generic Observable class that I can use in my program:

public class GeoGolfObserver<T> extends Observable
{
    public GeoGolfObserver()
    {
        super();
    }

    public void passObject(T object)
    {
        setChanged();
        notifyObservers(object);
    }
}

It is created using:

GeoGolfObserver<Cache> cacheObserver = new GeoGolfObserver<Cache>(); // [1]
cacheObserver.addObserver(this);
new CreateCache(cacheObserver).setVisible(true);

This is passed in to the constructor of the CreateCache class:

public CreateCache(GeoGolfObserver<Cache> cacheObserver) {
    initComponents();
    bindList();
    this.cacheObserver = cacheObserver;
}

However, the line marked [1] above throws an error:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Common/GeoGolfObserver

Why?

+3  A: 

One of your classes is not found in the classpath. Specifically, GeoGolfObserver, if I understand your error correctly.

Check that you have valid references to all of your classes, and respective JAR/class files for them in your classpath.

Yuval A
maybe he meant the Observable interface, which comes with javah
mkoryak
@mkoryak, how could I have missed that, thanks :)
Yuval A