Mike,

About #6, I think what you might be referring to is that in the Karaf
distribution, there is a repos cfg in the etc directory.  This lists a
bunch of preinstalled repos, but they use latest as the version.  You can
set that to a specific version when building a custom distribution so it
doesn't possibly pull the latest one, otherwise specifying the one you want
should do the trick.  I don't have any problems when I build a Karaf custom
distro and I include the features as dependencies for the versions I want
in the POM.

Around the Karaf being buggy part, I think it's actually quite stable.  The
dynamic nature of what Karaf is doing can cause some hiccups due to release
cycles that differ for other projects like Camel and CXF.

You'll probably have a few hiccups around dependencies due to the
flexibility of versions Karaf allows and has to resolve when using versions
hot off the press.  I would stick with a version that works.  For CXF, I am
using 3.2.7 which works fine (on Karaf 4.2.5)  You can always try upgrading
CXF at another time.  It sounds like JB is saying that 4.2.6 would be
better to use with CXF 3.3.x anyhow.

I'll deal with some versioning headaches in exchange for the features Karaf
provides me.

Hopefully the above was somewhat helpful.

Ryan

On Sat, May 18, 2019, 4:19 AM Mike <[email protected]> wrote:

> Hi JB,
>
> thanks for your detailed answer. I will try to create a static docker
> installation soon. I was searching for a documentation a half year ago.
> Looks like I should try it once more. The requirement is that I will have a
> lot of SNAPSHOT bundles to install I'm using docker currently for local
> development and rapid deployment (bundle:watch). Thanks for docker I can
> switch between different projects very fast. In production I have to
> rollout the development on a non-docker environment (yet ....) but release
> versions.
>
> Looking around with features now I found some strange behaviour in karaf
> and want to check If I'm right ...
>
> 1) Can't remove repo
>
> karaf@root()> feature:repo-list
> Repository                        │ URL
>
> ──────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────
> [...]
>
> *cxf-3.3.1                         │
> mvn:org.apache.cxf.karaf/apache-cxf/3.3.1/xml/features*[...]
> karaf@root()> feature:repo-list
> Repository                        │ URL
>
> ──────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────
> [...]
>
> *cxf-3.3.1                         │
> mvn:org.apache.cxf.karaf/apache-cxf/3.3.1/xml/features*[...]
>
> Is this a bug or a feature?
>
>
>
> 2) Found out that cxf 3.3.1 install both jetty 9.4.12.v20180830
> and 9.4.18.v20190429 bundles ... the bundles will not work together and the
> http system is not working (depends on the start order, I have a 50/50
> change to bring http to work)
>
> karaf@root()> feature:install cxf/3.3.1
> [...]
> 07:15:39.420 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-client/9.4.12.v20180830
> 07:15:39.421 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-client/9.4.18.v20190429
> 07:15:39.421 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-continuation/9.4.12.v20180830
> 07:15:39.421 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-continuation/9.4.18.v20190429
> 07:15:39.422 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-deploy/9.4.12.v20180830
> 07:15:39.422 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-deploy/9.4.18.v20190429
> 07:15:39.422 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-http/9.4.12.v20180830
> 07:15:39.423 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-http/9.4.12.v20180830
> 07:15:39.423 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-http/9.4.18.v20190429
> 07:15:39.424 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-io/9.4.12.v20180830
> 07:15:39.424 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-io/9.4.18.v20190429
> 07:15:39.424 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-jaas/9.4.12.v20180830
> 07:15:39.425 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-jaas/9.4.18.v20190429
> [...]
>
>
>
> 3) for cxf 3.3.0 It's the same ...
>
> Looks like I was lucky yesterday and had the correct start order. In 3.3.0
> I found the same problem. And I found it will install 3.3.1 features also
> (maybe that's the problem)
>
> karaf@root()> feature:install cxf/3.3.0
> [...]
> 07:19:56.981 INFO  [features-3-thread-1]
>   mvn:org.apache.cxf/cxf-rt-management/3.3.0
> 07:19:56.981 INFO  [features-3-thread-1]
>   mvn:org.apache.cxf/cxf-rt-management/3.3.1
> [...]
> 07:19:56.985 INFO  [features-3-thread-1]
>   mvn:org.apache.cxf/cxf-rt-transports-http/3.3.1
> 07:19:56.985 INFO  [features-3-thread-1]
>   mvn:org.apache.cxf/cxf-rt-transports-http-jetty/3.3.1
> [...]
> 07:19:57.018 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-client/9.4.12.v20180830
> 07:19:57.019 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-client/9.4.18.v20190429
> 07:19:57.021 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-continuation/9.4.12.v20180830
> 07:19:57.026 INFO  [features-3-thread-1]
>   mvn:org.eclipse.jetty/jetty-continuation/9.4.18.v20190429
> [...]
>
>
>
> 4) hmm - even after blacklisting cxf/3.3.1 two jetty versions will be
> installed also ...
>
> I'm sure this was not happen before end fo April (v20190429)
>
> I also found this to blacklist features
>
>
> https://github.com/apache/karaf/blob/master/features/core/src/test/resources/org/apache/karaf/features/internal/service/org.apache.karaf.features.xml
>
> karaf@root()> feature:list | grep jetty
> jetty                                    │ 9.4.12.v20180830 │          │
> Uninstalled │ standard-4.2.3                    │
> jetty                                    │ 8.1.14.v20131031 │          │
> Uninstalled │ standard-4.2.3                    │
> pax-jetty                                │ 9.4.18.v20190429 │          │
> Uninstalled │ org.ops4j.pax.web-7.2.10          │ Provide Jetty engine
> support
> pax-jetty-http2                          │ 7.2.10           │          │
> Uninstalled │ org.ops4j.pax.web-7.2.10          │ Optional additional
> feature to run Jetty with SPDY
> pax-http-jetty                           │ 7.2.10           │          │
> Uninstalled │ org.ops4j.pax.web-7.2.10          │
> camel-jetty                              │ 3.0.0.M2         │          │
> Uninstalled │ camel-3.0.0-M2                    │
> pax-cdi-web-weld-jetty                   │ 1.1.1            │          │
> Uninstalled │ org.ops4j.pax.cdi-1.1.1           │ Weld Web CDI / Jetty
> support
> cxf-http-jetty                           │ 3.3.0            │          │
> Uninstalled │ cxf-3.3.0                         │
> pax-cdi-web-weld-jetty                   │ 1.0.0            │          │
> Uninstalled │ org.ops4j.pax.cdi-1.0.0           │ Weld Web CDI / Jetty
> support
> pax-jetty                                │ 9.4.12.v20180830 │          │
> Uninstalled │ org.ops4j.pax.web-7.2.8           │ Provide Jetty engine
> support
> pax-jetty-http2                          │ 7.2.8            │          │
> Uninstalled │ org.ops4j.pax.web-7.2.8           │ Optional additional
> feature to run Jetty with SPDY
> pax-http-jetty                           │ 7.2.8            │          │
> Uninstalled │ org.ops4j.pax.web-7.2.8           │
>
> but ...
>
>
> 5) I blacklisted
> <repository>mvn:org.ops4j.pax.web/pax-web-features/7.2.10/xml/features</repository>
>
> and now it's working *YES*
>
> Ok, forget all the text before but from finding the problem (thuesday) to
> now (saturday) I was investigating a lot of time for ... hmm
>
>
>
> 6) Therefore .... How to avoid bad surprises (is that english?) in the
> future ?
>
> I wan't to have a stable feature and repo list. Is it possible to disable
> 'automatic update' of the repo-list and/or set a static list of
> repositories?
>
> So it will not be possible a 'new' repository will bring me to wonder why
> the formerly working development is now in a critical state.
>
> As I understand the problem this will also not be solved by a static karaf
> distribution. If I create a new distribution the same mechanism will
> provide 'new' repos and the created karaf distribution is buggy too.
>
>
>
> Thx & Regards
> Mike
>
>
> On 18. May 2019, at 06:54, Jean-Baptiste Onofré <[email protected]> wrote:
>
> Hi Mike,
>
> That's probably due to a refresh. A feature or bundle newly installed
> can trigger a refresh (for instance due to an optional import) and than
> new feature can be installed if you don't use version range cleanly.
>
> If you want to avoid this, you can:
>
> 1. first of all, verify your import and the version. As reminder, a
> import package like "foo" actually mean "foo;version=0.0.0" which
> actually mean "foo;version=[0,)" so basically any version ;)
> 2. you can blacklist some features. It's what I did since Karaf 4.2.5 to
> avoid to have 4.3.0-SNAPSHOT features installed. See
>
> https://github.com/apache/karaf/blob/karaf-4.2.x/assemblies/features/base/src/main/resources/resources/etc/org.apache.karaf.features.xml
> 3. you can also installed bundles/features causing the refresh in
> startup or boot phase, it would avoid the refresh later. You can use
> feature:install -t -v to have details about the bundles refreshed and why.
>
> If you don't want to use resolution at runtime (dynamic distribution),
> but you want to do the resolution at build time (static distribution),
> you can take a look on the blog I did about that:
> http://blog.nanthrax.net/?p=893
>
> Regards
> JB
>
> On 17/05/2019 19:49, Mike wrote:
>
> Hi,
>
> sorry for delay ...
>
> I found that cxf 3.3.0 and 3.3.1 is installed. I installed the feature
> without version definition
>
> feature:install cxf
>
> I tried
>
> feature:install cxf/3.3.0
>
> and only 3.3.0 is installed and also only one jetty version.
>
> But if I install
>
> feature:install cxf/3.3.1 (and some more features)
>
> both 3.3.0 and 3.3.1 will be installed
>
> Next I will try to blacklist installation of 3.3.0 ...
>
> But how could it happen that a karaf release will install new features
> after a time?
> I will have big problems installing productive systems (installation
> description is not save). Had the same problem already with
> "mvn:org.apache.karaf.features/standard/4.3.0-SNAPSHOT/xml/features"
>
>
> Thanks for help ... Mike
>
>
> Following the info block:
>
> karaf@root(service)> info
> Karaf
>  Karaf version               4.2.3
>  Karaf home                  /opt/karaf
>  Karaf base                  /opt/karaf
>  OSGi Framework              org.apache.felix.framework-5.6.12
>
> JVM
>  Java Virtual Machine        OpenJDK 64-Bit Server VM version
> 11.0.2+9-Debian-3bpo91
>  Version                     11.0.2
>  Vendor                      Oracle Corporation
>  Pid                         12
>  Uptime                      29 minutes
>  Process CPU time            1 minute
>  Process CPU load            0.00
>  System CPU load             0.02
>  Open file descriptors       417
>  Max file descriptors        1,048,576
>  Total compile time          45.841 seconds
> Threads
>  Live threads                100
>  Daemon threads              79
>  Peak                        120
>  Total started               560
> Memory
>  Current heap size           198,371 kbytes
>  Maximum heap size           2,097,152 kbytes
>  Committed heap size         324,608 kbytes
>  Pending objects             0
>  Garbage collector           Name = 'G1 Young Generation', Collections =
> 37, Time = 0.721 seconds
>  Garbage collector           Name = 'G1 Old Generation', Collections = 0,
> Time = 0.000 seconds
> Classes
>  Current classes loaded      14,130
>  Total classes loaded        14,130
>  Total classes unloaded      0
> Operating system
>  Name                        Linux version 4.9.125-linuxkit
>  Architecture                amd64
>  Processors                  5
>
>
>
> I Install the following features:
>
>
> feature:repo-add camel
> feature:repo-add cxf 3.3.1
> feature:repo-add activemq 5.15.8
> feature:install deployer camel-blueprint aries-blueprint cxf openjpa3
> activemq-client
>
>
> REACTIVE_VERSION=1.6.1-SNAPSHOT
>
> feature:repo-add
> mvn:de.mhus.cherry.reactive/reactive-feature/${REACTIVE_VERSION}/xml/features
> feature:install openjpa3 cherry-reactive-dev cherry-reactive-all
>
> Defined here
> https://github.com/mhus/cherry-reactive/tree/master/reactive-docker/reactive-playground/deploy
>
> and here
> https://github.com/mhus/cherry-reactive/blob/master/reactive-feature/src/main/feature/feature.xml
>
>
>
> On 17. May 2019, at 05:56, Jean-Baptiste Onofré <[email protected]> wrote:
>
> Hi Mike,
>
> Which features are you installing and which Karaf version ?
>
> Jetty 9.4.12 is the version provided up to Karaf 4.2.5. So 9.4.18 is
> installed by another feature (CXF or Camel for instance).
>
> Karaf 4.2.6 upgrades to Jetty 9.4.18.
>
> With Karaf 4.2.5, you can blacklist a version to use an unique one.
>
> Regards
> JB
>
> On 16/05/2019 23:05, Mike wrote:
>
> Hello,
>
> Since a new installation I have two versions of jetty installed.
>
>
> 206                  | org.eclipse.jetty.client
>                                                      | 9.4.12.v20180830
>                       | Active                    | 2019-05-16 20:50:01
>                  | valid
> 207                  | org.eclipse.jetty.client
>                                                      | 9.4.18.v20190429
>                       | Active                    | 2019-05-16 20:50:01
>                  | valid
> 2
>
> jetty is not working because the extensions will not match
>
> 20:51:18.844 ERROR [FelixDispatchQueue] FrameworkEvent ERROR -
> org.ops4j.pax.web.pax-web-extender-whiteboard
> java.util.ServiceConfigurationError:
> org.eclipse.jetty.websocket.api.extensions.Extension:
> org.eclipse.jetty.websocket.common.extensions.identity.IdentityExtension
> not a subtype
> at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
> at
> java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1236)
> at
> java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
> at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
> at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
> at
> org.eclipse.jetty.websocket.api.extensions.ExtensionFactory.<init>(ExtensionFactory.java:35)
> at
> org.eclipse.jetty.websocket.common.extensions.WebSocketExtensionFactory.<init>(WebSocketExtensionFactory.java:34)
> at
> org.eclipse.jetty.websocket.server.WebSocketServerFactory.<init>(WebSocketServerFactory.java:161)
> at
> org.eclipse.jetty.websocket.server.WebSocketServerFactory.<init>(WebSocketServerFactory.java:135)
> at
> org.eclipse.jetty.websocket.server.WebSocketServerFactory.<init>(WebSocketServerFactory.java:114)
>
>
> How could this happen? Doing the same then ever ...
>
> Thanks for help !!
>
> Mike
>
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
>

Reply via email to