You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When bootstrapping Jersey 3.1.9 on Java SE 17 I came across this exception logged, which IMHO makes no sense to log at all:
org.glassfish.jersey.model.Parameter getValue
FINER: Unable to get the jdk.proxy2.$Proxy27 annotation value property
java.lang.NoSuchMethodException: jakarta.inject.Inject.value()
at java.base/java.lang.Class.getMethod(Class.java:2277)
at org.glassfish.jersey.model.Parameter.getValue(Parameter.java:452)
at org.glassfish.jersey.model.Parameter.create(Parameter.java:269)
at org.glassfish.jersey.server.model.Parameter.create(Parameter.java:68)
at org.glassfish.jersey.server.model.IntrospectionModeller.checkResourceClassFields(IntrospectionModeller.java:206)
at org.glassfish.jersey.server.model.IntrospectionModeller.doCreateResourceBuilder(IntrospectionModeller.java:118)
at org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:91)
at org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:88)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
at org.glassfish.jersey.server.model.IntrospectionModeller.createResourceBuilder(IntrospectionModeller.java:88)
at org.glassfish.jersey.server.model.Resource.from(Resource.java:781)
at org.glassfish.jersey.server.ResourceBagConfigurator.init(ResourceBagConfigurator.java:55)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:347)
at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:309)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:308)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:273)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:260)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.<init>(GrizzlyHttpContainer.java:310)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:142)
The reason for this exception is that @jakarta.inject.Inject does not have a method called value, but Jersey apparently expects to find it, as shown in the source code:
String.format("Unable to get the %s annotation value property", a.getClass().getName()), ex);
}
}
returnnull;
}
It is not a bug nor an exceptional case that an annotation does not have a value method, so I wonder what the benefit of logging this quite normal case shall have? It is quite normal to not find that method.
BTW, as exception handling is slow in Java, it might be a performance improvement to first check the result of getMethods() before actually requesting the value method.
The text was updated successfully, but these errors were encountered:
jbescos
added a commit
to jbescos/jersey
that referenced
this issue
Oct 29, 2024
When bootstrapping Jersey 3.1.9 on Java SE 17 I came across this exception logged, which IMHO makes no sense to log at all:
The reason for this exception is that
@jakarta.inject.Inject
does not have a method calledvalue
, but Jersey apparently expects to find it, as shown in the source code:jersey/core-common/src/main/java/org/glassfish/jersey/model/Parameter.java
Lines 450 to 464 in aafb9c4
It is not a bug nor an exceptional case that an annotation does not have a
value
method, so I wonder what the benefit of logging this quite normal case shall have? It is quite normal to not find that method.BTW, as exception handling is slow in Java, it might be a performance improvement to first check the result of
getMethods()
before actually requesting thevalue
method.The text was updated successfully, but these errors were encountered: