diff --git a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/common/AbstractGatewayDiscoverer.java b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/common/AbstractGatewayDiscoverer.java index f72ab2a87a..3a04733553 100644 --- a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/common/AbstractGatewayDiscoverer.java +++ b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/common/AbstractGatewayDiscoverer.java @@ -43,7 +43,16 @@ public >, R> void doDiscover(Class supp List methods = new ArrayList<>(); for (Supplier> supplier : suppliers) { - methods.addAll(supplier.get()); + try { + methods.addAll(supplier.get()); + } + catch (NoClassDefFoundError e) { + if (log.isDebugEnabled()) { + log.debug(LogMessage.format("NoClassDefFoundError discovering supplier %s for type %s", supplierClass, returnType)); + } else if (log.isTraceEnabled()) { + log.debug(LogMessage.format("NoClassDefFoundError discovering supplier %s for type %s", supplierClass, returnType), e); + } + } } for (Method method : methods) {