spring boot org.springframework.beans.factory.BeanCreationException: Could not autowire field:

后端 未结 2 653
青春惊慌失措
青春惊慌失措 2021-01-29 03:24

I\'m starting with spring-boot and i have some configuration problems. I cannot autowire some services. I get an BeanCreationException.

My Application class:

<
相关标签:
2条回答
  • 2021-01-29 04:00

    i just remove the Jersey dependency and only work with the native REST-api (RequestMapping) from spring. And it works. I think, spring-boot and jersey don't work good together.

    0 讨论(0)
  • 2021-01-29 04:02

    I remove the jersey dependency:

     <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-jersey</artifactId>
     </dependency>
    

    and then I added the sprint-boot-starter-web dependency

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题