Hi, No, I didn't tried (but for sure I will!). I thought my bundle won't start after all BP beans are resolved, so I thought I can't publish a nested/internal OSGIService.
Thank you, 2014/1/12 Jean-Baptiste Onofré <[email protected]> > Hi Charlie, > > Did you try to create a kind of wrapper CDI bean, expose it as a service > (using <service/>) and use it in a nested RS bean ? > > Regards > JB > > > On 01/12/2014 03:16 PM, Charlie Mordant wrote: > >> Hi! >> >> I'm trying to create a CXF-RS server based on a Pax-CDI bean. >> >> This bean is necessarily a CDI one because I'm using Hibernate Validator >> CDI extension to validate it: >> @Named >> @Path ("/") >> public class MyBean { >> @POST >> @Consumes(XML) >> public void addSomething(@Valid Something something) {/*do stuff*/} >> }} >> >> I was used to declare my RS services server in the blueprint file: >> >> <jaxrs:serverid="beanServiceCXF"address="/beanService"> >> >> <jaxrs:serviceBeans> >> >> <refcomponent-id="myBean"/> >> >> >> </jaxrs:serviceBeans> >> >> <jaxrs:providers> >> >> <refcomponent-id="jaxbProvider"/> >> >> <refcomponent-id="jsonProvider"/> >> >> <beanid="validationException" >> >> >> class="helpers.cxf.exception.handling.jaxrs.mapper.ExceptionXmlMapper"/> >> >> </jaxrs:providers> >> >> </jaxrs:server> >> >> <cxf:bus> >> >> <cxf:features> >> >> <cxf:logging/> >> >> </cxf:features> >> >> </cxf:bus> >> >> >> >> Unfortunately, I'm not able to inject this CDI Bean as a blueprint >> reference (a workaround could be to export this CDI bean as an OSGI >> service and reference it on another bundle that exposes the web service >> but it's a little overengineered): is there a way to do this? for >> example accessing to the bundle Blueprint component registry and adding >> this CDI bean? >> >> >> Thank you in advance, >> >> Charlie >> >> > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Cordialement, Charlie Mordant
