3

I am trying to use Karaf to host a REST service. I am using version 4.0.0 M2 (as I'm early on in my prototype). From what I have pieced together, in order to host a REST service, I can use Karaf Features to install the http and cxf features.

What I have done so far...

  • started Karaf - started fine
  • set it up to find my local maven repo - fine
  • used feature:repo-add mvn:org.apache.cxf.karaf/apache-cxf/3.0.4/xml/features - that worked without error, and I can see the xml in my mvn repo
  • ran feature:install http - that worked, and I can see evidence of the Jetty code running
  • ran feature:install cxf - this fails

I am getting this message in the console

karaf@root()> feature:install cxf Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=cxf-http-jetty; type=karaf.feature; version=3.0.4 [caused by: Unable to resolve cxf-http-jetty/3.0.4: missing requirement [cxf-http-jetty/3.0.4] osgi.identity; osgi.identity=org.apache.cxf.cxf-rt-transports-http-jetty; type=osgi.bundle; version="[3.0.4,3.0.4]"; resolution:=mandatory [caused by: Unable to resolve org.apache.cxf.cxf-rt-transports-http-jetty/3.0.4: missing requirement [org.apache.cxf.cxf-rt-transports-http-jetty/3.0.4] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.eclipse.jetty.continuation)(version>=7.6.0)(!(version>=8.2.0)))"]]

If I look at the bundles that are there, I can see org.eclipse.jetty.continuation package in my system when http is installed

2015-05-08 09:29:02,928 | INFO | pool-40-thread-1 | FeaturesServiceImpl | 6 - org.apache.karaf.features.core - 4.0.0.M2 | org.eclipse.jetty.continuation / 9.2.7.v20150116

So, it's at version 9.2.7. If I understand the error back at installing cxf, it wants a version that is >= 7.6.0 and not >= 8.2.0.

Is there a version of the HTTP service that I can use with CXF? I'm fairly new to Karaf, so I'm not sure how to specify an older version. Thanks for any help.

EdH
  • 4,918
  • 4
  • 24
  • 34
  • So, instead of using Karaf 4.0, I installed Karaf 3.0.3 and, following the same steps, was able to install the cxf feature. So, perhaps the real question is whether there is a roadmap for cxf to support karaf 4.0? – EdH May 08 '15 at 04:19

2 Answers2

0

Yes, that's a known issue. Not sure though, if known to Karaf and CXF folks. I too had issue with Karaf 4.0.0, I couldnt even install http cxf. I then went back to Karaf 3.0.3 and things worked for me. I too have this concern! Does Apache Karaf project/team really consider its own Apache CXF ? Well, I doubt!

Puneet Pandey
  • 960
  • 2
  • 14
  • 28
  • 1
    FYI - I've downloaded karaf 4.0.0.M3, and I've installed apache cxf 3.1.0 into it, and it works fine. So, changes in my setup... karaf 4.0.0 M3 (instead of M2) and cxf 3.1.0 (instead of 3.0.4). But, I can host my rest services just fine. – EdH Jun 11 '15 at 05:53
0

Karaf 4.x comes with Jetty 9 (not 8). So, you have to update your CXF version (3.11 for instance) or downgrade to Karaf 3 (which provides Jetty 8).

chandresh
  • 141
  • 6