Top "Hk2" questions

HK2 is a light-weight and dynamic dependency injection framework for Java.

Dependency injection with Jersey 2.0

Starting from scratch without any previous Jersey 1.x knowledge, I'm having a hard time understanding how to setup dependency injection …

java dependency-injection jersey jersey-2.0 hk2
UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl

There are errors when using DI in Jersey Rest application: org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available …

java dependency-injection jersey glassfish hk2
HK2 failure has been detected in a code that does not run in an active Jersey Error scope

Currently I am developing a jersey based RESTful application and would like to use DPI in my resources. (Note: Version …

java dependency-injection jersey jersey-2.0 hk2
java.lang.noclassdeffounderror: org/glassfish/hk2/api/servicelocatorfactory$createpolicy

Why am I getting error even though I added all the required jars. I am trying to build rest client …

java rest jersey glassfish hk2
Trouble creating a simple singleton class in Jersey 2 using built-in Jersey dependency injection

I am having trouble getting a very basic implementation of a singleton class off the ground with Jersey 2 (2.7) and only …

dependency-injection singleton jax-rs jersey-2.0 hk2
Jersey 2.x Custom Injection Annotation With Attributes

I am in the process of migrating from DropWizard 0.7.1 to 0.8.1. This includes migrating from Jersey 1.x to 2.x. In my …

java jersey jersey-2.0 dropwizard hk2
Jersey Hk2 injecting @Service annotated classes

For the life of me I cannot get Jersey with hk2 to automatically discover @Service annotated classes and inject them. …

java service jersey inject hk2
How do I get a reference to the Jackson Object Mapper in a jersey2 / hk2 application

I have a jersey2 application configured for JSON support via Jackson, adding <dependency> <groupId>org.glassfish.…

java json dependency-injection jersey-2.0 hk2
How to get HK2 ServiceLocator in Jersey 2.12?

I would like to create a singleton instance of a class that is not involved in Jersey as a Resource …

java rest jersey-2.0 hk2