spring-core-3.2.9.RELEASE.jar:

Due to use of @Nonnull in a method signature of a class parsed by springframework, when trying to run my application I get the following trace:

java.lang.RuntimeException: null at org.springframework.asm.MethodVisitor.visitTypeAnnotation(Unknown Source) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.asm.ClassReader.b(Unknown Source) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.asm.ClassReader.accept(Unknown Source) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.asm.ClassReader.accept(Unknown Source) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:64) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76) ~[spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:71) ~[spring-context-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:255) ~[spring-context-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:225) ~[spring-context-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630) ~[spring-context-3.2.9.RELEASE.jar:3.2.9.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461) ~[spring-context-3.2.9.RELEASE.jar:3.2.9.RELEASE] ...

This is exceedingly unhelpful .. why not specify the missing class in the RuntimeException message, or at least set the cause of the RuntimeException to the (presumed) underlying ClassNotFoundException ?

Comment From: jhoeller

Please note that this comes out of Spring's embedded ASM variant and is therefore not a proper part of the Spring codebase but rather a fork of https://gitlab.ow2.org/asm/asm/commits/master. In addition, you're encountering a very old version of ASM since you're using a very old version of Spring there (unsupported since the end of 2016!). Newer versions of ASM do not seem to contain such plain RuntimeException code anymore, so the problem should go away through a Spring Framework upgrade.