Camel Websocket Component Fails to Install into Karaf
Asked Answered
E

1

7

I'm using Apache Karaf 4.0.4 with Java Oracle 8 and trying to install the camel-websocket component. I've tried installing both versions 2.16.0 and 2.16.2 via:

feature:install camel-websocket

... and Karaf hangs and never returns.

As a work around I tried to run:

sudo wget -O /opt/apache-karaf-4.0.4/deploy/camel-websocket-2.16.2.jar http://central.maven.org/maven2/org/apache/camel/camel-websocket/2.16.2/camel-websocket-2.16.2.jar

To manually install via Karaf's hot deploy then I get the following:

karaf@root()> ERROR: Bundle org.apache.camel.camel-websocket [94] Error starting file:/opt/apache-karaf-4.0.4/deploy/camel-websocket-2.16.2.jar (org.osgi.framework.BundleException: Unable to resolve org.apache.camel.camel-websocket [94](R 94.0): missing requirement [org.apache.camel.camel-websocket [94](R 94.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=2.6.0)(!(version>=3.0.0))) Unresolved requirements: [[org.apache.camel.camel-websocket [94](R 94.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=2.6.0)(!(version>=3.0.0)))])
org.osgi.framework.BundleException: Unable to resolve org.apache.camel.camel-websocket [94](R 94.0): missing requirement [org.apache.camel.camel-websocket [94](R 94.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=2.6.0)(!(version>=3.0.0))) Unresolved requirements: [[org.apache.camel.camel-websocket [94](R 94.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=2.6.0)(!(version>=3.0.0)))]
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
    at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
    at java.lang.Thread.run(Thread.java:745)

I did find that when I turned on debugging in Karaf (i.e. log:set DEBUG) I saw the following error:

2016-03-10 14:54:08,127 | INFO  | nsole user karaf | FeaturesServiceImpl              | 9 - org.apache.karaf.features.core - 4.0.4 | Adding features: camel-websocket/[2.16.2,2.16.2]
2016-03-10 14:54:08,131 | DEBUG | pool-25-thread-1 | configadmin                      | 7 - org.apache.felix.configadmin - 1.8.8 | getProperties()
2016-03-10 14:54:08,148 | DEBUG | pool-25-thread-1 | Overrides                        | 9 - org.apache.karaf.features.core - 4.0.4 | Unable to load overrides bundles list
java.io.FileNotFoundException: /opt/apache-karaf-4.0.4/etc/overrides.properties (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)[:1.8.0_73]
    at java.io.FileInputStream.open(FileInputStream.java:195)[:1.8.0_73

Has anyone run into this issue? Any workarounds? How can I install javax.servlet manually?

Elemi answered 10/3, 2016 at 13:56 Comment(5)
Why don't you use directly the shell command feature install camel-websocket straight from the karaf console?Subinfeudate
I do and the process hangs. I will edit my post to make this more clear. When I turn on debugging (i.e. log:set DEBUG) I do get a failure to load overrides bundle but I'm not positive this is the issue.Elemi
I have only an older version of Karaf but in our case, every time we change something low-level (like new features), we are forced to cleanup the OSGI cache. Did you try it?Subinfeudate
You mean delete the karaf data directory? Yep, I've tried it.Elemi
I would suggest to use a more recent version of camel. We had timing issues with few camel component in an OSGI context. upgrading to 2.23.0 was fixing most of the bundle/feature not installing (or very slowly).Subinfeudate
S
1

This issue have been fixed in Apache Camel 2.18.0 with CAMEL-9689.

Relevant commit: https://github.com/apache/camel/commit/e42ef725cd2d6dd09ebfaf24b0ead6b2fa393174

Sells answered 24/7, 2019 at 22:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.