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: 228
Registered: ‎10-01-2011
My Device: Passport

Missing Resource Exception

I have a very strange issue with MissingResourceException being thrown when my applicaition is started on the device but it runs on the simulator without issue.

 

To complicate things, when I load a new verison of the application onto the device the issue goes away until I restart the device, at which time throws the exception at startup (the app is autostarted).  Remote debugging it won't help becuase when I start remoe debugging the app will be sent to the device again and that resolves the issue once again until the device is restarted.

 

I have been though every resource reference and all are present in the resource files.

 

Is anyone aware of any way to determine exactly which resource the app is trying to load?  It appears to be a string resource, using logging I can narrow the issue down to a particular screen which is created at startup, but all the resources the screen refers to are present.

 

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

Re: Missing Resource Exception

are you using a library (with resources in it)?
----------------------------------------------------------
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
Developer
Posts: 228
Registered: ‎10-01-2011
My Device: Passport

Re: Missing Resource Exception

No libaries, just a about 60 key/values defined the resource editor.

 

 

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

Re: Missing Resource Exception

just asking because we had a similar issue, but related to a library.
check (using javaloader dir > dir.txt) if your module is installed only once, maybe an old version lingers somehow?
did you rename the resource package lately?

maybe you can narrow it down by surrounding all resources of this screen with a try/catch block. won't really help, but could present a workaround at least.
----------------------------------------------------------
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: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Missing Resource Exception

You say this only happens at device restart.  Perhaps this might help:

 

http://supportforums.blackberry.com/t5/Java-Development/Write-safe-initialization-code/ta-p/444795