Hi, Please see my comments inline
On Sat, Mar 14, 2020 at 11:54 AM Alex Weirig <alex.wei...@technolink.lu> wrote: > Hi Tim, > > thanks for your answer, that was what I was looking at to begin, this was > my initial code > > @Reference ClientBuilder clientBuilder; > > Client client = clientBuilder.hostnameVerifier((s, session) -> > true) > .sslContext(sslContext) > .register(new > JacksonJsonProvider(objectMapper)) > .connectTimeout(10, TimeUnit.MINUTES) > .build(); > > with but then I faced: > > Error executing command: Unable to resolve > lu.tlk.occupation_postes_electronique.services.login-service [123](R > 123.2): missing requirement > [lu.tlk.occupation_postes_electronique.services.login-service [123](R > 123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client) > Unresolved requirements: > [[lu.tlk.occupation_postes_electronique.services.login-service [123](R > 123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client)] > I then manually added > > bundle:install mvn:javax.ws.rs/javax.ws.rs-api/2.1 > > This is the problem, shouldn't use this one, should use mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/2.9.1 which has OSGi locator enabled. > > > and then I got > Error executing command: Error executing command on bundles: Error starting > bundle 123: Unable to resolve > lu.tlk.occupation_postes_electronique.services.login-service [123](R 123.2): > missing requirement > [lu.tlk.occupation_postes_electronique.services.login-service [123](R 123.2)] > osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0)) Unresolved > requirements: [[lu.tlk.occupation_postes_electronique.services.login-service > [123](R 123.2)] osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0))] > So at that point I tried to revert to the old code I already and I knew was > running back then ... > > You had a post back in 2018 about this but it was related to Java 9 ... I'm > still on Java 8. > > I didn't find anything relevant to this contract issue (except some stuff > about Johnzon JSON-B ... > > > > > Mat frëndleche Gréiss, > Mit freundlichen Grüßen, > Meilleures salutations, > Kind regards,Alex WeirigResponsable Technique > Ville de Luxembourg > Service Enseignement > Centre Technolink > *Tel* +352 4796 - 6127 <+35247966127>*Fax* +352 42 88 81*Email* > alex.wei...@technolink.luwww.vdl.lu // www.technolink.lu > > Centre Technolink > 2, rue Charles de Tornaco > L-2623 LUXEMBOURG > > indoors.this.blesses > <https://map.what3words.com/indoors.this.blesses> > schaufel.besten.kopie > <https://map.what3words.com/schaufel.besten.kopie> > supposons.levage.venger > <https://map.what3words.com/supposons.levage.venger> > On 14/03/2020 16:20, Tim Ward wrote: > > Have you considered creating the clients as described in the JAX-RS > Whiteboard specification ( > https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134114)? > This avoids the reflective loading pain that you’re hitting in a reliable > way. > > All the best, > > Tim > > Sent from my iPhone > > On 14 Mar 2020, at 15:05, Alex Weirig <alex.wei...@technolink.lu> wrote: > > BTW: > > from my docs it looks like I did that in the past using cxf 3.2.4. > > Have there been any significant breaking changes since 3.2.4? > > > Mat frëndleche Gréiss, > Mit freundlichen Grüßen, > Meilleures salutations, > Kind regards,Alex WeirigResponsable Technique > Ville de Luxembourg > Service Enseignement > Centre Technolink > *Tel* +352 4796 - 6127 <+35247966127>*Fax* +352 42 88 81*Email* > alex.wei...@technolink.luwww.vdl.lu // www.technolink.lu > > Centre Technolink > 2, rue Charles de Tornaco > L-2623 LUXEMBOURG > > indoors.this.blesses > <https://map.what3words.com/indoors.this.blesses> > schaufel.besten.kopie > <https://map.what3words.com/schaufel.besten.kopie> > supposons.levage.venger > <https://map.what3words.com/supposons.levage.venger> > On 14/03/2020 15:59, Alex Weirig wrote: > > Hi, > > I'm trying to develop a JAX-RS client on karaf 4.2.8. > > I've installed the usual suspects: > > feature:install scr webconsole > > and I've added the cxf repo > > cxf-3.3.5 │ > mvn:org.apache.cxf.karaf/apache-cxf/RELEASE/xml/features > > and installed following features: > > feature:install cxf-jaxrs cxf-core cxf-commands cxf-http-client cxf-jackson > > and I've installed my bundles. Everything is starting up as expected ... > > When I try to create a webclient in my code > > Client client = ClientBuilder.newBuilder().hostnameVerifier((s, > session) -> true) > .sslContext(sslContext) > .register(new > JacksonJsonProvider(objectMapper)) > .connectTimeout(10, > TimeUnit.MINUTES) > .build(); > > I get a CNF exception. > > java.lang.RuntimeException: java.lang.ClassNotFoundException > at > javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50) ~[?:?] > at > tlk.occupation_postes_electronique.services.login_service.impl.LoginServiceImpl.authenticate(LoginServiceImpl.java:92) > ~[?:?] > at > lu.tlk.occupation_postes_electronique.services.login_service_test.cmd.LoginServiceTestCommands.testLogin(LoginServiceTestCommands.java:22) > ~[?:?] > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > ~[?:1.8.0_212] > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > ~[?:1.8.0_212] > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > ~[?:1.8.0_212] > at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212] > at > org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:143) ~[?:?] > at > org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91) > ~[?:?] > at > org.apache.karaf.shell.impl.console.osgi.CommandTracker$1.execute(CommandTracker.java:112) > ~[?:?] > at > org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) > ~[?:?] > at > org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) > ~[?:?] > at > org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?] > at > org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) > ~[?:?] > at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) > ~[?:?] > at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?] > at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?] > at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?] > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > ~[?:1.8.0_212] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > ~[?:1.8.0_212] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > ~[?:1.8.0_212] > at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212] > Caused by: java.lang.ClassNotFoundException > at > javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:120) ~[?:?] > at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96) > ~[?:?] > at > javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?] > ... 21 more > Caused by: java.lang.InstantiationException > at > sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) > ~[?:1.8.0_212] > at java.lang.reflect.Constructor.newInstance(Constructor.java:423) > ~[?:1.8.0_212] > at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_212] > at > javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:116) ~[?:?] > at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96) > ~[?:?] > at > javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?] > ... 21 more > > I'm pretty sure I had something similar running in an older version of > karaf but I can't figure out what I'm missing today... > > Many thanks in advance > -- > > > Mat frëndleche Gréiss, > Mit freundlichen Grüßen, > Meilleures salutations, > Kind regards,Alex WeirigResponsable Technique > Ville de Luxembourg > Service Enseignement > Centre Technolink > *Tel* +352 4796 - 6127 <+35247966127>*Fax* +352 42 88 81*Email* > alex.wei...@technolink.luwww.vdl.lu // www.technolink.lu > > Centre Technolink > 2, rue Charles de Tornaco > L-2623 LUXEMBOURG > > indoors.this.blesses > <https://map.what3words.com/indoors.this.blesses> > schaufel.besten.kopie > <https://map.what3words.com/schaufel.besten.kopie> > supposons.levage.venger > <https://map.what3words.com/supposons.levage.venger> > > -- > This email was Anti Virus checked by SOPHOS UTM > > <alex_weirig.vcf> > >