java 无法内省类[org.springframework.web.reactive.config.DelegatingWebFluxConfiguration]

aiazj4mn  于 2023-04-04  发布在  Java
关注(0)|答案(1)|浏览(235)

1.这个项目是以下与Reactapproch. 2.请参阅下面的日志我面对IllegalStateException看起来像它是React调用. 3.并得到这个org/springframework/web/server/i18 n/LocaleContextResolver,即使我没有使用任何文件或任何配置相关的i18 n.
应用程序.java

@SpringBootApplication
    @EnableWebFlux
    @EnableScheduling
    @OpenAPIDefinition(info = @Info(title = "Asyncmctlr API", version = "1.0", description = "asyncmctlr Information"))
    @SecurityScheme(name = "asyncmctlrapi", scheme = "bearer", type = SecuritySchemeType.HTTP, in = SecuritySchemeIn.HEADER)
    public class Application implements CommandLineRunner {
        @Autowired
        AsyncMultiQueueLoaderService asyncMultiQueueLoaderService;
        @Autowired
        SolaceFactory sf;
        Logger logger = LoggerFactory.getLogger(this.getClass().getName());
    
        public static void main(String[] args) {
            // ApplicationContext ctx = SpringApplication.run(Application.class, args);
            SpringApplication springApplication = new SpringApplication(Application.class);
            springApplication.addListeners(new ApplicationPidFileWriter());
            springApplication.run(args);
        }
    
        @Override
        public void run(String... args) throws Exception {
            try {
                sf.initialize();
            } catch (Exception je) {
                logger.info("error while initializing solace: " + je.getMessage());
            }
        }
    
        // @Scheduled(cron = "${multi.cron.expression}")
        public void triggerAsyncMultiLoader() {
    
            // Call AsynMultiQueueLoader Service from the scheduler
            asyncMultiQueueLoaderService.multiLoader();
        }
    }

SolaceJavaAutoConfiguration

@Configuration
    @AutoConfigureBefore(JmsAutoConfiguration.class)
    @ConditionalOnClass({ JCSMPProperties.class })
    @ConditionalOnMissingBean(SpringJCSMPFactory.class)
    @EnableConfigurationProperties(SolaceJavaProperties.class)
    public class SolaceJavaAutoConfiguration extends SolaceJavaAutoConfigurationBase {
        private SolaceCredentialsLoader solaceServicesInfoLoader = new SolaceCredentialsLoader();
    
        public SolaceJavaAutoConfiguration(SolaceJavaProperties properties) {
            super(properties);
        }
    
        @Override
        SolaceServiceCredentials findFirstSolaceServiceCredentialsImpl() {
            return solaceServicesInfoLoader.getSolaceServiceInfo();
        }
    
        @Override
        public List<SolaceServiceCredentials> getSolaceServiceCredentials() {
            return new ArrayList<>(solaceServicesInfoLoader.getAllSolaceServiceInfo().values());
        }
    
    }

**AsyncMultiQueueLoaderServiceImpl**

    import com.hp.it.psoit.asynmctlr.service.AsyncMultiQueueLoaderService;
    
    @EnableWebFlux
    public class AsyncMultiQueueLoaderServiceImpl implements AsyncMultiQueueLoaderService {
    
        @Override
        public void multiLoader() {
            // TODO Auto-generated method stub
            System.out.println("Printing multiLoader method from AsyncMultiQueueLoaderService");
        }
    
    }

聚合物.xml

