Skip to content

Can not register jersey client in guice #101

Description

@pavelkokush

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions