Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement a service service in SpringBoot Ja

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to implement a service service in SpringBoot Ja? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Linux server related work

Ensure that the target server has configured the Java runtime environment

# check the jar environment @ java-versionopenjdk version "1.8.0,222" OpenJDK Runtime Environment (build 1.8.0_222-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

Upload jar to the target machine

@ scp cloud-txlcn.jar root@192.168.2.101:/opt/cloud/txlcn

Establish a soft connection

@ ln-s / opt/cloud/txlcn/cloud-txlcn/jar / etc/init.d/cloud-txlcn# cloud-txcln service name

Configure service related information

# launch application @ service cloud-txlcn start/stop# configure boot service @ systemctl enable cloud-txlcn# restart application @ systemctl restart cloud-txlcn# restart server @ reboot# verify whether it works @ ps aux | grep cloud-txlcnroot 5914 29.1 17.9 2272304 181856 pts/1 Sl 22:41 0:32 / bin/java-Dsun.misc.URLClassPath.disableJarChecking=true-jar / opt/cloud/tm/txlcn-tm-5.0.2.RELEASE.jar problem

Failed to start using the service xxx start command.

@ service xxx start@ / etc/init.d/cloud-txlcn: / etc/init.d/cloud-txlcn: cannot execute binary file

The reason is that the jar package cannot be executed by itself.

Note: if true is not configured in pom.xml, the generated jar package cannot be executed on its own and can only be executed through java-jar xxx.jar. Or

Nohup java-Xms64m-Xmx256m-Xmn128m-Xss256k-jar sentinel-dashboard-1.6.3.jar logs/start.out 2 > & 1 &

Insufficient permissions to perform service cloud-txlcn start display

@ service xxx startenv: / etc/init.d/cloud-txlcn: insufficient permissions

This is the answer to the question about how to implement a service service in SpringBoot Ja. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report