[英]Initialize Spring Boot on websphere 8.5.5.9
i'm trying to run a Spring boot application on Webpshere 8.5.5.9 我正在尝试在Webpshere 8.5.5.9上运行Spring启动应用程序
The code works fine if runned as java main on a embedded tomcat, but if i try to deploy on webpshere, the EAR starts with no error but no rest services are deployed. 如果在嵌入式tomcat上作为java main运行,代码工作正常,但如果我尝试在webpshere上部署,则EAR启动时没有错误,但没有部署其他服务。 I don't see in server console the SPRING BOOT LOG.
我没有在服务器控制台中看到SPRING BOOT LOG。 It's not started.
它没有开始。
If i make a get on server context path i reveive an hello world! 如果我进入服务器上下文路径,我会想到一个问候世界! (ear deployed successfully) but at the address of rest service i get a 404 (File not found)
(耳朵部署成功)但在休息服务的地址我得到404(找不到档案)
I used spring boot as BOM insted of parent because i already have a parent. 我使用spring boot作为父母的BOM,因为我已经有了父母。 My software stack is:
我的软件堆栈是:
Any suggestion? 有什么建议吗? Thanks
谢谢
START CLASS 开始课程
@SpringBootApplication
@Configuration
@EnableAutoConfiguration(exclude = {
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration.class})
public class ApplicationConfiguration extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
System.out.println("*** CONFIGURING ***");
return application.sources(ApplicationConfiguration.class);
}
public static void main(String[] args) {
//ApplicationContext ctx =
System.out.println("*** STARTING MAIN ***");
SpringApplication.run(ApplicationConfiguration.class, args);
//System.out.println(ctx);
}
}
CONTROLLER CONTROLLER
@RestController
public class ExampleController {
@GetMapping("/sayhello")
String home() {
return "Hello World! Test";
}
}
A WAR is packed in a EAR Important part of POM.xml of WAR is: WAR包含在EAR中WAR的POM.xml的重要部分是:
<packaging>war</packaging>
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-browser</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.9.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
</plugins>
</build>
{PROFILE}\\bin>managesdk.bat -enableProfile -profileName {PROFILE} -sdkname 1.7_64 -enableServers {PROFILE} \\ bin> managesdk.bat -enableProfile -profileName {PROFILE} -sdkname 1.7_64 -enableServers
This worked for me. 这对我有用。 Please try
请试试
Sujith Kasthoori Sujith Kasthoori
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.