You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Sebastian Gozin <se...@gmail.com> on 2012/11/28 16:20:59 UTC
jaxrs endpoints not working with cxf feature?
I've been experimenting the past few days with Karaf. The osgi/blueprint parts work well enough but when I wanted to create some jaxrs rest endpoints I ran into trouble.
I mostly followed some blog posts as I can't seem to find official documentation for this particular feature.
See:
http://blog.nanthrax.net/2011/08/jax-rs-services-using-cxf-and-karaf/
http://www.dankulp.com/blog/2011/11/apache-cxf-in-osgi/
Only deviations I made would be:
- I removed some unused namespace and schema location declarations from the example blueprint xml files.
- I'm not using a jaxb annotated return value but a simple list of strings.
- I'm using gradle in lieu of maven.
The karaf log mentions my bundles are picked up and I can see some logs which appear to refer to the server address and the endpoints I defined in my blueprint xml.
At this point the blog posts suggest I can reach the jaxrs endpoint at http://localhost:8181/cfx/prefix/path but when I try this an exception in the karaf log file saya there is no match for the url. I can't make much sense of all this though I did see a log entry complaining about port 8181 already being in use. So perhaps cxf is started twice and my endpoints were bound to the instance unable to bind to 8181?
Lest I forget,
I don't know if this is the place to ask questions about the cxf feature. I couldn't find any indication of the feature's existence other than those 2 blog posts.
Perhaps someone could point me to the proper place?
Thanks,
Sebastian
PS: I can provide my sources on github if necessary.
Re: jaxrs endpoints not working with cxf feature?
Posted by sgo <se...@gmail.com>.
Ok, guess I'll avoid a DenverCoder9 situation and answer my own question.
Documentation for CXF/jaxrs/osgi can be found at
http://cxf.apache.org/docs/jax-rs.html though it wasn't that obvious in my
opinion.
It's essentially the same as on the previously mentioned blog posts.
So questions should really go to their mailing list and not this one.
My mistake,
was not using a leading slash in the address attribute of <jaxrs:server
id="karafFeaturesService" address="/karaf">
At this point I still appear to have an issue with json marshalling but at
least I can focus on that now.
PS: It would appear the port 8181 already in use exception is really just
noise which can be ignore.
--
View this message in context: http://karaf.922171.n3.nabble.com/jaxrs-endpoints-not-working-with-cxf-feature-tp4026926p4026948.html
Sent from the Karaf - User mailing list archive at Nabble.com.