简体   繁体   中英

Hello. Ihave war packaging spring boot soap webservice, i deploy to tomcat but soapui request return error

I have one spring boot jar packaging helloworld soap web service and it works as jar project. But I need war file, i convert it to war packaging project and then deploy to tomcat, but when i test with soapui request return error. This is my test project link: https://drive.google.com/open?id=1ChKcOxeOGkFpGpjYUh3FabdUFFueRWCw

I want ask, if someone have spring boot soap web service that works correctly?

i use eclipse maven project, tomcat 8.5.23 and soapui, jdk 1.8

this is some part of error text : HTTP Status 404 – Not Found HTTP Status 404 – Not Found /codenotfound/ws/helloworld

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. 原始服务器找不到目标资源的当前表示,或者不愿意透露其存在。

Apache Tomcat/8.5.23

Add "SpringBootServletInitializer" as shown in following code to your main file. Because without SpringBootServletInitializer Tomcat will consider it as normal application it will not consider as Spring boot application

@SpringBootApplication

public class DemoApplication extends SpringBootServletInitializer{

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(DemoApplication .class);
}

public static void main(String[] args) {
    SpringApplication.run(DemoApplication .class, args);
}

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM