Skip to content

Commit bd6edcd

Browse files
jbescossenivam
authored andcommitted
Jersey 3.1.9: java.lang.NoSuchMethodException: jakarta.inject.Inject.value() #5782
Signed-off-by: Jorge Bescos Gascon <[email protected]>
1 parent f217685 commit bd6edcd

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

core-common/src/main/java/org/glassfish/jersey/model/Parameter.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2019 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -447,14 +447,20 @@ protected static <PARAMETER extends org.glassfish.jersey.model.Parameter> List<P
447447
parameterClass);
448448
}
449449

450-
451450
private static String getValue(Annotation a) {
452451
try {
453-
Method m = a.annotationType().getMethod("value");
454-
if (m.getReturnType() != String.class) {
455-
return null;
452+
Method[] methods = a.annotationType().getMethods();
453+
for (Method method : methods) {
454+
if ("value".equals(method.getName())) {
455+
if (method.getReturnType() != String.class) {
456+
return null;
457+
} else {
458+
return (String) method.invoke(a);
459+
}
460+
}
456461
}
457-
return (String) m.invoke(a);
462+
LOGGER.log(Level.FINER, () ->
463+
String.format("Unable to get the %s annotation value property", a.getClass().getName()));
458464
} catch (Exception ex) {
459465
if (LOGGER.isLoggable(Level.FINER)) {
460466
LOGGER.log(Level.FINER,

0 commit comments

Comments
 (0)