我正在尝试在 Spring Boot 和 Spring Cloud 上构建一个示例应用程序。我已经在位于我桌面的config.properties属性文件中编写了我的数据库和休眠配置,我希望我的 Spring Boot 能够使用这个配置。我的项目有 3 个模块应用程序接口数据层服务层这是我在API的application.property文件中提到的代码spring.profiles.active=本机 spring.cloud.config.server.native.searchLocation=C:/Users/DEV/Desktop/configuration/config.properties并且DataLayer和ServiceLayer的属性文件为空但是当我运行 API 时,我收到以下错误***************************APPLICATION FAILED TO START***************************Description:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver classAction:Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).Process finished with exit code 1任何人都可以帮助我解决这个错误。提前致谢。
添加回答
举报
0/150
提交
取消