- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试运行我的程序,我总是得到这个异常:
Caused by: org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath.
at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.getDriverClassName(DataSourceProperties.java:137)
at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration.dataSource(DataSourceAutoConfiguration.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 45 more
我正在通过 gradle 导入所有依赖项:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.7.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'flatify-backend-service'
version = '0.1.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'org.hibernate:hibernate-core:4.3.6.Final'
compile 'javax.servlet:javax.servlet-api:3.1.0'
compile 'org.javassist:javassist:3.15.0-GA'
compile 'mysql:mysql-connector-java:5.1.31'
compile 'commons-dbcp:commons-dbcp:1.4'
testCompile("junit:junit")
testCompile("org.springframework:spring-test")
}
task wrapper(type: Wrapper) {
gradleVersion = '2.5'
}
如您所见,我正在添加 mysql-connector,这不是应该将驱动程序类添加到我的项目中吗?我错过了什么吗?
我只添加到最后一个异常(exception),因为所有其他都是由这个引起的。如果您需要任何其他详细信息,请告诉我。
谢谢
我的配置类:
@Configuration
@EnableTransactionManagement
public class PersistenceJPAConfig {
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "at.flatify.persistance.entity" });
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
return em;
}
@Bean(destroyMethod = "close")
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://localhost:3306/flatify");
dataSource.setUsername("user");
dataSource.setPassword("password");
return dataSource;
}
@Bean
public PlatformTransactionManager transactionManager(EntityManagerFactory emf){
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(emf);
return transactionManager;
}
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){
return new PersistenceExceptionTranslationPostProcessor();
}
Properties additionalProperties() {
Properties properties = new Properties();
properties.setProperty("hibernate.hbm2ddl.auto", "create-drop");
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
return properties;
}
}
最佳答案
Spring boot 无法确定使用哪个驱动程序。您需要在某处指定以下属性:spring.datasource.driverClassName您还需要指定其他属性,请查看文档。
关于java - BeanCreationException : Cannot determine embedded database driver class for database type NONE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33709849/
ASIDE:是的,这可以被认为是一个主观问题,但我希望从回答的统计数据中得出结论。 有各种各样的计算设备。它们的物理尺寸、计算能力和电力各不相同。我想知道嵌入式开发人员认为什么是使系统“嵌入式”的决定
当我听到这个时,我总是想到移动设备。但为什么硬件“嵌入”在那里?整个设备不就是硬件吗?为什么个人电脑没有嵌入式硬件系统? 最佳答案 在当今世界,嵌入式仅指具有以下一项或多项特征的系统: 单一用途(即,
我想测试嵌入式 PowerBI 所以我下载了 the sample app能够发布 pbix 文件并嵌入它。 所以我创建了最简单的 PowerBI 文件,可以使用 Azure SQL 制作,使用 Di
我需要问几个关于词嵌入的问题......可能是基本的。 当我们转换一个词的 one-hot 向量时,例如 king [0 0 0 1 0]嵌入向量 E = [0.2, 0.4, 0.2, 0.2] .
我想知道如何将 CEF 添加到我的 Yocto 项目中。此时,我还没有对项目进行任何修改。它由我们的电路板制造商提供。该板有一个ARM 9。 最佳答案 直接在 CEF 论坛上问这个问题是个好主意,可能
实体是否可以访问其 Embedded 对象的 Embedded?例如: @Embeddable public class Address { @Embedded protected A
我有一个类似于这个的 Morphia 架构: @Entity class BlogEntry { @Embedded List comments } @Embedded class B
我的 pom.xml 中有以下插件配置: com.day.jcr.vault maven-vault-plugi
直到现在,我仍然对 Openembedded-core 和 meta-openembedded 中的食谱感到困惑。很多时候,很难将食谱放在正确的目录中。它们真的很相似,但在食谱的内容上似乎如此不同。
我正在尝试使用此处找到的 Tensorflow 运行单词教程的矢量表示: http://www.tensorflow.org/tutorials/word2vec/index.md 第一个脚本 wor
谁能帮我解释一下 power BI premium 和 power BI Embedded 之间的区别? 最佳答案 Power BI Embedded 容量(也称为 SKU)是 billed hour
我在执行一个 MongoDB 请求时遇到了一些麻烦。我在 Node.js 上下文中使用 MongoDB 3.2 和 Mongoose。这是文档: { _id: ObjectId('12345'),
Xcode 常规选项卡中的“嵌入式二进制文件”和构建阶段选项卡中的“嵌入式框架”有什么区别? General 选项卡中的“Linked Frameworks”和 Build Phrases 选项卡中的
我正在尝试执行 maven install在 pom 上,显示的结果是: Grave: SEC5054: Certificate has expired 此结果会在测试执行开始后立即出现。 我一直在搜
我正在研究 ppc32 和 ppc64 架构来为我的编译器实现一个新的后端,但是我对一个函数的序言有疑问,我已经阅读了几个关于 PowerPC 的 IBM 文档,但是我读到的关于堆栈的信息很少.一个程
我大部分时间都在使用 Atmel Studio 等工具和 IDE 开发微 Controller ,并抽象出幕后发生的事情。 假设在这种情况下,我们直接从闪存执行代码,这在嵌入式系统中可能是这种情况。
我刚刚发现我在(Cortex M0)上编写代码的ARM不支持未对齐的内存访问。 现在,在我的代码中,我使用了很多打包结构,并且从未收到任何警告或硬故障,所以当Cortex不允许不对齐访问时,Corte
我正在研究 Uboot bootstrap 。我有一些关于 Bootloader 的功能和它要处理的应用程序的基本问题: Q1:据我所知,引导加载程序用于将应用程序下载到内存中。在互联网上,我还发现引
我想了解基本的RISC架构。经过一些研发,我想使用MIPS架构。但是,我没有获得有关带有MIPS处理器的嵌入式开发板的良好信息。 如果有人可以提出好的董事会建议,将会有很大的帮助。 问候, 拉姆吉 最
考虑我们正在为裸机 MCU 编写固件,即没有操作系统。有人告诉我不可能(非法?)将参数传递给中断处理函数? 我无法准确理解为什么会这样?这有什么问题? 附注。是否可以在某些 RTOS-es、嵌入式 L
我是一名优秀的程序员,十分优秀!