spring-data-dynamodb启动时报ClassNotFoundException: org.springframework.data.querydsl.QuerydslUtils解决方法

程瑞
2023-12-01

Spring Boot集成DaynamoDB时无法正常启动,报错

Caused by: java.lang.ClassNotFoundException: org.springframework.data.querydsl.QuerydslUtils
	at java.net.URLClassLoader$1.run(URLClassLoader.java:372) ~[na:1.8.0_05]
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[na:1.8.0_05]
	at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_05]
	at java.net.URLClassLoader.findClass(URLClassLoader.java:360) ~[na:1.8.0_05]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_05]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.8.0_05]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_05]
	... 37 common frames omitted

原因是Spring Data与DaynamoDB版本不一致造成的。
spring-data-dynamodb 5.0.2 is based on spring-data 2.0 / Spring 5.
But spring-boot 1.5.6 comes with spring-data 1.

解决方法升级Spring Boot依赖或者将spring-data-dynamodb降为4.5.0。

 类似资料: