Hi,
I've got something along the lines of:
@Service
public class TestClass
{
@Inject
public TestClass()
{
}
}
public class MyApplication extends ResourceConfig
{
@Inject
public MyApplication(ServiceLocator serviceLocator)
{
TestClass test = serviceLocator.getService(TestClass.class);
}
}
but serviceLocator.getService(TestClass.class) returns null. What am I
missing? Isn't HK2 supposed to auto-bind @Service-annotated classes somehow?
PS: Do you monitor the "hk2" tag on Stackoverflow? I think it's a more
efficient way of handling recurring questions.
Thanks,
Gili