<?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.hp.it.psoit</groupId>
        <artifactId>asynmctlr</artifactId>
        <packaging>jar</packaging>
        <name>asynmctlr</name>
        <version>v1</version>
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>3.0.2</version>
        </parent>
        <properties>
            <java.version>17</java.version>
            <maven.compiler.source>${java.version}</maven.compiler.source>
            <maven.compiler.target>${java.version}</maven.compiler.target>
            <spring-solace.version>4.3.0</spring-solace.version>
            <sol-jcsmp.version>10.18.0</sol-jcsmp.version>
            <spring-boot-admin.version>2.3.1</spring-boot-admin.version>
            <aws.java.sdk.version>1.12.257</aws.java.sdk.version>
            <oauth2.version>1.0.2</oauth2.version>
            <amazon.awssdk.crt.client.version>2.17.224</amazon.awssdk.crt.client.version>
            <software.amazon.awssdk.crt.version>0.16.16</software.amazon.awssdk.crt.version>
            <software.amazon.awssdk.version>2.17.224-PREVIEW</software.amazon.awssdk.version>
            <commons.io.version>2.11.0</commons.io.version>
            <sdk.core.version>2.17.244</sdk.core.version>
            <jakarta.validation.version>3.0.0</jakarta.validation.version>
            <spring.cloud.context.version>4.0.0</spring.cloud.context.version>
            <spring.jdbc.version>21.9.0.0</spring.jdbc.version>
            <springdoc.openapi.version>2.0.2</springdoc.openapi.version>
            <lombok.version>1.18.26</lombok.version>
            <jackson.datatype.version>2.10.0</jackson.datatype.version>
            <hibernate.validator.version>8.0.0.Final</hibernate.validator.version>
            <data.jpa.version>3.0.5</data.jpa.version>
            <java.jwt.version>4.2.1</java.jwt.version>
            <jwks.rsa.version>0.21.2</jwks.rsa.version>
            <esapi.version>2.2.0.0</esapi.version>
            <modelmapper.version>3.0.0</modelmapper.version>
            <lambda.java.core.version>1.1.0</lambda.java.core.version>
            <java.sdk.sqs.vesrion>1.11.1005</java.sdk.sqs.vesrion>
            <json.simple.version>1.1.1</json.simple.version>
            <java.events.version>1.3.0</java.events.version>
            <sdk.s3.version>1.12.438</sdk.s3.version>
        </properties>
    
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-elasticsearch</artifactId>
                <version>5.0.4</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-core</artifactId>
                <version>${lambda.java.core.version}</version>
            </dependency>
    
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-sqs</artifactId>
                <version>${java.sdk.sqs.vesrion}</version>
            </dependency>
            <dependency>
                <groupId>com.googlecode.json-simple</groupId>
                <artifactId>json-simple</artifactId>
                <version>${json.simple.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-events</artifactId>
                <version>${java.events.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-s3</artifactId>
                <version>${sdk.s3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </dependency>
            <!-- LDAP -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-mail</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-ldap</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-ldap</artifactId>
            </dependency>
            <dependency>
                <groupId>org.owasp.esapi</groupId>
                <artifactId>esapi</artifactId>
                <version>${esapi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-oauth2-client</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.modelmapper</groupId>
                <artifactId>modelmapper</artifactId>
                <version>${modelmapper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>java-jwt</artifactId>
                <version>${java.jwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>jwks-rsa</artifactId>
                <version>${jwks.rsa.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-jdbc</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
                <version>${data.jpa.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
                <version>3.1.5</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>4.3.8.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>com.solace.spring.boot</groupId>
                <artifactId>solace-java-spring-boot-starter</artifactId>
                <version>${spring-solace.version}</version>
            </dependency>
            <dependency>
                <groupId>com.solacesystems</groupId>
                <artifactId>sol-jcsmp</artifactId>
                <version>${sol-jcsmp.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-context</artifactId>
                <version>${spring.cloud.context.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web-services</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-webflux</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-mail</artifactId>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.oracle.database.jdbc</groupId>
                <artifactId>ojdbc8</artifactId>
                <version>${spring.jdbc.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-all</artifactId>
            </dependency>
            <dependency>
                <groupId>jakarta.validation</groupId>
                <artifactId>jakarta.validation-api</artifactId>
                <version>${jakarta.validation.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate.validator</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${hibernate.validator.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.joschi.jackson</groupId>
                <artifactId>jackson-datatype-threetenbp</artifactId>
                <version>${jackson.datatype.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
                <version>${springdoc.openapi.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk</artifactId>
                <version>${aws.java.sdk.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.oltu.oauth2</groupId>
                <artifactId>org.apache.oltu.oauth2.client</artifactId>
                <version>${oauth2.version}</version>
            </dependency>
    
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-oauth2-client</artifactId>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>http-client-spi</artifactId>
                <version>${amazon.awssdk.crt.client.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk.crt</groupId>
                <artifactId>aws-crt</artifactId>
                <version>${software.amazon.awssdk.crt.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>aws-crt-client</artifactId>
                <version>${software.amazon.awssdk.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>sdk-core</artifactId>
                <version>${sdk.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
                <optional>true</optional>
            </dependency>
        </dependencies>
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>de.codecentric</groupId>
                    <artifactId>spring-boot-admin-dependencies</artifactId>
                    <version>${spring-boot-admin.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <build>
            <sourceDirectory>src/main/java</sourceDirectory>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    </project>

错误日志

"C:\Program Files\Java\jdk-17\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.3\lib\idea_rt.jar=54041:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.3\bin" -Dfile.encoding=UTF-8 @D:\Users\DASCEIS\AppData\Local\Temp\idea_arg_file1204783640 com.hp.it.psoit.asynmctlr.Application

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.2)

2023-04-02T13:02:14.030+05:30  INFO 1972 --- [           main] com.hp.it.psoit.asynmctlr.Application    : Starting Application using Java 17.0.6 with PID 1972 (D:\Users\DASCEIS\Documents\it-psoit-asynmctlr-v1\target\classes started by DASCEIS in D:\Users\DASCEIS\Documents\it-psoit-asynmctlr-v1)
2023-04-02T13:02:14.054+05:30  INFO 1972 --- [           main] com.hp.it.psoit.asynmctlr.Application    : No active profile set, falling back to 1 default profile: "default"
2023-04-02T13:02:14.858+05:30  WARN 1972 --- [           main] o.s.c.annotation.AnnotationTypeMapping   : Support for convention-based annotation attribute overrides is deprecated and will be removed in Spring Framework 6.1. Please annotate the following attributes in @org.springframework.web.bind.annotation.RestControllerAdvice with appropriate @AliasFor declarations: [assignableTypes, annotations, basePackageClasses, basePackages]
2023-04-02T13:02:16.510+05:30 ERROR 1972 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Error processing condition on com.hp.it.psoit.asynmctlr.solace.SolaceJavaAutoConfiguration
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[spring-boot-autoconfigure-3.0.2.jar:3.0.2]
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:466) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:131) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:410) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:283) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:344) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:745) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:565) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.2.jar:3.0.2]
    at com.hp.it.psoit.asynmctlr.Application.main(Application.java:37) ~[classes/:na]
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.web.reactive.config.DelegatingWebFluxConfiguration] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@1d44bcfa]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483) ~[spring-core-6.0.4.jar:6.0.4]
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:360) ~[spring-core-6.0.4.jar:6.0.4]
    at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:417) ~[spring-core-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$1(AbstractAutowireCapableBeanFactory.java:749) ~[spring-beans-6.0.4.jar:6.0.4]
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:748) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:681) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:652) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1632) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:559) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:531) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:250) ~[spring-boot-autoconfigure-3.0.2.jar:3.0.2]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:243) ~[spring-boot-autoconfigure-3.0.2.jar:3.0.2]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:233) ~[spring-boot-autoconfigure-3.0.2.jar:3.0.2]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:181) ~[spring-boot-autoconfigure-3.0.2.jar:3.0.2]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:156) ~[spring-boot-autoconfigure-3.0.2.jar:3.0.2]
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-3.0.2.jar:3.0.2]
    ... 17 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/server/i18n/LocaleContextResolver
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na]
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402) ~[na:na]
    at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504) ~[na:na]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465) ~[spring-core-6.0.4.jar:6.0.4]
    ... 33 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.web.server.i18n.LocaleContextResolver
    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:520) ~[na:na]
    ... 37 common frames omitted

