我有一个在嵌入式tomcat上运行良好的spring boot 2.0应用程序,现在我在build.gradle文件中使用apply plugin: 'war'
从这个applcation生成了一个war,在websphere 9上生成并成功部署了war。我尝试点击上下文根,它正确地给了index.html ...但是当试图到达嵌入式tomcat上最初到达的任何路径时,它给出Error 404: java.io.FileNotFoundException: SRVE0190E: File not found: /path/mapped/in/controller
...任何人都可以告诉你缺少什么?
这是SpringBootApplication类代码:
@SpringBootApplication
@MapperScan(basePackages = { "com.mypack.dao" })
public class MyApplication extends SpringBootServletInitializer{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MyApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
}