Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Access Restrictions - How to get rid of them?
Access Restrictions - How to get rid of them? [message #46681] Thu, 12 February 2009 14:11 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
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 #46729 is a reply to message #46681] Thu, 12 February 2009 16:16 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
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 #46748 is a reply to message #46729] Thu, 12 February 2009 22:38 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
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 #46827 is a reply to message #46748] Fri, 13 February 2009 15:27 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
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 16:16 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
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 22:38 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
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 15:27 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
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
Previous Topic:Open an read XML file trough popup-menu
Next Topic:Settings folder
Goto Forum:
  


Current Time: Mon Aug 02 18:42:47 GMT 2021

Powered by FUDForum. Page generated in 0.02223 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top