2023-04-02T13:02:16.520+05:30  WARN 1972 --- [           main] o.s.boot.SpringApplication               : Unable to close ApplicationContext

java.lang.IllegalStateException: Failed to introspect Class [org.springframework.web.reactive.config.DelegatingWebFluxConfiguration] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@1d44bcfa]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483) ~[spring-core-6.0.4.jar:6.0.4]
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:360) ~[spring-core-6.0.4.jar:6.0.4]
    at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:417) ~[spring-core-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$1(AbstractAutowireCapableBeanFactory.java:749) ~[spring-beans-6.0.4.jar:6.0.4]
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:748) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:681) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:652) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1632) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:559) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:531) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:658) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:650) ~[spring-beans-6.0.4.jar:6.0.4]
    at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1276) ~[spring-context-6.0.4.jar:6.0.4]
    at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:863) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:851) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:838) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:778) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.2.jar:3.0.2]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.2.jar:3.0.2]
    at com.hp.it.psoit.asynmctlr.Application.main(Application.java:37) ~[classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/server/i18n/LocaleContextResolver
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na]
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402) ~[na:na]
    at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504) ~[na:na]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465) ~[spring-core-6.0.4.jar:6.0.4]
    ... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.web.server.i18n.LocaleContextResolver
    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:520) ~[na:na]
    ... 25 common frames omitted

