Can not register jersey client in guice
Opened this issue · 0 comments
pavelkokush commented
Given
new class
@Path("/")
public interface SomeResource
{
@GET
Integer get();
}
and client registration method in TestModule
@Provides
@Singleton
public SomeResource someClient()
{
Client c = ClientBuilder.newClient(new ClientConfig());
return WebResourceFactory.newResource(SomeResource.class, c.target(""));
}
and new dependency
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-proxy-client</artifactId>
<version>${dep.jersey.version}</version>
<scope>test</scope>
</dependency>
Then:
GuiceBundleTest, HK2LinkerTest, InjectedIntegrationTest, InjectedResourcesTest are failed.
(Actually I got a bit different error in my app, but seems reason same: it tried to initialize RuntimeDelegate before guice ServiceLocatorFactory installed)