| Access Restrictions - How to get rid of them? [message #46681] | 
Thu, 12 February 2009 09:11   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
Using Ganymede 3.4, I have several plugins, one (A) of them generates  
Access Restriction on classes from another plugin (B). A has a depency to B. 
 
I am looking for a structured way to synchronize the PDE environment  
accross all my plugins. 
 
What I understand Access Restrictions come from mismatches in JRE's or  
explicitly set restrictions. From what I can see in my manifest files in  
each plugin I don't have discrepancies in JRE's or explicit restrictions  
set. 
 
 
So in other words, What's the list of items I need to check, when  
encountering Access Restrictions? 
 
Thanks! Christophe
 |  
 |  
  | 
 | 
 | 
| Re: Access Restrictions - How to get rid of them? [message #46827 is a reply to message #46748] | 
Fri, 13 February 2009 10:27   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Are you seeing the warnings in the workspace of in a headless build? 
 
Maybe you are using classes in packages that you don't have a  
Require-Bundle or Import-Package for?  This could happen by using  
something from a transitive dependency that you haven't explicitly declared. 
 
In the workspace this would normally result in a Forbidden Access error  
(but that can be changed to warning or turned off).  In a headless build  
there isn't the same flexibility with warnings/errors and the forbidden  
access can only be reported as a warning (since it is an osgi thing and  
not java. 
 
Forbidden errors/warnings are Bad because you probably won't be able to  
load those classes at runtime because of how the class loaders are wired  
together.  (Discouraged warnings mean you can load the classes unless  
osgi was running in strict mode). 
 
-Andrew 
Christophe Bouhier wrote: 
>  
>  
> Andrew Niefer wrote: 
>> Check the bundle that exports the package that contains the class you  
>> are referring to. 
>> If the bundle exports the package with x-internal:=true then you get  
> Thank you for responding. What you write is also what i gathered from  
> the documentation.The x-internal is not set by default, and it's not in  
> my Manifest.MF, still I get the Access Restrictions which is weird? 
>  
>> Access warnings for using things in that package.  If it specifies  
>> x-friends, only the listed friends are allowed to use it. 
>> 
>> To get rid of the warning, the x-internal must be removed (making the  
>> package API), or your bundle needs to be added as a friend. 
>> 
>> -Andrew
 |  
 |  
  | 
| Re: Access Restrictions - How to get rid of them? [message #591920 is a reply to message #46681] | 
Thu, 12 February 2009 11:16   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Check the bundle that exports the package that contains the class you  
are referring to. 
If the bundle exports the package with x-internal:=true then you get  
Access warnings for using things in that package.  If it specifies  
x-friends, only the listed friends are allowed to use it. 
 
To get rid of the warning, the x-internal must be removed (making the  
package API), or your bundle needs to be added as a friend. 
 
-Andrew 
 
Christophe Bouhier wrote: 
> Hi, 
>  
> Using Ganymede 3.4, I have several plugins, one (A) of them generates  
> Access Restriction on classes from another plugin (B). A has a depency  
> to B. 
>  
> I am looking for a structured way to synchronize the PDE environment  
> accross all my plugins. 
>  
> What I understand Access Restrictions come from mismatches in JRE's or  
> explicitly set restrictions. From what I can see in my manifest files in  
> each plugin I don't have discrepancies in JRE's or explicit restrictions  
> set. 
>  
>  
> So in other words, What's the list of items I need to check, when  
> encountering Access Restrictions? 
>  
> Thanks! Christophe
 |  
 |  
  | 
| Re: Access Restrictions - How to get rid of them? [message #591923 is a reply to message #46729] | 
Thu, 12 February 2009 17:38   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Andrew Niefer wrote: 
> Check the bundle that exports the package that contains the class you  
> are referring to. 
> If the bundle exports the package with x-internal:=true then you get  
Thank you for responding. What you write is also what i gathered from  
the documentation.The x-internal is not set by default, and it's not in  
my Manifest.MF, still I get the Access Restrictions which is weird? 
 
> Access warnings for using things in that package.  If it specifies  
> x-friends, only the listed friends are allowed to use it. 
>  
> To get rid of the warning, the x-internal must be removed (making the  
> package API), or your bundle needs to be added as a friend. 
>  
> -Andrew
 |  
 |  
  | 
| Re: Access Restrictions - How to get rid of them? [message #591946 is a reply to message #46748] | 
Fri, 13 February 2009 10:27   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Are you seeing the warnings in the workspace of in a headless build? 
 
Maybe you are using classes in packages that you don't have a  
Require-Bundle or Import-Package for?  This could happen by using  
something from a transitive dependency that you haven't explicitly declared. 
 
In the workspace this would normally result in a Forbidden Access error  
(but that can be changed to warning or turned off).  In a headless build  
there isn't the same flexibility with warnings/errors and the forbidden  
access can only be reported as a warning (since it is an osgi thing and  
not java. 
 
Forbidden errors/warnings are Bad because you probably won't be able to  
load those classes at runtime because of how the class loaders are wired  
together.  (Discouraged warnings mean you can load the classes unless  
osgi was running in strict mode). 
 
-Andrew 
Christophe Bouhier wrote: 
>  
>  
> Andrew Niefer wrote: 
>> Check the bundle that exports the package that contains the class you  
>> are referring to. 
>> If the bundle exports the package with x-internal:=true then you get  
> Thank you for responding. What you write is also what i gathered from  
> the documentation.The x-internal is not set by default, and it's not in  
> my Manifest.MF, still I get the Access Restrictions which is weird? 
>  
>> Access warnings for using things in that package.  If it specifies  
>> x-friends, only the listed friends are allowed to use it. 
>> 
>> To get rid of the warning, the x-internal must be removed (making the  
>> package API), or your bundle needs to be added as a friend. 
>> 
>> -Andrew
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.04853 seconds