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 Jersey's built-in HK2 dependency injection. I am running this on Tomcat. My goal is to create a singleton instance of a support class that will be used by various web service methods. I don't have a strong preference between constructor injection, method injection, and annotating a class member (as I do below). Here is my to-be-singleton class: package singletest; import