【发布时间】:2020-07-22 06:30:05
【问题描述】:
我正在关注以下关于如何使用 Spring Boot 发送电子邮件的教程
https://www.technicalkeeda.com/spring-boot-tutorials/how-to-send-email-using-spring-boot
我在 Spring Boot 中实现了它,它工作正常。现在我正在尝试在我的 Visual Studio 代码项目中实现这一点。我按照教程中的说明做了。但是当我运行我无法理解且无法解决的项目时,我遇到了这个错误。
Exception in thread "main" java.lang.ClassCastException: class
MailServiceImpl cannot be cast to
class MailService (MailServiceImpl and MailService are in unnamed module of
loader 'app') at
Application.main(Application.java:28)
要查看我的 MailService 和 MailServiceImpl 类,请访问上述链接。请帮助!
【问题讨论】:
-
如何运行应用程序?
-
我的项目已经有一个 launch.json 文件。通过运行选项,然后单击启动按钮。如果我删除此电子邮件代码,我可以成功运行该项目。我认为错误与此无关。 @SimonMartinelli
-
你能在应用程序的第 28 行显示什么
-
请发布 MailServiceImpl
-
请出示您的 MailServiceImpl。
标签: java angular spring-boot