gpt4 book ai didi

使用tomcat启动spring boot应用程序时出现java.lang.VerifyError

转载 作者:行者123 更新时间:2023-12-05 06:11:43 24 4
gpt4 key购买 nike

ERROR [org.springframework.web.context.ContextLoader:313] - Context initialization failed
java.lang.VerifyError: (class: org/springframework/core/type/StandardAnnotationMetadata, method: getAnnotationTypes signature: ()Ljava/util/Set;) Illegal type in constant pool
at org.springframework.core.type.AnnotationMetadata.introspect(AnnotationMetadata.java:127)
at org.springframework.context.annotation.ConfigurationClassUtils.dt_133_checkConfigurationClassCandidate_98(ConfigurationClassUtils.java)
at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:108)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:276)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:629)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1839)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)

这发生在一个部署环境中,而它在其他 VM 上运行良好。两个 VM 具有相同版本的 JDK、tomcat 和 spring 版本。

我找不到发生这种情况的任何原因。可能是什么问题?

最佳答案

所以在我的例子中,罪魁祸首是 Dynatrace。在运行时,Dynatrace 在类文件中执行一些检测,以监控修改 java 类字节码的性能。现在,如果 dynatrace 版本与安装的 runtime JDK 不兼容,我们最终可能会看到如下问题:

warning [native] Error during parsing of java bytecode: Java classes with "invokedynamic" are not supported, skipping class transformation (class java/time/Instant) 

ERROR [org.springframework.web.context.ContextLoader:313] - Context initialization failed
java.lang.VerifyError: (class: org/springframework/core/type/StandardAnnotationMetadata, method: getAnnotationTypes signature: ()Ljava/util/Set;) Illegal type in constant pool
at

禁用 Dynatrace 并重新安装应用程序和 JDK 后,一切正常。这是此类场景中可以观察到的问题之一。

关于使用tomcat启动spring boot应用程序时出现java.lang.VerifyError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63859669/

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