InstantiationException

16 views
Skip to first unread message

benjamin...@gmail.com

unread,
Mar 15, 2015, 12:46:49 PM3/15/15
to codenameone...@googlegroups.com
Hello,

I'm having an InstantiationException when i try to do a if to test if the storage instance is empty

 if(Storage.getInstance().readObject("bieres") != null)
 
This return me an InstantiationException  "java.lang.InstantiationException: com.mycompany.myapp.Biere"

I really don't understand I just try to test the Storage here I dont want to Instantiate anything.

Please help

Thanks

Shai Almog

unread,
Mar 16, 2015, 12:44:45 AM3/16/15
to codenameone...@googlegroups.com, benjamin...@gmail.com
Hi,
the class Biere is either:
1. Not public.
2. Doesn't have a default (no args) public constructor.
3. Throws an exception either in its static initializer or in its constructor.

benjamin...@gmail.com

unread,
Mar 16, 2015, 12:47:41 PM3/16/15
to codenameone...@googlegroups.com, benjamin...@gmail.com
Hello, thank you I was actually in the second case ! Now it works !
Reply all
Reply to author
Forward
0 new messages