You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Per-Erik Svensson <pe...@gmail.com> on 2013/09/11 19:53:27 UTC

Filtering the default provided system packages

Hi,

I'm trying to start a minimal set-up to run Jersey (JAX-RS) and Jetty in
Apache Felix. When doing this, I get a uses constraint violation on
javax.annotation.

None of this is of course Felix concern, but...

I was wondering if there is a quick way to specify the
"org.osgi.framework.system.packages" (or any other) property to
*exclude* certain
packages. What I did was that I ran "inspect c osgi.wiring.package 0" and
copy/pasted the result (with some find-replace to format it correctly and
removing javax.annotation) to the system.packages property. This works
fine. However, it isn't very "future proof". If either felix or java8 comes
with a new set of "default" packages, I have to change this property.

So, is there any way to remove only some of the default exported packages -
or is this an all-or-none affair?

Regards,
Per-Erik Svensson

Re: Filtering the default provided system packages

Posted by Christian Schneider <ch...@die-schneider.net>.
I created an issue and set fix version to 4.4.0. Please move it as you 
see fit.
https://issues.apache.org/jira/browse/FELIX-4227

Looking forward to have this feature :-)

Christian

On 12.09.2013 17:42, Richard S. Hall wrote:
> On 9/12/13 10:59 , Christian Schneider wrote:
>> That would be really helpful. Using CXF also requires to not export 
>> some system packages.
>> Currently we have to completely redefine the system packages. So it 
>> would be nice to be able to just specify which packages to add 
>> (already works) and which to remove.
>
> I don't think anyone opened an issue for this against the framework, 
> would you do so? Thanks.
>
>>
>> Of course it would be ideal to have a common solution with equinox 
>> for this.
>
> I talked with Tom Watson, we might be able to coordinate such a feature.
>
> -> richard

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Filtering the default provided system packages

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 9/12/13 10:59 , Christian Schneider wrote:
> That would be really helpful. Using CXF also requires to not export 
> some system packages.
> Currently we have to completely redefine the system packages. So it 
> would be nice to be able to just specify which packages to add 
> (already works) and which to remove.

I don't think anyone opened an issue for this against the framework, 
would you do so? Thanks.

>
> Of course it would be ideal to have a common solution with equinox for 
> this.

I talked with Tom Watson, we might be able to coordinate such a feature.

-> richard

>
> Christian
>
> On 11.09.2013 20:05, Per-Erik Svensson wrote:
>> Hi Felix,
>>
>> Yes I understand that you don't have a set of packages defined for 
>> Java 8
>> yet. I was more wondering about the possibility of "filtering" the 
>> default
>> packages provides by saying something like
>>
>> "org.osgi.framework.system.packages=defaults, !javax.annotation"
>>
>> This would help me since I'm only stating what I don't want the 
>> framework
>> to export, so that my config-file can be used on a future felix/java
>> installation too. As it is now, I state what I want to include, meaning
>> that my config can't be used properly in a new felix install (say 
>> with OSGi
>> 4.4 or Java 8) since.
>>
>> I assume the answer is no, but asking doesn't hurt. :)
>>
>> Regards,
>> Per-Erik Svensson
>>
>>
>> On Wed, Sep 11, 2013 at 7:57 PM, Felix Meschberger 
>> <fm...@adobe.com>wrote:
>>
>>> Hi
>>>
>>> In Felix these packages are defined on a per-Java version basis in 
>>> version
>>> specific properties. This way we can semi-dynamically define the actual
>>> packages depending on the actual Java version.
>>>
>>> Currently we have versions upto and including Java 7 extracted from the
>>> actual Java Platform. The Java 8 version is currently the same as 
>>> for Java
>>> 7 to at least support running on Java 8 -- but as the Java 8 API is not
>>> final yet, we cannot define these packages definitely yet.
>>>
>>> Hope this helps.
>>>
>>> Regards
>>> Felix
>>>
>>> Am 11.09.2013 um 19:53 schrieb Per-Erik Svensson:
>>>
>>>> Hi,
>>>>
>>>> I'm trying to start a minimal set-up to run Jersey (JAX-RS) and 
>>>> Jetty in
>>>> Apache Felix. When doing this, I get a uses constraint violation on
>>>> javax.annotation.
>>>>
>>>> None of this is of course Felix concern, but...
>>>>
>>>> I was wondering if there is a quick way to specify the
>>>> "org.osgi.framework.system.packages" (or any other) property to
>>>> *exclude* certain
>>>> packages. What I did was that I ran "inspect c osgi.wiring.package 
>>>> 0" and
>>>> copy/pasted the result (with some find-replace to format it 
>>>> correctly and
>>>> removing javax.annotation) to the system.packages property. This works
>>>> fine. However, it isn't very "future proof". If either felix or java8
>>> comes
>>>> with a new set of "default" packages, I have to change this property.
>>>>
>>>> So, is there any way to remove only some of the default exported
>>> packages -
>>>> or is this an all-or-none affair?
>>>>
>>>> Regards,
>>>> Per-Erik Svensson
>>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Filtering the default provided system packages

