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
gayatri
Posts: 86
Registered: ‎12-06-2012
My Device: Curve 8520
My Carrier: Blackberry store

Application throws "multiply defined" error at start-up

Hi,

 

I am getting "Application throws "multiply defined" error at start-up" Exception .

 Library which i am using in application has one persistable class. how can i prevent this exception?

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Application throws "multiply defined" error at start-up

you cannot use a class that implements persistable in more than one application.
either use it only in the library and expose its content via interface or use standard persistent classes (like vector).
----------------------------------------------------------
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
Please use plain text.
Developer
gayatri
Posts: 86
Registered: ‎12-06-2012
My Device: Curve 8520
My Carrier: Blackberry store

Re: Application throws "multiply defined" error at start-up

[ Edited ]

i am using hashtable for store some  data throughout the application.and when application exit it should delete.

for doing that i used persistable . 

any other way to store data and delete it ?

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Application throws "multiply defined" error at start-up

the hashtable is fine. but if you have a custom persistable class you can use it only in one app/package.

you could put strings in a hashtable and read them in different apps, that's what i meant with standard persistable classes.
----------------------------------------------------------
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
Please use plain text.
Developer
gayatri
Posts: 86
Registered: ‎12-06-2012
My Device: Curve 8520
My Carrier: Blackberry store

Re: Application throws "multiply defined" error at start-up

but i need to delete this hashdata when exit from application .

is there any other way to use hashtable without persistable, and able to delete hashtable  when application exit .

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Application throws "multiply defined" error at start-up

as i said, you can use it in the library only (and have a single instance of the lib on the device).
----------------------------------------------------------
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
Please use plain text.