Spring Boot with Google Cloud Datastore API fails to run

流过昼夜 提交于 2019-12-05 16:10:24

Finally managed to fix it by excluding the servlet-api. Changed the pom.xml file as following

<dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>gcloud-java</artifactId>
        <version>0.2.1</version>
        <exclusions>
            <exclusion>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Did you create a WebMvcConfiguration class?

Try this:

@Configuration
public class MyMVCConfiguration extends WebMvcConfigurerAdapter {
    // Implements overrides methods.
}

And declare in your void main your configuration package:

@Configuration
@EnableAutoConfiguration
@ComponentScan({"com.yourpackegconfiguration"})
public class LauncherWebWS {
   public static void main(String[] args) {
       SpringApplication.run(LauncherWebWS.class, args);
   }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!