Spring Boot error: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

前端 未结 2 752
萌比男神i
萌比男神i 2021-01-21 02:41

I am trying to put the data into GemFire by using Spring Data GemFire.

I followed this link

@Region(\"stockdata\")
public class StockInfo {

    @Id 
          


        
相关标签:
2条回答
  • 2021-01-21 02:48

    To simplify your Pivotal GemFire configuration in your Spring Boot application, you might consider using (starting with the) Spring Boot for Pivotal GemFire (SBDG) project.

    SBDG builds on Spring Data for Pivotal GemFire (SDG) along with other Spring projects, obviously Spring Boot, but also Spring Session for Pivotal GemFire (SSDG; here), as well. It applies all the concepts of Spring Boot (e.g. opinionated, "convention over configuration" using auto-configuration, etc) when developing Pivotal GemFire applications with Spring in general, and Spring Boot in particular.

    For instance, in your application, SBDG would automatically auto-configure SD[G] Repositories, making the explicit declaration of @EnableGemfireRepositories unnecessary.

    There are many other benefits to using SBDG, too.

    Food for thought.

    0 讨论(0)
  • 2021-01-21 03:13

    You need to add @SpringBootApplication to your main class.

    @EnableGemfireRepositories
    @SpringBootApplication
    public class Application implements CommandLineRunner {
    

    and in your pom add spring-boot-starter-web dependency instead of spring-web

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