eclipse-ee4j / eclipse-ee4j/jersey
Annoying Warning that class cannot be instanciated
- 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
Assessment
This issue has not been assessed yet.