Closed
Description
Kedar Joshi opened SPR-17096 and commented
After upgrading to Spring 5.1 RC1 my application started failing with following exception -
Caused by: java.lang.UnsupportedOperationException
at org.springframework.asm.ClassVisitor.visitNestHostExperimental(ClassVisitor.java:156) ~[spring-core-5.1.0.RC1.jar:5.1.0.RC1]
at org.springframework.asm.ClassReader.accept(ClassReader.java:541) ~[spring-core-5.1.0.RC1.jar:5.1.0.RC1]
at org.springframework.asm.ClassReader.accept(ClassReader.java:391) ~[spring-core-5.1.0.RC1.jar:5.1.0.RC1]
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:65) ~[spring-core-5.1.0.RC1.jar:5.1.0.RC1]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-5.1.0.RC1.jar:5.1.0.RC1]
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:123) ~[spring-core-5.1.0.RC1.jar:5.1.0.RC1]
Turned out, this is happening when spring tries to process classes which have inner class themselves. e.g. in.workingtheory.Application class has an inner class FailureGeneration. Application will not start unless I remove this inner class altogether or remove class in.workingtheory.Application from class path scanning.
This is only reproducible on JDK 11 and Spring 5.1 RC1 but works fine on JDK 10.
Sample project for reproducing this issue is attached.
+Environment+
Oracle JDK 11 Build 23 (64 Bit)
Spring framework 5.1 RC1
Affects: 5.1 RC1
Attachments:
- Spring-5.1.zip (5.59 kB)
Issue Links:
- Upgrade to ASM 6.2 [SPR-16398] #20944 Upgrade to ASM 6.2
- LocalVariableTableParameterNameDiscoverer runs into UnsupportedOperationException in ClassVisitor.visitNestMemberExperimental() [SPR-17103] #21640 LocalVariableTableParameterNameDiscoverer runs into UnsupportedOperationException in ClassVisitor.visitNestMemberExperimental()
- Compatibility with JDK 11 [SPR-16391] #20937 Compatibility with JDK 11
Referenced from: commits e82efbc