我有一个spring引导应用程序,我正在尝试连接到RDS实例(MySQL)。这是我的应用程序
@SpringBootApplication
@EnableRdsInstance(databaseName="*****", dbInstanceIdentifier="****", username="****",password="******")
@EnableContextCredentials(accessKey="*****", secretKey="****")
@EnableContextRegion(region="****")
public class Application extends SpringBootServletInitializer{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
} 当我尝试mvn spring-boot:run时,
我得到以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dubba': Invocation of init method failed; nested exception is java.lang.IllegalStateException: No database type found for engine:'aurora'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at sample.traditional.config.Application.main(Application.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)发布于 2016-05-11 01:54:39
这是因为Aurora不是正式的框架(Spring Cloud for Amazon Web Services),即使它基本上是MySQL。
它是1.1.0版本的一部分,截至今天(2016年5月11日)在stable version。
Maven依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-jdbc</artifactId>
<version>1.1.0.RC2</version>
</dependency>当发布版本在Maven上可用时,只需将RC2替换为RELEASE。
https://stackoverflow.com/questions/36584218
复制相似问题