2

I've created my minimal custom Karaf distribution:

mvn archetype:generate \
  -DarchetypeGroupId=org.apache.karaf.archetypes \
  -DarchetypeArtifactId=karaf-assembly-archetype \
  -DarchetypeVersion=4.1.4 \
  -DgroupId=my.karaf \
  -DartifactId=karaf-custom-distribution \
  -Dversion=1.0-SNAPSHOT \
  -Dpackage=my.karaf.distribution

cd karaf-custom-distribution
mvn install
cd target/assembly/bin/
./karaf

Then tried to install Keycloak feature into it manually:

feature:repo-add mvn:org.keycloak/keycloak-osgi-features/3.4.3.Final/xml/features
feature:install keycloak-jetty9-adapter
feature:install keycloak

The last command gives me an error back. Any suggestions how to solve this dependency error?

Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=keycloak; type=karaf.feature; version="[3.4.3.Final,3.4.3.Final]"; filter:="(&(osgi.identity=keycloak)(type=karaf.feature)(version>=3.4.3.Final)(version<=3.4.3.Final))" [caused by: Unable to resolve keycloak/3.4.3.Final: missing requirement [keycloak/3.4.3.Final] osgi.identity; osgi.identity=keycloak-osgi-adapter; type=karaf.feature [caused by: Unable to resolve keycloak-osgi-adapter/3.4.3.Final: missing requirement [keycloak-osgi-adapter/3.4.3.Final] osgi.identity; osgi.identity=http-whiteboard; type=karaf.feature; version="[2.3.0,4.0.0)"]]

karaf@root()> list
START LEVEL 100 , List Threshold: 50
 ID │ State  │ Lvl │ Version     │ Name
────┼────────┼─────┼─────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────
125 │ Active │  50 │ 2.6.0       │ Apache Commons IO
126 │ Active │  50 │ 1.0.1       │ Apache Aries Blueprint Web OSGI
127 │ Active │  50 │ 4.1.4       │ Apache Karaf :: Diagnostic :: Boot
128 │ Active │  50 │ 4.1.4       │ Apache Karaf :: Profile :: Core
129 │ Active │  50 │ 4.1.4       │ Apache Karaf :: Tooling :: Utils
130 │ Active │  50 │ 4.1.4       │ Apache Karaf :: OSGi Services :: Event
131 │ Active │  50 │ 1.3.5       │ Jolokia Agent
132 │ Active │  50 │ 2.20.2      │ camel-blueprint
133 │ Active │  80 │ 2.20.2      │ camel-commands-core
134 │ Active │  50 │ 2.20.2      │ camel-core
135 │ Active │  80 │ 2.20.2      │ camel-karaf-commands
139 │ Active │  80 │ 1.56        │ bcpkix
140 │ Active │  80 │ 1.56        │ bcprov
141 │ Active │  80 │ 2.8.9       │ Jackson-annotations
142 │ Active │  80 │ 2.8.9       │ Jackson-core
143 │ Active │  80 │ 2.8.9       │ jackson-databind
144 │ Active │  80 │ 3.4.3.Final │ Keycloak Adapter Core
145 │ Active │  80 │ 3.4.3.Final │ Keycloak Adapter SPI
146 │ Active │  80 │ 3.4.3.Final │ KeyCloak Authz: Client API
147 │ Active │  80 │ 3.4.3.Final │ Keycloak Common
148 │ Active │  80 │ 3.4.3.Final │ Keycloak Core
149 │ Active │  80 │ 3.4.3.Final │ Keycloak Jetty Adapter SPI
150 │ Active │  80 │ 3.4.3.Final │ Keycloak Jetty Core Integration
151 │ Active │  80 │ 3.4.3.Final │ Keycloak Jetty 9.2.x Integration
152 │ Active │  80 │ 3.4.3.Final │ Keycloak OSGI Thirdparty
  • 1
    official documentation proposes to start keycloak as a standalone server or deploy it to wildfly, but I don't want to add additional components to my project. – Gennadij Degterjow Feb 06 '18 at 18:54
  • As a question for your comment, are you looking for a keycloak integration for your application or do you want to make your application bundle the whole keycloak features (use it as an Idp?). I have never used features. – Aritz Feb 07 '18 at 07:37
  • my application is an OSGi bundle in Karaf container. It has JAX-RS backend and Angular5 frontend. I would like to have the keycloak server functionality as OSGi bundle. And use it on backend, frontend, camel and hawtio (Karaf web console). I've alredy tried all 3.4.x releases. The result is the same – Gennadij Degterjow Feb 07 '18 at 08:58
  • It seems to be a bug, so you should ask it in the keycloak-user mail list as well... – Aritz Feb 07 '18 at 09:05
  • I found one message in Keycloak mailing list. http://lists.jboss.org/pipermail/keycloak-user/2018-January/012791.html – Gennadij Degterjow Feb 08 '18 at 13:10
  • 1
    I've got an answer from Redhat. Keycloak didn't test with Karaf 4. There is pending PR for adding support for Fuse 7. See https://github.com/keycloak/keycloak/pull/4508 – Gennadij Degterjow Feb 10 '18 at 22:04

0 Answers0