Posted by Christian Schneider <ch...@die-schneider.net>.
That would be really helpful. Using CXF also requires to not export some 
system packages.
Currently we have to completely redefine the system packages. So it 
would be nice to be able to just specify which packages to add (already 
works) and which to remove.

Of course it would be ideal to have a common solution with equinox for this.

Christian

On 11.09.2013 20:05, Per-Erik Svensson wrote:
> Hi Felix,
>
> Yes I understand that you don't have a set of packages defined for Java 8
> yet. I was more wondering about the possibility of "filtering" the default
> packages provides by saying something like
>
> "org.osgi.framework.system.packages=defaults, !javax.annotation"
>
> This would help me since I'm only stating what I don't want the framework
> to export, so that my config-file can be used on a future felix/java
> installation too. As it is now, I state what I want to include, meaning
> that my config can't be used properly in a new felix install (say with OSGi
> 4.4 or Java 8) since.
>
> I assume the answer is no, but asking doesn't hurt. :)
>
> Regards,
> Per-Erik Svensson
>
>
> On Wed, Sep 11, 2013 at 7:57 PM, Felix Meschberger <fm...@adobe.com>wrote:
>
>> Hi
>>
>> In Felix these packages are defined on a per-Java version basis in version
>> specific properties. This way we can semi-dynamically define the actual
>> packages depending on the actual Java version.
>>
>> Currently we have versions upto and including Java 7 extracted from the
>> actual Java Platform. The Java 8 version is currently the same as for Java
>> 7 to at least support running on Java 8 -- but as the Java 8 API is not
>> final yet, we cannot define these packages definitely yet.
>>
>> Hope this helps.
>>
>> Regards
>> Felix
>>
>> Am 11.09.2013 um 19:53 schrieb Per-Erik Svensson:
>>
>>> Hi,
>>>
>>> I'm trying to start a minimal set-up to run Jersey (JAX-RS) and Jetty in
>>> Apache Felix. When doing this, I get a uses constraint violation on
>>> javax.annotation.
>>>
>>> None of this is of course Felix concern, but...
>>>
>>> I was wondering if there is a quick way to specify the
>>> "org.osgi.framework.system.packages" (or any other) property to
>>> *exclude* certain
>>> packages. What I did was that I ran "inspect c osgi.wiring.package 0" and
>>> copy/pasted the result (with some find-replace to format it correctly and
>>> removing javax.annotation) to the system.packages property. This works
>>> fine. However, it isn't very "future proof". If either felix or java8
>> comes
>>> with a new set of "default" packages, I have to change this property.
>>>
>>> So, is there any way to remove only some of the default exported
>> packages -
>>> or is this an all-or-none affair?
>>>
>>> Regards,
>>> Per-Erik Svensson
>>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Filtering the default provided system packages

Posted by Per-Erik Svensson <pe...@gmail.com>.
Hi Felix,

Yes I understand that you don't have a set of packages defined for Java 8
yet. I was more wondering about the possibility of "filtering" the default
packages provides by saying something like

"org.osgi.framework.system.packages=defaults, !javax.annotation"

This would help me since I'm only stating what I don't want the framework
to export, so that my config-file can be used on a future felix/java
installation too. As it is now, I state what I want to include, meaning
that my config can't be used properly in a new felix install (say with OSGi
4.4 or Java 8) since.

I assume the answer is no, but asking doesn't hurt. :)

Regards,
Per-Erik Svensson


On Wed, Sep 11, 2013 at 7:57 PM, Felix Meschberger <fm...@adobe.com>wrote:

> Hi
>
> In Felix these packages are defined on a per-Java version basis in version
> specific properties. This way we can semi-dynamically define the actual
> packages depending on the actual Java version.
>
> Currently we have versions upto and including Java 7 extracted from the
> actual Java Platform. The Java 8 version is currently the same as for Java
> 7 to at least support running on Java 8 -- but as the Java 8 API is not
> final yet, we cannot define these packages definitely yet.
>
> Hope this helps.
>
> Regards
> Felix
>
> Am 11.09.2013 um 19:53 schrieb Per-Erik Svensson:
>
> > Hi,
> >
> > I'm trying to start a minimal set-up to run Jersey (JAX-RS) and Jetty in
> > Apache Felix. When doing this, I get a uses constraint violation on
> > javax.annotation.
> >
> > None of this is of course Felix concern, but...
> >
> > I was wondering if there is a quick way to specify the
> > "org.osgi.framework.system.packages" (or any other) property to
> > *exclude* certain
> > packages. What I did was that I ran "inspect c osgi.wiring.package 0" and
> > copy/pasted the result (with some find-replace to format it correctly and
> > removing javax.annotation) to the system.packages property. This works
> > fine. However, it isn't very "future proof". If either felix or java8
> comes
> > with a new set of "default" packages, I have to change this property.
> >
> > So, is there any way to remove only some of the default exported
> packages -
> > or is this an all-or-none affair?
> >
> > Regards,
> > Per-Erik Svensson
>
>

