users@jersey.java.net

[Jersey] WARNING: Component of class <inner-class> cannot be instantiated and will be ignored.

From: Reto Gmür <reto_at_wymiwyg.com>
Date: Fri, 30 May 2014 00:01:35 +0200

Hello,

I'm registering an nested singleton Object written in Scala as Singleton
component in a JAX-RS Application.

This an extraxt of the Scala code

class Activator {
 [...]
  final val path = "admin/renderlets/overview"
  @Path(path)
  object RenderletsOverview {
    @GET def get() = {


The object RenderletsOverview is returned by getSingletons() of the
Application.

Everything works fine. Except for an annoying warning on the console:

May 29, 2014 11:50:11 PM org.glassfish.jersey.server.ApplicationHandler
initialize
INFO: Initiating Jersey application, version Jersey: 2.2 2013-08-14
08:51:58...
May 29, 2014 11:50:11 PM org.glassfish.jersey.server.ApplicationHandler
bindProvidersAndResources
WARNING: Component of class class [...]Activator$RenderletsOverview$ cannot
be instantiated and will be ignored.

Jersey gets the object as instance, so why should it try to instantiate it?
And yes, despite the warning the root-resource works and can be accessed
over the web.

Cheers,
Reto