【发布时间】:2016-10-27 07:11:10
【问题描述】:
我按照https://spring.io/blog/2014/03/07/deploying-spring-boot-applications 上的说明将 Spring Boot 应用程序部署到 WebSphere Liberty 配置文件。
但是,它不起作用。当我在浏览器中点击 URL 时,我收到 Context Root Not Found 错误消息。
在日志文件中,我实际上可以看到 Spring Boot 正在启动,但似乎无法到达入口点。
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.1.RELEASE)
18:01:11.507 [Default Executor-thread-131] INFO us.com.xxx.Application - Starting Application on mylaptop with PID 75199 (/opt/IBM/WebSphere/Liberty/usr/servers/defaultServer/apps/expanded/mywar.war/WEB-INF/classes started by root in /opt/IBM/WebSphere/Liberty/usr/servers/defaultServer)
18:01:11.512 [Default Executor-thread-131] DEBUG us.com.xxx.Application - Running with Spring Boot v1.4.1.RELEASE, Spring v4.3.3.RELEASE
18:01:11.513 [Default Executor-thread-131] INFO us.com.xxx.Application - No active profile set, falling back to default profiles: default
这是我的应用程序类:
@EnableSwagger2
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
}
我的 build.gradle 构建战争:
apply plugin: "war"
war {
baseName = "mywar"
version = "0.1"
}
apply plugin: "spring-boot"
providedRuntime "org.springframework.boot:spring-boot-starter-tomcat"
我在 Sprint Boot 应用程序中遗漏了什么?我需要在 Liberty server.xml 中启用任何功能吗?
【问题讨论】:
-
你找出问题所在了吗?
-
很遗憾没有。我决定再也不碰任何 WebSphere 产品了。
-
明智的决定:)
标签: java gradle spring-boot websphere-liberty