Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot &引用;BeanDefinitionStoreException:无法处理配置类“的导入候选项”;将JHipster单片应用程序部署到Heroku时_Spring Boot_Kotlin_Heroku_Jhipster - Fatal编程技术网

Spring boot &引用;BeanDefinitionStoreException:无法处理配置类“的导入候选项”;将JHipster单片应用程序部署到Heroku时

Spring boot &引用;BeanDefinitionStoreException:无法处理配置类“的导入候选项”;将JHipster单片应用程序部署到Heroku时,spring-boot,kotlin,heroku,jhipster,Spring Boot,Kotlin,Heroku,Jhipster,我以前从未部署过任何类型的JVM web应用程序,所以我真的不知道发生了什么。从Heroku日志中,错误如下所示: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [tld.domain.webapp.FinancialServicesStationApp]; nested exception is

我以前从未部署过任何类型的JVM web应用程序,所以我真的不知道发生了什么。从Heroku日志中,错误如下所示:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [tld.domain.webapp.FinancialServicesStationApp]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration**
我使用MariaDB作为我的数据库,Gradle用于构建,后端是用kotlin编写的。我使用这个选项在我自己的机器上编译源代码,我认为这应该是可行的,因为我可以在开发模式下运行这个站点。是否有人知道是什么原因导致此错误,以及我如何修复它

这是完整的JHipster日志:

2020-11-04T01:52:33.805989+00:00 app[web.1]: 2020-11-04 01:52:33.801  INFO 4 --- [           main] .f.FinancialServicesStationApp$Companion : The following profiles are active: prod,heroku
2020-11-04T01:52:35.007983+00:00 app[web.1]: 2020-11-04 01:52:35.007  WARN 4 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [tld.domain.webapp.FinancialServicesStationApp]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration
2020-11-04T01:52:35.025845+00:00 app[web.1]: 2020-11-04 01:52:35.025 ERROR 4 --- [           main] o.s.boot.SpringApplication               : Application run failed
2020-11-04T01:52:35.025847+00:00 app[web.1]: 
2020-11-04T01:52:35.025849+00:00 app[web.1]: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [tld.domain.webapp.FinancialServicesStationApp]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration
2020-11-04T01:52:35.025850+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:609)
2020-11-04T01:52:35.025851+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.access$800(ConfigurationClassParser.java:110)
2020-11-04T01:52:35.025852+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:811)
2020-11-04T01:52:35.025853+00:00 app[web.1]: at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2020-11-04T01:52:35.025854+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:808)
2020-11-04T01:52:35.025854+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:779)
2020-11-04T01:52:35.025856+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:192)
2020-11-04T01:52:35.025856+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:319)
2020-11-04T01:52:35.025857+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236)
2020-11-04T01:52:35.025857+00:00 app[web.1]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
2020-11-04T01:52:35.025858+00:00 app[web.1]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
2020-11-04T01:52:35.025858+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
2020-11-04T01:52:35.025859+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
2020-11-04T01:52:35.025859+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
2020-11-04T01:52:35.025860+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
2020-11-04T01:52:35.025861+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
2020-11-04T01:52:35.025862+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
2020-11-04T01:52:35.025863+00:00 app[web.1]: at tld.domain.webapp.FinancialServicesStationApp$Companion.main(FinancialServicesStationApp.kt:105)
2020-11-04T01:52:35.025863+00:00 app[web.1]: at tld.domain.webapp.FinancialServicesStationApp.main(FinancialServicesStationApp.kt)
2020-11-04T01:52:35.025863+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2020-11-04T01:52:35.025864+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2020-11-04T01:52:35.025864+00:00 app[web.1]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2020-11-04T01:52:35.025865+00:00 app[web.1]: at java.base/java.lang.reflect.Method.invoke(Method.java:564)
2020-11-04T01:52:35.025865+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
2020-11-04T01:52:35.025866+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
2020-11-04T01:52:35.025866+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
2020-11-04T01:52:35.025866+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
2020-11-04T01:52:35.025867+00:00 app[web.1]: Caused by: java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration
2020-11-04T01:52:35.025867+00:00 app[web.1]: at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60)
2020-11-04T01:52:35.025868+00:00 app[web.1]: at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
2020-11-04T01:52:35.025868+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:225)
2020-11-04T01:52:35.025877+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processMemberClasses(ConfigurationClassParser.java:371)
2020-11-04T01:52:35.025878+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:271)
2020-11-04T01:52:35.025878+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:249)
2020-11-04T01:52:35.025879+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:599)
2020-11-04T01:52:35.025879+00:00 app[web.1]: ... 26 common frames omitted
2020-11-04T01:52:35.025880+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'JDBC_DATABASE_URL' in value "${JDBC_DATABASE_URL}"
2020-11-04T01:52:35.025880+00:00 app[web.1]: at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:178)
2020-11-04T01:52:35.025880+00:00 app[web.1]: at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)
2020-11-04T01:52:35.025881+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236)
2020-11-04T01:52:35.025881+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
2020-11-04T01:52:35.025882+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:227)
2020-11-04T01:52:35.025882+00:00 app[web.1]: at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:88)
2020-11-04T01:52:35.025883+00:00 app[web.1]: at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
2020-11-04T01:52:35.025883+00:00 app[web.1]: at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:535)
2020-11-04T01:52:35.025884+00:00 app[web.1]: at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseCondition.getMatchOutcome(DataSourceAutoConfiguration.java:126)
2020-11-04T01:52:35.025884+00:00 app[web.1]: at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
2020-11-04T01:52:35.025884+00:00 app[web.1]: ... 32 common frames omitted
2020-11-04T01:52:35.025885+00:00 app[web.1]: 
2020-11-04T01:52:35.104335+00:00 heroku[web.1]: Process exited with status 1
2020-11-04T01:52:35.142760+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-04T01:55:15.000000+00:00 app[api]: Build failed -- check your build output:

错误的重要部分是:

 Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'JDBC_DATABASE_URL' in value "${JDBC_DATABASE_URL}"
Heroku部署无法将数据库属性注入应用程序上下文,因此无法启动

所以,可能您没有订阅jawsdb附加组件,或者您没有注册付款方式。在stackoverflow上几乎没有类似的问题

我假设您使用jhipster heroku部署,如文档中所述: