Reputation: 383
I'm trying to setup a REST client based on jersey 2. That client code needs to run in a Jetty 9 server (standalone, not embedded) and is supposed to retrieve/consume data from another service. My very basic first test call looks like this:
ClientBuilder.newClient().target("https://10.224.1.206:8443/axis/services/EndSystemWebService").path("getAll").request().get( String.class )
This call fails with the following error:
Exception in thread "MyApp" MultiException stack 1 of 1 org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl(requiredType=ServiceLocator,parent=JaxbAutoDiscoverable,qualifiers={},position=-1,optional=false,self=false,unqualified=null,186516043) at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:75) at org.jvnet.hk2.internal.Utilities.justInject(Utilities.java:945) at org.jvnet.hk2.internal.ServiceLocatorImpl.inject(ServiceLocatorImpl.java:980) at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1055) at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1046) at org.glassfish.jersey.model.internal.CommonConfig.configureAutoDiscoverableProviders(CommonConfig.java:608) at org.glassfish.jersey.client.ClientConfig$State.configureAutoDiscoverableProviders(ClientConfig.java:364) at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:399) at org.glassfish.jersey.client.ClientConfig$State.access$000(ClientConfig.java:90) at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:122) at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:119) at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:340) at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:733) at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:285) at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:135) at org.glassfish.jersey.client.JerseyInvocation.(JerseyInvocation.java:105) at org.glassfish.jersey.client.JerseyInvocation.(JerseyInvocation.java:101) at org.glassfish.jersey.client.JerseyInvocation.(JerseyInvocation.java:92) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:420) at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:316)
I'm not setting up my environment using Maven - doing it manually. So maybe there is something wrong with the libraries I'm using. Here they are:
Those are way too many by now but I kept adding them as I hoped that the issue would simply be due to a missing jar. It wasn't.
Any help is highly appreciated. Thanks
Upvotes: 1
Views: 2043