MuhammadUsman
MuhammadUsman

Reputation: 116

Encrypted Storage Exception

When I start my application, it is giving me below mentioned exception. I'm using encrypted storage class but don't know why this exception is there even i am not accessing any storage class at this time. Please guide.

[EDT] 0:0:0,32 - Exception: java.io.EOFException - null java.io.EOFException at java.io.DataInputStream.readFully(DataInputStream.java:197) at java.io.DataInputStream.readUTF(DataInputStream.java:609) at

java.io.DataInputStream.readUTF(DataInputStream.java:564) at

com.codename1.io.Util.readObject(Util.java:536) at com.codename1.io.Storage.readObject(Storage.java:261) at com.codename1.io.Preferences.get(Preferences.java:83) at com.codename1.io.Preferences.get(Preferences.java:298) at com.codename1.impl.CodenameOneImplementation.initEDT(CodenameOneImplementation.java:235) at com.codename1.ui.Display.mainEDTLoop(Display.java:951) at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120) at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Upvotes: 2

Views: 86

Answers (1)

Shai Almog
Shai Almog

Reputation: 52725

It looks like you have preferences from a previously unencrypted session that the system is trying to decrypt. To prevent such a collision in the future try using setPreferencesLocation after encrypting. This will abandon the old preferences and force encryption on the new data.

Upvotes: 1

Related Questions