Add the springboot jar package to the problem encountered and windows services and Solutions

Set windows service

Jar package on how to set this part of the service windows in this blog are written in great detail, and not repeat them here

Configured to problems encountered in the course of a windows service

After you configure the log for error information: see the log error message is:% 1 is not a valid Win32 application

The actual decompression package after downloading Procrun in itself is divided into 64 to 32 points, when used to select the corresponding version

H2 database permissions issue (issue strictly speaking, does not belong to this configuration services, should belong to the database using H2-related issues, but it does the investigation for a long time ...)

Phenomenon as follows:

  1. Normal configuration service can also be started, and normally open the application, but when the user logged in, but reported no problems (only this time to use the database, use the h2 database).
  2. Use java -jar starts correctly, and can be accessed user information.

Thinking
most is the thought of such a service could start debugging

  • Commissioning services
    run the service for the console mode, you need to use the // TS // parameter. Such as
rem 安装
"%SRV%" //TS//prun-yaojingcai-erp
echo 安装服务完成。

Debugging process no avail, guess rights issue h2 database files accessed by the user, because my profile in the initial configuration database is on h2

jdbc:h2:file:~/.h2/data-migration-new;AUTO_SERVER=TRUE

The windows below, the default is generated in the current user folder below. With java -jar if the current user is accessing your own user folder following question is certainly not a problem, but if you add windows system service, whether it is because the problem of access can not access it?
Thus attempts to modify the database files to the opposing jar h2 upper application data folder below, as follows:

jdbc:h2:file:./data/data-migration-new;AUTO_SERVER=TRUE

Sure enough, after modification, the service can also be a normal operation.

Guess you like

Origin www.cnblogs.com/falcon-fei/p/11680782.html