Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-09-21 Thread Steinar Bang
> Steinar Bang :

> I now have some success: I created a DS component that listens for the
> OSGi services created by Aries spyfly, from the Twelvemonkeys SPI
> services, and registers the injected services with the imageio
> ServiceRegistry. 
[snip!]
> But since the spifly docs say: "Additionally services found in 
> META-INF/services are registered in the OSGi Service Registry."
> I decided to try a DS component that injects all Twelvemonkeys SPI
> services as OSGi services and use them to register the service in the
> imageio service registry:
>  
> https://github.com/steinarb/twelvemonkeys-karaf-demo/blob/master/src/main/java/no/priv/bang/demos/frontendkarafdemo/ImageioSpiRegistration.java#L12

I would very much like some feedback/comments on this approach.

E.g. is this a misuse of @Component, since it doesn't expose a service,
it never really goes active, but just exists to capture ImageIO SPI
services in the OSGi registry, and pass the services on to the ImageIO
ServiceRegistry?

Is there some SPIfly way that would have worked without creating a
component? (I couldn't find any from looking at the Spifly source code)

And should the @Component have some different annotations or annotation
parameters than the ones I've used?

And what about unregistrations and SPI lifecycle managment? Can an
osgi.serviceloader capability be unloaded? And does that unloading mean
that it should be unregistered from the ImageIO ServiceRegistry?

Thanks!


- Steinar



[ANN] Apache Karaf OSGi runtime 4.3.10 has been released!

2023-09-21 Thread Jean-Baptiste Onofré
The Karaf team is pleased to announce Apache Karaf OSGi runtime 4.3.10 release.

This is a maintenance release, bringing fixes, new features and
dependency updates:
- fix race condition between the FeaturesService and FeatureDeploymentListener
- fix --patch-module on Instance startup
- add exec:groovy shell command
- dependency updates including CVE fixes (Johnzon, BouncyCastle,
Commons FileUpload, ...)
- and much more!

You can take a look on the Release Notes for details:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311140=12352694

You can download this release here: https://karaf.apache.org/download.html

Enjoy!
The Apache Karaf team


Re: Karaf 4.4.4: resolver problem with multiple versions of bouncycastle / jackson

2023-09-21 Thread Jean-Baptiste Onofré
Hi,

I think you have two options:
- you can blacklist from the features.
- you can override the features

Generally speaking, it would be great that third parties features
leverage the Karaf spec features to avoid such kind of issue.

I will do a pass (it's weird that our unit tests passed without problem).

Regards
JB

On Wed, Sep 20, 2023 at 7:45 PM Jochen Walz
 wrote:
>
> Hello,
>
> with Karaf 4.4.4, the bouncycastle version has changed to 1.75. CXF
> still uses 1.70, i.e. when installing the CXF 3.6.2 feature, two
> versions of bcprov are installed. With a debug level log appender
> defined for org.apache.felix.resolver or setting the log level of the
> root logger to DEBUG,  this leads to multiple log entries like
>
>
> 2023-09-20T12:46:12,788 | DEBUG | features-3-thread-1 |
> ResolverImpl | 17 - org.apache.karaf.features.core -
> 4.4.4 | Candidate permutation failed due to a conflict between imports;
> will try another if possible. (Uses constraint violation. Unable to
> resolve resource io.netty.handler [io.netty.handler/4.1.97.Final]
> because it is exposed to package 'org.bouncycastle.asn1.pkcs' from
> resources bcprov [bcprov/1.70.0] and bcprov [bcprov/1.75.0] via two
> dependency chains.
>
> Chain 1:
>io.netty.handler [io.netty.handler/4.1.97.Final]
>  import:
> (&(osgi.wiring.package=org.bouncycastle.asn1.pkcs)(version>=1.69.0)(!(version>=2.0.0)))
>   |
>  export: osgi.wiring.package: org.bouncycastle.asn1.pkcs
>bcprov [bcprov/1.70.0]
>
> Chain 2:
>io.netty.handler [io.netty.handler/4.1.97.Final]
>  import:
> (&(osgi.wiring.package=org.bouncycastle.cert)(version>=1.69.0)(!(version>=2.0.0)))
>   |
>  export: osgi.wiring.package=org.bouncycastle.cert;
> uses:=org.bouncycastle.asn1.x509
>bcpkix [bcpkix/1.75.0]
>  import:
> (&(osgi.wiring.package=org.bouncycastle.asn1.x509)(version>=1.72.0))
>   |
>  export: osgi.wiring.package: org.bouncycastle.asn1.x509;
> uses:=org.bouncycastle.asn1.pkcs
>  export: osgi.wiring.package=org.bouncycastle.asn1.pkcs
>bcprov [bcprov/1.75.0]) ...
>
>
> and
>
>
> 2023-09-20T12:46:13,779 | DEBUG | features-3-thread-1 |
> ResolverImpl | 17 - org.apache.karaf.features.core -
> 4.4.4 | Candidate permutation failed due to a conflict between imports;
> will try another if possible. (Uses constraint violation. Unable to
> resolve resource com.fasterxml.jackson.core.jackson-databind
> [com.fasterxml.jackson.core.jackson-databind/2.14.1] because it is
> exposed to package 'com.fasterxml.jackson.core.base' from resources
> com.fasterxml.jackson.core.jackson-core
> [com.fasterxml.jackson.core.jackson-core/2.14.1] and
> com.fasterxml.jackson.core.jackson-core
> [com.fasterxml.jackson.core.jackson-core/2.15.2] via two dependency chains.
>
> Chain 1:
>com.fasterxml.jackson.core.jackson-databind
> [com.fasterxml.jackson.core.jackson-databind/2.14.1]
>  import:
> (&(osgi.wiring.package=com.fasterxml.jackson.core.base)(version>=2.14.0)(!(version>=3.0.0)))
>   |
>  export: osgi.wiring.package: com.fasterxml.jackson.core.base
>com.fasterxml.jackson.core.jackson-core
> [com.fasterxml.jackson.core.jackson-core/2.14.1]
>
> Chain 2:
>com.fasterxml.jackson.core.jackson-databind
> [com.fasterxml.jackson.core.jackson-databind/2.14.1]
>  import:
> (&(osgi.wiring.package=com.fasterxml.jackson.core)(version>=2.14.0)(!(version>=3.0.0)))
>   |
>  export: osgi.wiring.package=com.fasterxml.jackson.core;
> uses:=com.fasterxml.jackson.core.json
>com.fasterxml.jackson.core.jackson-core
> [com.fasterxml.jackson.core.jackson-core/2.15.2]
>  import:
> (&(osgi.wiring.package=com.fasterxml.jackson.core.json)(version>=2.15.0)(!(version>=3.0.0)))
>   |
>  export: osgi.wiring.package=com.fasterxml.jackson.core.json;
> uses:=com.fasterxml.jackson.core.base
>com.fasterxml.jackson.core.jackson-core
> [com.fasterxml.jackson.core.jackson-core/2.15.2]
>  import:
> (&(osgi.wiring.package=com.fasterxml.jackson.core.base)(version>=2.15.0)(!(version>=3.0.0)))
>   |
>  export: osgi.wiring.package: com.fasterxml.jackson.core.base
>com.fasterxml.jackson.core.jackson-core
> [com.fasterxml.jackson.core.jackson-core/2.15.2]) ...
>
>
> It may take very long until the resolver finishes. In some cases, it
> obviously fails at this point, and later I receive some FileNotFound
> exceptions because some packages are not exported - I have observed
> this, e.g., for the Datastax Cassandra driver, version 4.17, when
> jackson-databind 2.14.1 and 2.15.2 are both installed. The behavior is
> not always reproducible. E.g., for a feature with a bundle importing
> some bouncycastle packages, installation of the feature takes very long
> and/or finally fails, while installing and starting the bundles one by
> one succeeds.
>
> I don't think this is specifically related to 4.4.4 - only showed up in
> my case due to the upgraded dependencies while other features are still
> 

Re: Custom distribution with Maven assembly has no license

2023-09-21 Thread Andre Schlegel-Tylla
For the record.

We currently manage this in our pom by using the download-maven-plugin:

...


com.googlecode.maven-download-plugin
download-maven-plugin
${download-maven-plugin.version}


load-notice
compile

wget



https://raw.githubusercontent.com/apache/karaf/karaf-${karaf.version}/NOTICE

${project.build.directory}/assembly



load-license
compile

wget



https://raw.githubusercontent.com/apache/karaf/karaf-${karaf.version}/LICENSE

${project.build.directory}/assembly





...

regards
Andre

Am Mo., 27. Feb. 2023 um 10:27 Uhr schrieb Andre Schlegel-Tylla <
andre.schle...@virtimo.de>:

> Hi JB,
>
> can you show me the example? I want to include the original LICENSE/NOTICE
> files from the Karaf project without the need to maintain copies in my
> project.
>
> Regards
> Andre
>
> Am Fr., 24. Feb. 2023 um 14:33 Uhr schrieb Jean-Baptiste Onofré <
> j...@nanthrax.net>:
>
>> Hi Andre,
>>
>> Karaf distribution itself is created this way, including LICENSE/NOTICE
>> files.
>> You can add LICENSE in the resources, it should be part of the
>> distribution.
>>
>> Regards
>> JB
>>
>> On Fri, Feb 24, 2023 at 10:02 AM Andre Schlegel-Tylla
>>  wrote:
>> >
>> > Hello,
>> >
>> > We create a custom Karaf distribution with Maven assembly (
>> https://karaf.apache.org/manual/latest/#_custom_distributions). But in
>> the resulting archives the Apache license file is not included. Is this
>> intended? I think the license have to be included to match the Apache
>> license requirements. Or am I missing something?
>> >
>> > Regards
>> > Andre
>> >
>>
>