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
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: CodeModuleManager and Class.forName()

Have you tried inserting a delay between your call to forName after the application has been installed?  You could have a race condition where your application is trying to access the COD file before it is ready.  After the COD file is written, the BlackBerry smartphone needs to perform some setup operations (configure Application Permissions, etc...).

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: CodeModuleManager and Class.forName()

So far, unless the auto-start, is included no matter the delay Class.forName doesn't work until a restart of the device.  

 

Upon restarting the device, Class.forName works without any issues.

 

If the module is started, Class.forName also starts working (but if the module uses another module (which was installed, but not started) it will throw " unauthorized attempt to attach to this application" error).

 

After reboot of the device, everything works.

Highlighted
Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: CodeModuleManager and Class.forName()

I worked around this issue by just auto-starting the module and waiting for a second or two.

 

To get around Unauthorized error I had to force a permission request from libMain method when it first auto-started.

 

The whole way this works is very weird....