Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.ClassCastException: class com.sendemail.sendsemail.service.MailServiceImpl cannot be cast to class com.sendemail.sendsemail.service.MailService (com.sendemail.sendsemail.service.MailServiceImpl and com.sendemail.sendsemail.service.MailService are in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @1132972)
at com.sendemail.sendsemail.SendsemailApplication.main(SendsemailApplication.java:23)
... 5 more
发布于 2022-04-14 05:24:47
java.lang.ClassCastException: class <Class_Name> cannot be cast to class <Class_Name> (<Class_Name> is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader <Class_Name> is in unnamed module of loader 'app')
--这与spring工具包有关。如果不需要,请尝试删除包。
https://stackoverflow.com/questions/71866736
复制相似问题