Process finished with exit code 1
9lowa7mx

9lowa7mx1#

在依赖项的深处,代码试图获取locale。这看起来像是不匹配的依赖项版本问题。以下依赖项应该从spring-boot-starter-parent的托管版本中获取其版本。如果它们是因为漏洞,则应该将其移动到<dependencyManagement>标签。如果它们不是为了漏洞缓解,则应该删除<version>

org.springframework.data:spring-data-elasticsearch
org.springframework.boot:spring-boot-starter-data-jpa
com.github.ben-manes.caffeine:caffeine
org.springframework:spring-web (maybe)
com.oracle.database.jdbc:ojdbc8 (very unlikely)
org.projectlombok:lombok (has no effect at sb 3.0.2)
jakarta.validation:jakarta.validation-api (very unlikely)
org.hibernate.validator:hibernate-validator (has no effect at sb 3.0.2)

另外,2.3.1版本的spring-boot-admin.version看起来很旧。可能3.0.2版本会有所帮助。
我不能说哪个依赖项不匹配是原因,但我最好的猜测是spring-boot-admin.versionorg.springframework:spring-web
我整理了pom。应用程序以pom.xml(基于您的代码和pom)和application.property条目开始,如下所示。
顺便说一句:org.springframework.web.server.i18n.LocaleContextResolverspring-web:6.0.4中,通过多个中间依赖关系到达。

建议pom.xml

