Home  >  Forum  >  Spring
Post New Query

class file for java.lang.annotation.Repeatable not found


joined on
August 11,2014
Asked on May 16,2015
Hi I am creating spring application using @Value with @PropertySource and with java configuration.  I am using Spring 4, Java 7 with Tomcat 8. While gradle compiling I am getting warning.

org.springframework\spring-context\4.1.6.RELEASE\15f0b22bf89ed468badbc4eec759af2b916d33e4\spring-context-4.1.6.
RELEASE.jar(org/springframework/context/annotation/PropertySource.class): warnin
g: Cannot find annotation method 'value()' in type 'Repeatable': class file for
java.lang.annotation.Repeatable not found
1 warning


And starting tomcat server getting error log as follows

15:50:26.309 [localhost-startStop-1] DEBUG o.s.c.t.c.AnnotationAttributesReadingVisitor - Failed to class-load type while reading annotation metadata. This is a non-fatal error, but certain annotation metadata may be unavailable.
java.lang.ClassNotFoundException: java.lang.annotation.Repeatable
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320) ~[catalina.jar:8.0.12]
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173) ~[catalina.jar:8.0.12]
at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(RecursiveAnnotationAttributesVisitor.java:47) ~[RecursiveAnnotationAttributesVisitor.class:4.1.6.RELEASE]
at org.springframework.asm.ClassReader.readAnnotationValues(ClassReader.java:1802) [ClassReader.class:4.1.6.RELEASE]
at org.springframework.asm.ClassReader.accept(ClassReader.java:642) [ClassReader.class:4.1.6.RELEASE]
at org.springframework.asm.ClassReader.accept(ClassReader.java:508) [ClassReader.class:4.1.6.RELEASE]
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:64) [SimpleMetadataReader.class:4.1.6.RELEASE]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:98) [SimpleMetadataReaderFactory.class:4.1.6.RELEASE]


joined on
October 10,2013
Replied on May 16,2015

java.lang.annotation.Repeatable has been introduced in Java 8 which is used by Spring 4. As you are using Java 7,  so this warning. If you do not want to see this warning, use Java 8.
joined on
August 11,2014
Replied on May 16,2015

Got it thanks.

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us