spring boot 启动报错:Cannot determine embedded database driver class for database type NONE

错误原因:spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。

解决办法:第一种:在Application类上增加@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}),阻止spring boot自动注入dataSource bean

     第二种:增加数据库配置相关信息

springboot之freemarker:

创建springboot项目,在pom中添加了freemarker的jar包,

在controller层写好相关代码并且把信息传到指定的.ftl文件中,

在.ftl中把信息取出来

启动,运行正常!

原文地址:https://www.cnblogs.com/salycr/p/8412669.html

时间: 2024-08-29 11:46:19

spring boot 启动报错:Cannot determine embedded database driver class for database type NONE的相关文章

spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure

Spring Boot 启动报错:LoggingFailureAnalysisReporter

17:57:19: Executing task 'bootRun'... Parallel execution with configuration on demand is an incubating feature.:thinkvenus-common:compileJava:thinkvenus-tool:processResources UP-TO-DATE:thinkvenus-common:compileJava UP-TO-DATE:thinkvenus-common:proce

Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

使用命令 java -jar springBoot.jar  启动项目,结果报错如下: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37 at java.lang.String.substring(String.java:1963) at org.springframework.boot.loader.jar.JarFile.create

Spring boot 启动报错:com.mongodb.MongoSocketOpenException: Exception opening socket

详细错误信息: com.mongodb.MongoSocketOpenException: Exception opening socket at com.mongodb.connection.SocketStream.open(SocketStream.java:63) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnect

解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level

学习了:https://blog.csdn.net/yunfeng482/article/details/78106433 没想到啊:我都看见了,idea也反编不了: 没想到要重新下载啊: 原文地址:https://www.cnblogs.com/stono/p/9126417.html

spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE

最近在学习使用spring boot.使用maven创建好工程,只引用需要用到的spring boot相关的jar包,除此之外没有任何的配置. 写了一个最简单的例子,如下所示: 1 package com.torlight; 2 3 import org.springframework.boot.SpringApplication; 4 import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 import

报错Cannot determine embedded database driver class for database type NONE解决方法

由于我不需要数据库,启动springboot报错: Cannot determine embedded database driver class for database type NONE If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you ma

springboot启动时报错Cannot determine embedded database driver class for database type NONE解决办法

springboot启动报错如下图: 出错原因:springboot启动时会自动注入数据源及配置jpa 解决办法: 1,在pom文件中加h2引用 <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope></dependency> 2.在启动类上加上 @SpringBootAp

spring Ehcache启动报错的问题

之前找大牛给我写了个spring mvc使用缓存的项目例子但是自己结合项目的时候,在启动的时候就报错,一大片红加蓝,错误信息一大堆,在网上搜了很久也没有找到答案,两天后,我又把大牛请来了,用了一分钟解决了,他只让我在百度里搜了一下tried to access method net.sf.ehcache.CacheManager这个错误,点开第一个结果,就解决了 关于 java.lang.IllegalAccessError: tried to access method net.sf.ehca