<?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.hp.it.psoit</groupId>
        <artifactId>asynmctlr</artifactId>
        <packaging>jar</packaging>
        <name>asynmctlr</name>
        <version>v1</version>
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>3.0.2</version>
        </parent>
        <properties>
            <java.version>17</java.version>
            <maven.compiler.source>${java.version}</maven.compiler.source>
            <maven.compiler.target>${java.version}</maven.compiler.target>
            <spring-solace.version>4.3.0</spring-solace.version>
            <sol-jcsmp.version>10.18.0</sol-jcsmp.version>
            <spring-boot-admin.version>3.0.2</spring-boot-admin.version>
            <aws.java.sdk.version>1.12.257</aws.java.sdk.version>
            <oauth2.version>1.0.2</oauth2.version>
            <amazon.awssdk.crt.client.version>2.17.224</amazon.awssdk.crt.client.version>
            <software.amazon.awssdk.crt.version>0.16.16</software.amazon.awssdk.crt.version>
            <software.amazon.awssdk.version>2.17.224-PREVIEW</software.amazon.awssdk.version>
            <commons.io.version>2.11.0</commons.io.version>
            <sdk.core.version>2.17.244</sdk.core.version>
            <jakarta.validation.version>3.0.0</jakarta.validation.version>
            <spring.cloud.context.version>4.0.0</spring.cloud.context.version>
            <spring.jdbc.version>21.9.0.0</spring.jdbc.version>
            <springdoc.openapi.version>2.0.2</springdoc.openapi.version>
            <lombok.version>1.18.26</lombok.version>
            <jackson.datatype.version>2.10.0</jackson.datatype.version>
            <hibernate.validator.version>8.0.0.Final</hibernate.validator.version>
            <data.jpa.version>3.0.5</data.jpa.version>
            <java.jwt.version>4.2.1</java.jwt.version>
            <jwks.rsa.version>0.21.2</jwks.rsa.version>
            <esapi.version>2.2.0.0</esapi.version>
            <modelmapper.version>3.0.0</modelmapper.version>
            <lambda.java.core.version>1.1.0</lambda.java.core.version>
            <java.sdk.sqs.vesrion>1.11.1005</java.sdk.sqs.vesrion>
            <json.simple.version>1.1.1</json.simple.version>
            <java.events.version>1.3.0</java.events.version>
            <sdk.s3.version>1.12.438</sdk.s3.version>
        </properties>
    
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-elasticsearch</artifactId>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-core</artifactId>
                <version>${lambda.java.core.version}</version>
            </dependency>
    
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-sqs</artifactId>
                <version>${java.sdk.sqs.vesrion}</version>
            </dependency>
            <dependency>
                <groupId>com.googlecode.json-simple</groupId>
                <artifactId>json-simple</artifactId>
                <version>${json.simple.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-events</artifactId>
                <version>${java.events.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-s3</artifactId>
                <version>${sdk.s3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </dependency>
            <!-- LDAP -->
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-ldap</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-ldap</artifactId>
            </dependency>
            <dependency>
                <groupId>org.owasp.esapi</groupId>
                <artifactId>esapi</artifactId>
                <version>${esapi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-oauth2-client</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.modelmapper</groupId>
                <artifactId>modelmapper</artifactId>
                <version>${modelmapper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>java-jwt</artifactId>
                <version>${java.jwt.version}</version>
            </dependency>
            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>jwks-rsa</artifactId>
                <version>${jwks.rsa.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-jdbc</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
             </dependency>
            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
            </dependency>
            <dependency>
                <groupId>com.solace.spring.boot</groupId>
                <artifactId>solace-java-spring-boot-starter</artifactId>
                <version>${spring-solace.version}</version>
            </dependency>
            <dependency>
                <groupId>com.solacesystems</groupId>
                <artifactId>sol-jcsmp</artifactId>
                <version>${sol-jcsmp.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-context</artifactId>
                <version>${spring.cloud.context.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web-services</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-webflux</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-mail</artifactId>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>com.oracle.database.jdbc</groupId>
                <artifactId>ojdbc8</artifactId>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-all</artifactId>
            </dependency>
            <dependency>
                <groupId>jakarta.validation</groupId>
                <artifactId>jakarta.validation-api</artifactId>
            </dependency>
            <dependency>
                <groupId>org.hibernate.validator</groupId>
                <artifactId>hibernate-validator</artifactId>
            </dependency>
            <dependency>
                <groupId>com.github.joschi.jackson</groupId>
                <artifactId>jackson-datatype-threetenbp</artifactId>
                <version>${jackson.datatype.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
                <version>${springdoc.openapi.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk</artifactId>
                <version>${aws.java.sdk.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.oltu.oauth2</groupId>
                <artifactId>org.apache.oltu.oauth2.client</artifactId>
                <version>${oauth2.version}</version>
            </dependency>
    
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>http-client-spi</artifactId>
                <version>${amazon.awssdk.crt.client.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk.crt</groupId>
                <artifactId>aws-crt</artifactId>
                <version>${software.amazon.awssdk.crt.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>aws-crt-client</artifactId>
                <version>${software.amazon.awssdk.version}</version>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>sdk-core</artifactId>
                <version>${sdk.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
                <optional>true</optional>
            </dependency>
        </dependencies>
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>de.codecentric</groupId>
                    <artifactId>spring-boot-admin-dependencies</artifactId>
                    <version>${spring-boot-admin.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <build>
            <sourceDirectory>src/main/java</sourceDirectory>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    </project>

application.properties 条目以防止配置mvc

spring.main.web-application-type=reactive

相关问题