- Cloud-Native Applications in Java
- Ajay Mahajan Munish Kumar Gupta Shyam Sundar
- 261字
- 2021-06-24 19:07:16
Running the service
There are many ways to run the service.
Right-click on the project and select Run As | Maven build and configure the Run Configurations to execute the spring-boot:run target as follows:

On clicking Run, if the internet connection and configuration are fine, you will see the following console output:
[INFO] Building product 0.0.1-SNAPSHOT ... [INFO] Changes detected - recompiling the module! [INFO] Compiling 3 source files to C:Appswkneonproducttargetclasses ... :: Spring Boot :: (v1.4.3.RELEASE) 2016-10-28 13:41:16.714 INFO 2532 --- [ main] com.mycompany.product.ProductSpringApp : Starting ProductSpringApp on L-156025577 with PID 2532 (C:Appswkneonproducttargetclasses started by MAHAJAN in C:Appswkneonproduct) ... 2016-10-28 13:41:19.892 INFO 2532 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http) ... 2016-10-28 13:41:21.201 INFO 2532 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/product/{id}]}" onto com.mycompany.product.Product com.mycompany.product.ProductService.getProduct(int) 2016-10-28 13:41:21.202 INFO 2532 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/productIds]}" onto java.util.List<java.lang.Integer> com.mycompany.product.ProductService.getProductIds(int) ... ... 2016-10-28 13:41:21.915 INFO 2532 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http) 2016-10-28 13:41:21.922 INFO 2532 --- [ main] com.mycompany.product.ProductSpringApp : Started ProductSpringApp in 6.203 seconds (JVM running for 14.199)
Note the stages of the Maven execution:
- First, the Maven task compiles all the Java files. We have three simple Java classes as of now.
- The next step runs it as an application, where a Tomcat instance starts.
- Note the mapping of the URLs /product/ and /productIds to the Bean methods.
- Tomcat listens on port 8080 for service requests.
You can also run the service by just right-clicking the class that has the main method (ProductSpringApp) in Package Explorer and then selecting Run As | Java Application.
推薦閱讀
- 通信網(wǎng)圖論及應(yīng)用
- 邊緣計(jì)算原理與實(shí)踐
- 面向5G的蜂窩物聯(lián)網(wǎng)(CIoT)規(guī)劃設(shè)計(jì)及應(yīng)用
- Altium Designer 21常見問題解答500例
- 加權(quán)分?jǐn)?shù)傅里葉變換及其在通信系統(tǒng)中的應(yīng)用
- 半導(dǎo)體光電子學(xué)
- 無線定位系統(tǒng)
- 5G無線增強(qiáng)設(shè)計(jì)與國(guó)際標(biāo)準(zhǔn)
- 高速電路設(shè)計(jì)實(shí)踐
- 數(shù)字平板電視機(jī)維修筆記
- 嵌入式系統(tǒng)及其在無線通信中的應(yīng)用開發(fā)
- 雙色圖文詳解電感器及應(yīng)用電路
- 數(shù)據(jù)虛擬化:多源異構(gòu)數(shù)據(jù)集成之道
- 廈華/海爾新型彩色電視機(jī)速修圖解
- 5G產(chǎn)業(yè):新智能時(shí)代革命