renren-cloud 自己创建的module启动失败

提问 3 847
whl
whl VIP2 2021-11-19
版本:renren-cloud 3.4.0 开发环境:IDEA
renren-cloud 能正常跑通,我新创建了一个自己的module,启动时报错 Failed to determine a suitable driver class *************************** 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 class Action: 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 (the profiles dev are currently active). Process finished with exit code 1
回帖
  • whl
    whl VIP2 (楼主)
    2021-11-19
    这个driver 应该在哪里配置,在nacos 已经配置了
    0 回复
  • whl
    whl VIP2 (楼主)
    2021-11-19
    server: port: 8091 servlet: context-path: /guacamole spring: application: name: guac-service-server #环境 dev|test|prod profiles: active: dev messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common cloud: nacos: discovery: metadata: management: context-path: ${server.servlet.context-path}/actuator server-addr: ${nacos-host:nacos-host}:${nacos-port:8848} #nacos的命名空间ID,默认是public namespace: ${nacos-namespace:} config: server-addr: ${spring.cloud.nacos.discovery.server-addr} namespace: ${spring.cloud.nacos.discovery.namespace} group: RENREN_CLOUD_GROUP file-extension: yaml #指定共享配置,且支持动态刷新 extension-configs: - data-id: datasource.yaml group: ${spring.cloud.nacos.config.group} refresh: true - data-id: common.yaml group: ${spring.cloud.nacos.config.group} refresh: true
    0 回复
  • whl
    whl VIP2 (楼主)
    2021-11-19
    问题已解决 pom.xml 加 <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> </dependency>
    0 回复