Re: Filtering the default provided system packages

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

In Felix these packages are defined on a per-Java version basis in version specific properties. This way we can semi-dynamically define the actual packages depending on the actual Java version.

Currently we have versions upto and including Java 7 extracted from the actual Java Platform. The Java 8 version is currently the same as for Java 7 to at least support running on Java 8 -- but as the Java 8 API is not final yet, we cannot define these packages definitely yet.

Hope this helps.

Regards
Felix

Am 11.09.2013 um 19:53 schrieb Per-Erik Svensson:

> Hi,
> 
> I'm trying to start a minimal set-up to run Jersey (JAX-RS) and Jetty in
> Apache Felix. When doing this, I get a uses constraint violation on
> javax.annotation.
> 
> None of this is of course Felix concern, but...
> 
> I was wondering if there is a quick way to specify the
> "org.osgi.framework.system.packages" (or any other) property to
> *exclude* certain
> packages. What I did was that I ran "inspect c osgi.wiring.package 0" and
> copy/pasted the result (with some find-replace to format it correctly and
> removing javax.annotation) to the system.packages property. This works
> fine. However, it isn't very "future proof". If either felix or java8 comes
> with a new set of "default" packages, I have to change this property.
> 
> So, is there any way to remove only some of the default exported packages -
> or is this an all-or-none affair?
> 
> Regards,
> Per-Erik Svensson


Re: Filtering the default provided system packages

Posted by Per-Erik Svensson <pe...@gmail.com>.
Hi Daniel,

Wow, I should really follow the posts on this list more closely. Sorry for
the essential duplicate of a question.

Thanks,
Per-Erik Svensson


On Wed, Sep 11, 2013 at 7:58 PM, Daniel McGreal <da...@redbite.com> wrote:

> Hi Per-Erik,
> A previous post, by my colleague, prompted this discussion:
> http://apache-felix.18485.x6.nabble.com/Specify-packages-that-should-not-be-exported-by-Felix-framework-td5004647.html#a5004657
> Aside from implementing a solution within Felix, the workaround we came up
> with was the specify a version of the package such that our bundles import
> our supplied one instead of the one provided by the framework. It's worked
> out OK so far.
> Good luck, Dan.
>
> On 11 Sep 2013, at 18:53, Per-Erik Svensson wrote:
>
> > Hi,
> >
> > I'm trying to start a minimal set-up to run Jersey (JAX-RS) and Jetty in
> > Apache Felix. When doing this, I get a uses constraint violation on
> > javax.annotation.
> >
> > None of this is of course Felix concern, but...
> >
> > I was wondering if there is a quick way to specify the
> > "org.osgi.framework.system.packages" (or any other) property to
> > *exclude* certain
> > packages. What I did was that I ran "inspect c osgi.wiring.package 0" and
> > copy/pasted the result (with some find-replace to format it correctly and
> > removing javax.annotation) to the system.packages property. This works
> > fine. However, it isn't very "future proof". If either felix or java8
> comes
> > with a new set of "default" packages, I have to change this property.
> >
> > So, is there any way to remove only some of the default exported
> packages -
> > or is this an all-or-none affair?
> >
> > Regards,
> > Per-Erik Svensson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Filtering the default provided system packages

Posted by Daniel McGreal <da...@redbite.com>.
Hi Per-Erik,
A previous post, by my colleague, prompted this discussion: http://apache-felix.18485.x6.nabble.com/Specify-packages-that-should-not-be-exported-by-Felix-framework-td5004647.html#a5004657
Aside from implementing a solution within Felix, the workaround we came up with was the specify a version of the package such that our bundles import our supplied one instead of the one provided by the framework. It's worked out OK so far.
Good luck, Dan.

On 11 Sep 2013, at 18:53, Per-Erik Svensson wrote:

> Hi,
> 
> I'm trying to start a minimal set-up to run Jersey (JAX-RS) and Jetty in
> Apache Felix. When doing this, I get a uses constraint violation on
> javax.annotation.
> 
> None of this is of course Felix concern, but...
> 
> I was wondering if there is a quick way to specify the
> "org.osgi.framework.system.packages" (or any other) property to
> *exclude* certain
> packages. What I did was that I ran "inspect c osgi.wiring.package 0" and
> copy/pasted the result (with some find-replace to format it correctly and
> removing javax.annotation) to the system.packages property. This works
> fine. However, it isn't very "future proof". If either felix or java8 comes
> with a new set of "default" packages, I have to change this property.
> 
> So, is there any way to remove only some of the default exported packages -
> or is this an all-or-none affair?
> 
> Regards,
> Per-Erik Svensson


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org