Skip to content

Commit

Permalink
Added loading jakarta.jws.WebParam when javax.jws.WebParam was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Vaserin committed May 25, 2023
1 parent eb433ed commit b91e345
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class JsonRpcBasicServer {
public static final String VERSION = "2.0";
public static final int CODE_OK = 0;
public static final String WEB_PARAM_ANNOTATION_CLASS_LOADER = "javax.jws.WebParam";
public static final String WEB_PARAM_ANNOTATION_CLASS_LOADER_JAKARTA = "jakarta.jws.WebParam";
public static final String NAME = "name";
public static final String NULL = "null";
private static final Logger logger = LoggerFactory.getLogger(JsonRpcBasicServer.class);
Expand Down Expand Up @@ -136,7 +137,15 @@ private static void loadAnnotationSupportEngine() {
WEB_PARAM_ANNOTATION_CLASS = classLoader.loadClass(WEB_PARAM_ANNOTATION_CLASS_LOADER).asSubclass(Annotation.class);
WEB_PARAM_NAME_METHOD = WEB_PARAM_ANNOTATION_CLASS.getMethod(NAME);
} catch (ClassNotFoundException | NoSuchMethodException e) {
logger.debug("Could not find {}.{}", WEB_PARAM_ANNOTATION_CLASS_LOADER, NAME);
logger.debug("Could not find {}.{}", WEB_PARAM_ANNOTATION_CLASS_LOADER, NAME);
logger.debug("Try to load it from jakarta package");
try {
WEB_PARAM_ANNOTATION_CLASS = classLoader.loadClass(WEB_PARAM_ANNOTATION_CLASS_LOADER_JAKARTA).asSubclass(Annotation.class);
WEB_PARAM_NAME_METHOD = WEB_PARAM_ANNOTATION_CLASS.getMethod(NAME);
} catch (ClassNotFoundException | NoSuchMethodException ex) {
logger.debug("Could not find {}.{}", WEB_PARAM_ANNOTATION_CLASS_LOADER_JAKARTA, NAME);
}

}
}

Expand Down

0 comments on commit b91e345

Please sign in to comment.