首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从1.5迁移到2.0后spring boot启动失败

从1.5迁移到2.0后spring boot启动失败
EN

Stack Overflow用户
提问于 2017-11-22 17:37:22
回答 2查看 3.6K关注 0票数 1

从1.5迁移到2.0后,我得到了以下错误。

代码语言:javascript
复制
***************************
APPLICATION FAILED TO START
***************************

Description:

Binding to target [Bindable@7178d811 type = org.springframework.boot.autoconfigure.web.ServerProperties, value = 'provided', annotations = array<Annotation>[[empty]]] failed:

    Property: server
    Value: 
    Origin: "server" from property source "class path resource [application.yml]"
    Reason: No converter found capable of converting from type [java.lang.String] to type [org.springframework.boot.autoconfigure.web.ServerProperties]

Action:

Update your application's configuration

在运行现有的Junit Test之后,我得到了如下错误:

代码语言:javascript
复制
java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)
    at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:107)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
    at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:44)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:242)
    at com.nmj.cloud.api.RestfulCommandServiceTest.setUp(RestfulCommandServiceTest.java:917)
。。。。
Caused by: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatServletWebServerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serverPropertiesWebServerFactoryCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.class]: Unsatisfied dependency expressed through method 'serverPropertiesWebServerFactoryCustomizer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties': prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server' to org.springframework.boot.autoconfigure.web.ServerProperties
。。。。
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatServletWebServerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serverPropertiesWebServerFactoryCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.class]: Unsatisfied dependency expressed through method 'serverPropertiesWebServerFactoryCustomizer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties': prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server' to org.springframework.boot.autoconfigure.web.ServerProperties
。。。。
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serverPropertiesWebServerFactoryCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.class]: Unsatisfied dependency expressed through method 'serverPropertiesWebServerFactoryCustomizer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties': prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server' to org.springframework.boot.autoconfigure.web.ServerProperties
。。。。
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties': prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server' to org.springframework.boot.autoconfigure.web.ServerProperties
。。。。
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server' to org.springframework.boot.autoconfigure.web.ServerProperties
。。。。
Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.springframework.boot.autoconfigure.web.ServerProperties]
。。。。

application.yml如下所示:~~

代码语言:javascript
复制
spring:
  resources:
    add-mappings: false
  mvc:
    throw-exception-if-no-handler-found: true
  autoconfigure.exclude:
    - org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
    - org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
    - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
    - org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
    - org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration
    - org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
    - org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
    - org.springframework.boot.autoconfigure.data.RedisRepositoriesAutoConfiguration
    - org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration

mock:
  id: 1314

authentication:
  jwt:
    publickey: /pubkey.pem

analyze:
  url: http://localhost:8000/analyze

server:
  error:
    path: /error
  restTemplate:
    connectTimeout: 2000
    readTimeout: 2000
代码语言:javascript
复制

我不知道如何更新应用程序的配置。有人能给我一些建议来解决这个问题吗?

EN

回答 2

Stack Overflow用户

发布于 2017-11-22 18:05:20

这是Spring Boot中的一个错误,请关注#10945以获取更新。

票数 3
EN

Stack Overflow用户

发布于 2021-06-18 18:12:09

有没有解决这个问题的办法?从SpringBoot 1.x升级到2.5后有相同的问题

代码语言:javascript
复制
implementation 'org.togglz:togglz-spring-boot-starter:2.9.7'
implementation 'org.togglz:togglz-console:2.9.7

启动应用程序时出错...

代码语言:javascript
复制
***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'togglz.features.getnextovertime' to    org.togglz.spring.boot.actuate.autoconfigure.TogglzProperties$FeatureSpec:

Reason: No converter found capable of converting from type [java.lang.String] to type [org.togglz.spring.boot.actuate.autoconfigure.TogglzProperties$FeatureSpec]

Action:

Update your application's configuration
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47431162

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档