java.io.FileNotFoundException: No such file or directory: null
453155Nov 1 2007 — edited Apr 10 2008I'm attempting to open a database using Java 5 and Berkeley DB 4.6.21. We've been able to open the database on 2 of the 3 computers we've tried it on, but not on mine. I'm receiving this nested exception:
Caused by: java.io.FileNotFoundException: No such file or directory: null
at com.sleepycat.db.internal.db_javaJNI.Db_open(Native Method)
at com.sleepycat.db.internal.Db.open(Db.java:382)
at com.sleepycat.db.DatabaseConfig.openDatabase(DatabaseConfig.java:517)
at com.sleepycat.db.Environment.openDatabase(Environment.java:80)
at com.thomson.legal.search.berkeley.data.BerkeleyAccess.setUpVariables(BerkeleyAccess.java:70)
... 11 more
The obvious answer is that the file name or directory is wrong, but I swear they're right:
Directory of C:\Berkeley Data
11/01/2007 01:01 PM <DIR> .
11/01/2007 01:01 PM <DIR> ..
10/19/2007 10:00 AM 1,669,349,376 caseInfoDatabase
10/19/2007 10:00 AM 16,384 classDataInfo
10/18/2007 01:53 PM 24,576 __db.001
10/18/2007 01:53 PM 65,536 __db.002
10/18/2007 01:53 PM 270,336 __db.003
5 File(s) 1,669,726,208 bytes
2 Dir(s) 27,899,944,960 bytes free
It seems like this is a bug in Berkeley because the FileNotFoundException should have something other than "null." Here's the code that opens the database.
private void setUpVariables()
{
try {
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setInitializeCache(true);
environment = new Environment(new File("C:\\Berkeley Data"), envConfig);
dbConfig.setAllowCreate(true);
dbConfig.setType(DatabaseType.BTREE);
caseInfoDatabase = environment.openDatabase(null,
"C:\\Berkeley Data\\caseInfoDatabase", "database", dbConfig);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
} catch (DatabaseException e) {
throw new RuntimeException(e);
}
}
Any info would be appreciated. Thanks.