I have a class of which only static methods are to be accessed via @path annotations and which does not have a public constructor. My simpilified program is:
@Path("")
static class MyStaticClass
{
private MyStaticClass() {...}
@Get @Path("time")
static public String time()
{
return Instant.now().toString();
}
}
Running and calling "time" gives me the following error:
WARNUNG: The following warnings have been detected: WARNING: HK2 service reification failed for [...] with an exception:
MultiException stack 1 of 2
java.lang.NoSuchMethodException: Could not find a suitable constructor in [...] class.