WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

GuiceToHk2JITResolver does not resolve #564

@Akaame

Description

@Akaame

https://github.com/Akaame/jersey2-guice-example-with-test

I have created the above example repo to test Guice to HK2 bridge in which I can confirm that HK2 ServiceLocator indeed gets the instances from Guice. However I have two problems:

  • Injectee.parent == null therefore resolution immediately fails at this line.
  • I make it pass with assigning a bogus value during debug, however the Lookup Key is ServiceImpl (concrete class) and not Service (interface) therefore only the following succeeds which is not exactly what I want:
// This succeeds
Service service = InjectionManagerProvider.getInjectionManager(context)
                .getInstance(ServiceImpl.class);
// This fails
Service service = InjectionManagerProvider.getInjectionManager(context)
                .getInstance(ServiceImpl.class);

@jwells131313 Sorry for pinging you directly on this, but could you please take a look at this and tell if it is an issue on my side or on the bridge?

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