gpt4 book ai didi

启动 Spring Boot 2.1.1 和 Java 11 应用程序时出现 java.lang.InknownClassChangeError

转载 作者:行者123 更新时间:2023-12-02 05:10:13 25 4
gpt4 key购买 nike

我在 jdk-11.0.6 上启动 spring-boot 2.1.1.RELEASE 应用程序时遇到 java.lang.InknownClassChangeError > 为了从 1.5.3Java 8 迁移现有的 spring-boot 应用程序。

除了这些设置之外,我还使用 2.1.1.RELEASE 覆盖 spring-boot-starter 依赖项的版本,以防止不兼容的库问题。除了 Java 11 之外,我还在同一项目中使用 groovy 3.0.0-alpha-4

您可以在下面找到详细的堆栈跟踪:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pathMappedEndpoints' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints]: Factory method 'pathMappedEndpoints' threw exception; nested exception is java.lang.IncompatibleClassChangeError: Method org.springframework.boot.actuate.endpoint.web.PathMapper.__AW_getRootPath(Ljava/util/List;Lorg/springframework/boot/actuate/endpoint/EndpointId;)Ljava/lang/String; must be InterfaceMethodref c
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
at org.springframework.beans.factory.support.ConstructorResolver.__AW_instantiateUsingFactoryMethod(ConstructorResolver.java:607)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.__AW_createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.__AW_doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.__AW_createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.__AW_getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java)
at org.springframework.beans.factory.support.AbstractBeanFactory.__AW_doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.__AW_preInstantiateSingletons(DefaultListableBeanFactory.java:846)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java)
at org.springframework.context.support.AbstractApplicationContext.__AW_finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.__AW_run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java)
at com.demo.api.Application.__AW_main(Application.java:22)
at com.demo.api.Application.main(Application.java)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.__AW_main(JarLauncher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints]: Factory method 'pathMappedEndpoints' threw exception; nested exception is java.lang.IncompatibleClassChangeError: Method org.springframework.boot.actuate.endpoint.web.PathMapper.__AW_getRootPath(Ljava/util/List;Lorg/springframework/boot/actuate/endpoint/EndpointId;)Ljava/lang/String; must be InterfaceMethodref c
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.__AW_instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
... 36 common frames omitted
Caused by: java.lang.IncompatibleClassChangeError: Method org.springframework.boot.actuate.endpoint.web.PathMapper.__AW_getRootPath(Ljava/util/List;Lorg/springframework/boot/actuate/endpoint/EndpointId;)Ljava/lang/String; must be InterfaceMethodref c
at org.springframework.boot.actuate.endpoint.web.PathMapper.getRootPath(PathMapper.java)
at org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer.createEndpoint(ServletEndpointDiscoverer.java:71)
at org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer.createEndpoint(ServletEndpointDiscoverer.java:42)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.getFilterEndpoint(EndpointDiscoverer.java:328)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.isFilterMatch(EndpointDiscoverer.java:302)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.isEndpointExposed(EndpointDiscoverer.java:270)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.convertToEndpoints(EndpointDiscoverer.java:189)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.discoverEndpoints(EndpointDiscoverer.java:127)
at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.getEndpoints(EndpointDiscoverer.java:119)
at org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints.lambda$getEndpoints$1(PathMappedEndpoints.java:70)
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608)
at org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints.getEndpoints(PathMappedEndpoints.java:69)
at org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints.<init>(PathMappedEndpoints.java:63)
at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration.pathMappedEndpoints(WebEndpointAutoConfiguration.java:123)
at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$7e6a4261.CGLIB$pathMappedEndpoints$1(<generated>)
at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$7e6a4261$$FastClassBySpringCGLIB$$9430a0e5.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$7e6a4261.pathMappedEndpoints(<generated>)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.__AW_instantiate(SimpleInstantiationStrategy.java:154)
... 38 common frames omitted

最佳答案

__AW_ 前缀方法建议您使用 ApsectWerkzAspectJ 。由于错误发生在看起来像自动生成的方法中,很可能您使用的版本与 Java 11 不兼容。

您可能应该首先将 Groovy 3.0.0-alpha-4 升级到 3.0.1 ,在调试代码生成问题时,使用不稳定库并不是一个好主意。

关于启动 Spring Boot 2.1.1 和 Java 11 应用程序时出现 java.lang.InknownClassChangeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60337522/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com