Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Eclipse - java.lang.NoClassDefFoundError: com/sleepycat/je/DatabaseException



Hello guys,

I am having a problem testing an small Java code to be used with Berkeley DB Java Edition. I have created a Java Project, then I've created a package and inside of this package I've created a class with the following code:

package com.x2iq.iqSearchDB;

import com.sleepycat.je.DatabaseException; 
import com.sleepycat.je.Environment; 
import com.sleepycat.je.EnvironmentConfig; 
import java.io.File;

public class SentencesDB {

private Environment myDbEnvironment;
private String db_Base;
private String sentence;
private String root;
private int times;
private int total_level;
private int min_level;
private int max_level;
private int last_level;
private int bottom_node;


public SentencesDB() {


myDbEnvironment = null;
db_Base = "/usr/local/";
}

public void openDB() {
try
    EnvironmentConfig envConfig = new EnvironmentConfig(); 
    envConfig.setAllowCreate(true); 
    myDbEnvironment = new Environment(new File("/usr/local/iq_data"), envConfig);
} catch (DatabaseException dbe) { 
    // Exception handling goes here 
}
}


public void closeDB() {
try
    if (myDbEnvironment != null) { 
        myDbEnvironment.close(); 
    } 
} catch (DatabaseException dbe) { 
    // Exception handling goes here 
}
}

}


Then I try to test it in the scrapbook with the following code:


SentencesDB db = new SentencesDB();
db

And I get this error:

java.lang.NoClassDefFoundError: com/sleepycat/je/DatabaseException
at CodeSnippet_3.run(CodeSnippet_3.java:4)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain1.eval(ScrapbookMain1.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.evalLoop(ScrapbookMain.java:54)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.main(ScrapbookMain.java:35)

I do not understand why. The BerkeleyDB jar files are placed already in /System/Library/Java/Extensions and the class compiles correctly. Any idea on why it is not running? What am I forgetting?

Thanks in advance for your help,

GA

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.