Hi, From a code perspective the enRoute Quickstart example only imports the package javax.ws.rs <http://javax.ws.rs/>. It uses the OSGi contract for that package, which means that you would need to use an API which provides the contract. It also uses DS 1.4 annotations (and so picks up a DS 1.4 requirement), and it uses the ComponentPropertyType annotations from the HTTP whiteboard and JAX-RS Whiteboard. The resulting implementation requirement for the version 1.1 http whiteboard might be a problem in Karaf, which I imagine only provides 1.0
In summary, you could use the example, but you would probably need to modify the source to use DS 1.3 annotations, not use the Component Property annotations, and to use the property member of the Component annotation instead. This would avoid the DS 1.4 requirement, and the requirements for the HTTP and JAX-RS Whiteboards. While these requirements are correct and useful in general they do result in a requirement for features not present in Karaf 4.2, and my understanding is that it is not easy to update these parts of Karaf… Tim > On 23 Nov 2018, at 03:57, Jean-Baptiste Onofré <[email protected]> wrote: > > Hi Tim, > > does the enRoute examples work in Karaf ? (as we are on the Karaf > mailing list ;)) > > Regards > JB > > On 22/11/2018 20:53, Tim Ward wrote: >> There are some fairly simple examples available in the enRoute project. In >> general things should work as you expect, as long as you use the JAX-RS API, >> not the Jersey API :) >> >> The SSE from JAX-RS 2.1 definitely works (client and server side) with the >> Aries implementation, so hopefully that will give you everything that you >> need. >> >> Tim >> >>> On 22 Nov 2018, at 18:07, [email protected] wrote: >>> >>>> Honestly, it sounds like you’re about 30 minutes away from having the >>>> Aries JAX-RS Whiteboard working... >>> >>> OK, Understand your reference to servicemix annotation earlier. >>> I had to pick up the org.apache.felix.http.servlet-api-1.1.2.jar to get the >>> JavaServlet contract version 3.1. >>> >>> I've now got karaf starting cleanly, and it's obviously doing *something*. >>> I suspect if I created a simple example it would be working, but obviously >>> I was naive and greedy and went straight for converting my entire app. I >>> mean, what could go wrong? >>> >>> I say it's doing something, in that I can request an api and I get an error >>> such as: >>> java.lang.ClassNotFoundException: >>> org.glassfish.jersey.internal.RuntimeDelegateImpl not found by >>> javax.ws.rs-api >>> >>> but the important thing is that what's in the stack trace is my resource >>> class. So it's registered the endpoint and routed it correctly, it's just >>> I've got some references to jersey. I'll have to clean all that out and >>> it'll probably be more successful. >>> >>> Thanks. >> > > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com
