ฉันยังใหม่กับ Spring-boot และพยายามเข้ารหัสรหัสผ่านในไฟล์ application.properties โดยใช้ไลบรารี jasypt ฉันใช้ @EnableEncryptableProperties กับ @SpringBootApplication และได้รับข้อผิดพลาด ไม่รู้ว่าจะแก้ไขได้อย่างไร ต่อไปนี้เป็นการพึ่งพาที่ใช้ใน pom.xml ของฉัน ฉันใช้ JDK 7 เพื่อสร้างแอปพลิเคชันนี้ หากคุณรู้จักกรอบงานอื่นใดในการเข้ารหัสรหัสผ่านในคุณสมบัติ ก็ยินดีเป็นอย่างยิ่ง
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot</artifactId>
<version>1.2</version>
</dependency>
ชั้นเรียนหลักของฉันคือ:
@SpringBootApplication
@EnableSwagger2
@EnableJSONDoc
@EnableAsync
@EnableEncryptableProperties
public class App extends SpringBootServletInitializer{
...
}
และฉันได้รับข้อยกเว้นดังต่อไปนี้:
java.lang.UnsupportedClassVersionError: com/ulisesbocchio/jasyptspringboot/annotation/EnableEncryptableProperties : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:432)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:238)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:117)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3271)
at java.lang.Class.getDeclaredAnnotations(Class.java:3248)