Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: getting NonPersistableObjectException when try to persisit facebook object

you did not understand me correctly.
a vector is persistable by default, but all elements you add there have to be persistable as well.
wrapping the User class into a vector does not make it persistable.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: getting NonPersistableObjectException when try to persisit facebook object

[ Edited ]

I understand you correctly but the problem is if i make a bean class and using setter getter there and also implementing the persistable interface my code is not compiling any more and when i am not implementing persistable its compiling fine.

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: getting NonPersistableObjectException when try to persisit facebook object

You need to manually pull all the revlevant informatin fro myou data struct and store the =m individually as string or some other persistable format in a vector and persist that. You will not be able to persist any custom classes unless that class and every data element within it are persistable themselves.
Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: getting NonPersistableObjectException when try to persisit facebook object

@CMY then how will i get the facebook object from String object can you tell me ??
Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: getting NonPersistableObjectException when try to persisit facebook object

You'll have to recreate it or find another way to store the session data like maybe an sql database (if thats even possible).
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: getting NonPersistableObjectException when try to persist facebook object

Can I suggest that you do not need to make this object (User) persistable.  Instead store it in RuntimeStore.  Then it is available for your Application from run to run.  If your user restarts the Phone, then they will have to log in again, but this will not happen often.

Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: getting NonPersistableObjectException when try to persist facebook object

Hey peter thats a good idea rather than persist User object actually. But i got some other work around for that. I get the acess token when a user has logged in and then persisiting the access token , User id and username these all are persisitable so no problem for me to persist it. And i have seen that by Id we can get the User object so its working fine now. Smiley Happy so every time i can post on facebook wall by the help of that persisted access token Smiley Wink. Thanks for all your help Smiley Happy.