注册

DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

文梓 2024/03/08 610 5

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:驱动版本8.1.2.141
【操作系统】:win10
【CPU】:
【问题描述】*:报错: name 'indexController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxlJobServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxlJobGroupDao' defined in URL [jar:file:/home/iaapp/zsh-pms/zsh-pms-cloud/newland-module-xxljob-biz/newland-module-xxljob-biz.jar!/BOOT-INF/classes!/com/xxl/job/admin/dao/XxlJobGroupDao.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
15:06:36.515 logback [main] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat]
15:06:36.543 logback [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
15:06:36.564 logback [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter -


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 dameng are currently active).,配置文件spring.datasource.url=jdbc:dm://localhost:5236
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=dm.jdbc.driver.DmDriver,本地可以正常启动,部署到其他服务器相同的配置就不行,其他服务器也能ping通数据库服务,pom文件:<project
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>newland</artifactId>
<groupId>com.newland.cloud</groupId>
<version>1.7.3-snapshot</version>
</parent>
<artifactId>newland-module-xxljob-biz</artifactId>
<packaging>jar</packaging>


<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.test.skip>true</maven.test.skip>

<netty-all.version>4.1.63.Final</netty-all.version>
<gson.version>2.9.0</gson.version>

<spring.version>5.3.20</spring.version>
<spring-boot.version>2.6.7</spring-boot.version>

<mybatis-spring-boot-starter.version>2.2.2</mybatis-spring-boot-starter.version>

<slf4j-api.version>1.7.36</slf4j-api.version>
<junit-jupiter.version>5.8.2</junit-jupiter.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>

<groovy.version>3.0.10</groovy.version>

<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>




org.springframework.boot
spring-boot-starter-parent
${spring-boot.version}
pom
import




org.springframework.cloud
spring-cloud-starter-bootstrap



org.springframework.boot
spring-boot-starter-web



org.springframework.boot
spring-boot-starter-test
test



org.springframework.boot
spring-boot-starter-freemarker



org.springframework.boot
spring-boot-starter-mail



org.springframework.boot
spring-boot-starter-actuator



org.mybatis.spring.boot
mybatis-spring-boot-starter
${mybatis-spring-boot-starter.version}



com.dameng
DmJdbcDriver18



com.xuxueli
xxl-job-core
2.3.1


com.github.ulisesbocchio
jasypt-spring-boot
3.0.3



${project.artifactId}


org.springframework.boot
spring-boot-maven-plugin
${spring-boot.version}



repackage






com.spotify
docker-maven-plugin
0.4.13


${project.artifactId}😒{project.version}
${project.basedir}


/
${project.build.directory}
**/*.properties
${project.build.finalName}.jar








oss</id


oss

</project>

回答 0
暂无回答
扫一扫
联系客服