Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StorageDisk Exception #117

Open
qing3gan opened this issue Nov 10, 2015 · 1 comment
Open

StorageDisk Exception #117

qing3gan opened this issue Nov 10, 2015 · 1 comment

Comments

@qing3gan
Copy link

I have a problem with StorageDisk.When i run the app in the first time, it will create files that is tomp2p and tomp2p.p on local filesystem, everything is ok, but when i run the app again, it reported a exception like below:

Caused by: java.lang.RuntimeException: Could not instantiate class
            at org.mapdb.SerializerPojo.deserializeUnknownHeader(SerializerPojo.java:483)
            at org.mapdb.SerializerBase.deserialize3(SerializerBase.java:1216)
            at org.mapdb.SerializerBase.deserialize(SerializerBase.java:1132)
            at org.mapdb.SerializerBase.deserialize(SerializerBase.java:867)
            at org.mapdb.SerializerPojo.deserialize(SerializerPojo.java:701)
            at org.mapdb.BTreeMap$NodeSerializer.deserialize(BTreeMap.java:449)
            at org.mapdb.BTreeMap$NodeSerializer.deserialize(BTreeMap.java:288)
            at org.mapdb.Store.deserialize(Store.java:297)
            at org.mapdb.StoreDirect.get2(StoreDirect.java:475)
            at org.mapdb.StoreDirect.get(StoreDirect.java:428)
            at org.mapdb.Caches$HashTable.get(Caches.java:245)
            at org.mapdb.EngineWrapper.get(EngineWrapper.java:58)
            at org.mapdb.BTreeMap.<init>(BTreeMap.java:541)
            at org.mapdb.BTreeMap.preinitCatalog(BTreeMap.java:178)
            at org.mapdb.DB.reinit(DB.java:88)
            at org.mapdb.DB.<init>(DB.java:83)
            at org.mapdb.DBMaker.make(DBMaker.java:668)
            at net.tomp2p.storage.StorageDisk.<init>(StorageDisk.java:85)
            at org.hive2hive.mobile.test.MapDBTestActivity.onCreate(MapDBTestActivity.java:39)

I just wanna do some work of restoring data, then i test the StorageDisk class(it almost a single opration of newing StorageDisk(...)),it's ok on pc but seems not work on android.

this is the source code:(it's very simple)

File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
path.mkdir();
SignatureFactory signatureFactory = new RSASignatureFactory();
storageDisk = new StorageDisk(Number160.createHash("test1"), path, signatureFactory);
@ChronosXYZ
Copy link

I fully replaced old StorageDisk (on top of MapDB) by StorageBerkeleyDB (on top of BerkeleyDB), which works on Android and PC well. You can see my impl in https://github.com/ChronosX88/Influence-android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants