我已经完成了 java spring boot 应用程序的构建,现在我正在尝试将其部署到 VPS。一切正常,除了当我访问连接到数据库的网络应用程序的一部分时,我收到此错误
错误7379 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] 在路径 [] 的上下文中抛出异常 [处理程序调度失败;嵌套异常是 java.lang.ExceptionInInitializerError] 其根本原因
当我将数据库的连接 url 设置为 jdbc:mysql://"ip of server":3306/kuponi 时,出现此错误
当我将数据库的连接 URL 设置为 jdbc:mysql://localhost:3306/kuponi 时
尝试将这些依赖项添加到您的 pom.xml 文件中
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-ri</artifactId>
<version>2.3.3</version>
</dependency>