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
Contributor
Posts: 28
Registered: ‎03-15-2011
My Device: 9700
My Carrier: Vodafone
Accepted Solution

"Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

Hi,

 

I'm trying to send Email from FolderListener , it is giving Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800 , while running fine on Device PlatformVersion: 6.6.0.124 Device OS: 6.0.0.448 DeviceModel: 9700 & Device PlatformVersion: 5.1.0.146 Device OS: 5.0.0.714 DeviceModel: 9700.

 

How can I overcome this issue?

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

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

welcome to the support forums.

the folder listener most likely runs in the context of a RIM application.
use a global event to signal your own application to send an email.
----------------------------------------------------------
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
Contributor
Posts: 28
Registered: ‎03-15-2011
My Device: 9700
My Carrier: Vodafone

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

Thanks for reply simon, I have tried it with Global Event too,still its giving same Exception.

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

What Simon means is that you trigger a Global Event in the listener, listen for this Event in your application, and run the email generating code in your application. 

 

Prior to doing this, you might like to just test that your application can send an email. 

 

From what I know, RIM have been working to tighten up they listener code because a listener runs in the Application that it is listening too, which is possibly not wise.  So perhaps you have hit something related to this, which running in your own Application will overcome. 

 

Alternatively you may have just hit a bug. 

 

Regardless, using a GlobalEvent is better than trying to do this in the folder listener. 

Contributor
Posts: 28
Registered: ‎03-15-2011
My Device: 9700
My Carrier: Vodafone

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

I have tried exactly what you are saying.I have registered GlobalEventListener in my application and triggered Event from FolderListener still its giving "Unauthorized attempt to attach to this application".

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

And can your application send an email without the Event Trigger?

Contributor
Posts: 28
Registered: ‎03-15-2011
My Device: 9700
My Carrier: Vodafone

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

yes peter, my application is sending mail from other places which are not triggred by FolderListener.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

OK, I honestly can't see why you should not be able to send from your GlobalEventListener.  Looks like a bug.

 

Can I suggest you create a simple Application that does just enough to demonstrate the problem(i.e. adds the Listener, generates a globalEvent, processes the global Event in your own application, but also allows the user to send an email)  and replicate the problem with that.  Then you can use Incident Tracker to report the problem.  In the mean time you could also post the code here, I suspect others have similar processing and will be happy to see if they have the same problem and so support your incident. 

Contributor
Posts: 28
Registered: ‎03-15-2011
My Device: 9700
My Carrier: Vodafone

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

Its  creating problem only  on OS: 6.0.0.526  even working fine on Other 4.6 to 6.0 versions I have with or without GlobalEvent.

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: "Unauthorized attempt to attach to this application" Exception on Device PlatformVersion: 6.6.0.195 Device OS: 6.0.0.526 DeviceModel: 9800

Potentially a bug in that release only.  What do you think?