我正在創建一個新的角度用戶界面和一些將從角度用戶界面調用的Web服務。我使用spring引導和Spring工具套件創建了所有Web服務。我在括號上做了角度編碼。一切都很好。JBOSS EAP 6.2.4上的Spring Boot REST API部署
現在是將此代碼移至生產的時間。我們的生產環境是Jboss EAP 6.4。我使用了角碼,併成功地使它在Jboss服務器上運行。但我在使用RESTful Web服務時遇到問題。我轉換服務使用中的說明來創建一個WAR文件 - http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging
@RestController
@RequestMapping("/fusiontables/")
public class HeatMapUploadController {
@Autowired
private HeatMapService mapQueryJsonService;
@RequestMapping(value="/upload", method=RequestMethod.POST)
@ResponseBody
public String getBoundaries(HeatMapUploadCommand uploadCommand) {
System.out.println("Data is " + uploadCommand);
return mapQueryJsonService.getMapQueryJson(uploadCommand);
}
}
在我加入application.properties以下 server.servlet路徑=/*
這些都是我的Maven的依賴關係
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.13</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
但是,當我調用Web服務,我得到一個404,當我做行家包我沒有得到任何錯誤和STS如果我說服務器上運行,並選擇的Jboss EAP 6.2.4我沒有得到任何錯誤。我看到相同的問題也被其他一些人問到。
這是唯一的警告,我得到
19:56:47,462 WARN [org.jboss.as.ee] (MSC service thread 1-4) JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
19:56:47,463 WARN [org.jboss.as.ee] (MSC service thread 1-4) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
19:56:47,889 WARN [org.jboss.as.ee] (MSC service thread 1-1) JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
19:56:47,889 WARN [org.jboss.as.ee] (MSC service thread 1-1) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
19:56:52,391 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/chartis-services]] (ServerService Thread Pool -- 53) Initializing Spring embedded WebApplicationContext
19:56:52,392 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 53) Root WebApplicationContext: initialization completed in 2652 ms
19:56:53,003 INFO [org.springframework.boot.context.embedded.ServletRegistrationBean] (ServerService Thread Pool -- 53) Mapping servlet: 'dispatcherServlet' to [/]
19:56:53,004 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'errorPageFilter' to: [/*]
19:56:53,005 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'metricFilter' to: [/*]
19:56:53,005 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'characterEncodingFilter' to: [/*]
19:56:53,006 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
19:56:53,006 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'httpPutFormContentFilter' to: [/*]
19:56:53,006 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'requestContextFilter' to: [/*]
19:56:53,006 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'webRequestLoggingFilter' to: [/*]
19:56:53,006 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (ServerService Thread Pool -- 53) Mapping filter: 'applicationContextIdFilter' to: [/*]
19:56:53,210 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] (ServerService Thread Pool -- 53) Looking for @ControllerAdvice: org.springframework.boot[email protected]790420d7: startup date [Tue May 31 19:56:49 MST 2016]; root of context hierarchy
19:56:53,286 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 53) Mapped "{[/fusiontables/upload],methods=[POST]}" onto public java.lang.String com.amex.chartis.services.controller.HeatMapUploadController.getBoundaries(com.amex.chartis.services.command.HeatMapUploadCommand)
19:56:53,288 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 53) Mapped "{[/fusiontables/legend],methods=[POST]}" onto public java.lang.String com.amex.chartis.services.controller.HeatMapUploadController.getLegend(com.amex.chartis.services.command.HeatMapUploadCommand)
19:56:53,288 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 53) Mapped "{[/fusiontables/allzips],methods=[POST]}" onto public java.lang.String com.amex.chartis.services.controller.HeatMapUploadController.getAllZips(com.amex.chartis.services.command.HeatMapUploadCommand)
19:56:53,289 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 53) Mapped "{[/zip/byradius],methods=[POST]}" onto public java.lang.String com.amex.chartis.services.controller.ZipUploadController.getRadialDistance(com.amex.chartis.services.command.ZipUploadCommand)
19:56:53,295 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 53) Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
19:56:53,296 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 53) Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
您可以設置日誌記錄級別調試問題,所以我們可以得到更多的細節? –