eclipse-ee4j / eclipse-ee4j/jersey

Annoying Warning that class cannot be instanciated

Open
#2,887 7 comments 0 reactions 0 assignees View on GitHub
Component: core Priority: Major Type: Bug
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

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

This an extract 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.
```

The warning seems to be pointless as Jersey gets the object as instance, so it doesn't need to instantiate the class. In fact, despite the warning the root-resource works and can be accessed over the web.

(Original mailing list mail: [https://java.net/projects/jersey/lists/users/archive/2014-05/message/78](https://java.net/projects/jersey/lists/users/archive/2014-05/message/78))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.