Tencent/spring-cloud-tencent

网关使用spring-cloud-starter-gateway-mvc整合polaris问题

Closed this issue · 2 comments

spring cloud 整合北极星版本1.13.2-2023.0.0
网关使用spring-cloud-starter-gateway-mvc 异常。

完整异常信息如下:

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
启动ApplicationContext时出错。若要显示条件评估报告,请在启用“debug”的情况下重新运行应用程序。

2024-07-19T10:16:49.665+08:00 ERROR 64964 --- [aurofa-commons] [ main] o.s.boot.SpringApplication : Application run failed
2012-07-19 t10:16:49 .665 08:00 ERROR 64964—[aurora -commons] [main] o.s.boot.SpringApplication:应用程序运行失败

java.lang.IllegalStateException: Error processing condition on com.tencent.cloud.polaris.DiscoveryPropertiesAutoConfiguration.polarisDiscoveryProperties
java.lang.IllegalStateException: com.tencent.cloud.polaris.DiscoveryPropertiesAutoConfiguration.polarisDiscoveryProperties的错误处理条件

at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[spring-boot-autoconfigure-3.3.1.jar:3.3.1]
[spring-boot- autoconfiguration -3.3.1.jar:3.3.1]

at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-6.1.10.jar:6.1.10]
[springframework.context.annotation. conditionevaluator . shouldskip (ConditionEvaluator.java:108) ~[spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:183) ~[spring-context-6.1.10.jar:6.1.10]
[springframework.context.annotation. configurationclassbeandefinitionreader . loadbeandefinitionsforbeanmethod] [spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144) ~[spring-context-6.1.10.jar:6.1.10]
[spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) ~[spring-context-6.1.10.jar:6.1.10]
[springframework.context.annotation. ConfigurationClassBeanDefinitionReader.java:120]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:429) ~[spring-context-6.1.10.jar:6.1.10]
[spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:290) ~[spring-context-6.1.10.jar:6.1.10]
在org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:290) ~[spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349) ~[spring-context-6.1.10.jar:6.1.10]
PostProcessorRegistrationDelegate.java:349 ~[spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118) ~[spring-context-6.1.10.jar:6.1.10]
PostProcessorRegistrationDelegate.java:118 ~[spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:788) ~[spring-context-6.1.10.jar:6.1.10]
AbstractApplicationContext.java:788) ~[spring-context-6.1.10.jar:6.1.10]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) ~[spring-context-6.1.10.jar:6.1.10]
AbstractApplicationContext.java:606 ~[spring-context-6.1.10.jar:6.1.10]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.1.jar:3.3.1]
[spring-boot-3.3.1.jar:3.3.1]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.3.1.jar:3.3.1]
[spring-boot-3.3.1.jar:3.3.1]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.3.1.jar:3.3.1]
在org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[springboot -3.3.1.jar:3.3.1]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.3.1.jar:3.3.1]
[spring-boot-3.3.1.jar:3.3.1]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) ~[spring-boot-3.3.1.jar:3.3.1]
[spring-boot-3.3.1.jar:3.3.1]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) ~[spring-boot-3.3.1.jar:3.3.1]
[spring-boot-3.3.1.jar:3.3.1]

at com.aurora.framework.gateway.AuroraGatewayApplication.main(AuroraGatewayApplication.java:11) ~[classes/:na]
[classes/:na]

Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.tencent.cloud.plugin.gateway.SCGPluginsAutoConfiguration$RuleStainingPluginConfiguration] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@4e0e2f2a]
原因:java.lang.IllegalStateException: Failed to introspecintrospection Class [com.tencent.cloud.plugin.gateway.]SCGPluginsAutoConfiguration$RuleStainingPluginConfiguration] from ClassLoader [jdk.internal.loader.ClassLoader $AppClassLoader@4e0e2f2a]

at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483) ~[spring-core-6.1.10.jar:6.1.10]
在org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483) ~[spring-core-6.1.10.jar:6.1.10]

at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:360) ~[spring-core-6.1.10.jar:6.1.10]
在org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:360) ~[spring-core-6.1.10.jar:6.1.10]

at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:417) ~[spring-core-6.1.10.jar:6.1.10]
在org.springframework.util. reflectionutils . getuniquedeclardmethods (ReflectionUtils.java:417) ~[spring-core-6.1.10.jar:6.1.10]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$1(AbstractAutowireCapableBeanFactory.java:750) ~[spring-beans-6.1.10.jar:6.1.10]
$ getypeforfactorymethod $1(AbstractAutowireCapableBeanFactory.java:750) ~[spring-beans-6.1.10.jar:6.1.10]

at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
和 java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[that:na]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:749) ~[spring-beans-6.1.10.jar:6.1.10]
@ org.springframework.beans.factory. abstractautowirecapablebeanfactory . gettypeforfactorymethod (AbstractAutowireCapableBeanFactory.java:749) ~

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:682) ~[spring-beans-6.1.10.jar:6.1.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:653) ~[spring-beans-6.1.10.jar:6.1.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1687) ~[spring-beans-6.1.10.jar:6.1.10]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:562) ~[spring-beans-6.1.10.jar:6.1.10]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) ~[spring-beans-6.1.10.jar:6.1.10]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:247) ~[spring-boot-autoconfigure-3.3.1.jar:3.3.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:240) ~[spring-boot-autoconfigure-3.3.1.jar:3.3.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:230) ~[spring-boot-autoconfigure-3.3.1.jar:3.3.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:183) ~[spring-boot-autoconfigure-3.3.1.jar:3.3.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:158) ~[spring-boot-autoconfigure-3.3.1.jar:3.3.1]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-3.3.1.jar:3.3.1]
... 17 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/cloud/gateway/filter/GlobalFilter
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na]
at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na]
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3578) ~[na:na]
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2676) ~[na:na]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465) ~[spring-core-6.1.10.jar:6.1.10]
... 33 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.gateway.filter.GlobalFilter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na]
... 46 common frames omitted
…46个常用框架省略

这是polaris和mvc模式的gateway还没集成好吧?

目前版本还不支持spring-cloud-gateway-mvc,需新增sct对spring cloud gateway mvc的支持