java - Procrun fails to start the windows service -


i have small spring-boot based application i'm trying register windows service using procrun. unfortunately, procrun seems failing start application.

here's main class:

public class daemon {  public static void main(string[] args) throws ioexception {     if ("start".equals(args[0])) {         start(args);     } else if ("stop".equals(args[0])) {         stop(args);     } }  public static void start(string[] args) {     application.main(new string[0]); }  public static void stop(string[] args) {  } } 

here's installation bat:

set "current_dir=%cd%" set "application_service_home=%cd%" echo %application_service_home% set service_name=cmsapi set executable_name=%service_name%.exe set executable=%application_service_home%\%executable_name% set cg_start_class=com.castsoftware.analyser.daemon set cg_stop_class=%cg_start_class% set cg_path_to_jar_containing_service=%application_service_home%\..\..\cast-cmsapi.jar set cg_startup_type=auto set pr_classpath=%application_service_home%;%cg_path_to_jar_containing_service%  set cg_path_to_jvm="%java_home%\jre\bin\server\jvm.dll"  set execute_string= %executable% //is//%service_name% --startup %cg_startup_type% --startclass %cg_start_class% --stopclass %cg_stop_class% call %execute_string%  set execute_string= "%executable%" //us//%service_name% --startmode jvm --stopmode jvm --jvm %cg_path_to_jvm% call %execute_string%  set execute_string= "%executable%" //us//%service_name% --startmethod %cg_start_method% --stopmethod  %cg_stop_method% call %execute_string%  set execute_string= "%executable%" //rs//%service_name% call %execute_string%  echo service '%service_name%' has been installed. pause 

and here logs get:

[2016-04-25 10:02:36] [info]  [85088] commons daemon procrun (1.0.15.0 64-bit) started [2016-04-25 10:02:36] [info]  [85088] service cmsapi name  [2016-04-25 10:02:36] [info]  [85088] service 'cmsapi' installed [2016-04-25 10:02:36] [info]  [85088] commons daemon procrun finished [2016-04-25 10:02:37] [info]  [80396] commons daemon procrun (1.0.15.0 64-bit) started [2016-04-25 10:02:37] [info]  [80396] updating service... [2016-04-25 10:02:37] [warn]  [80396] failed obtain service description [2016-04-25 10:02:37] [info]  [80396] service 'cmsapi' updated [2016-04-25 10:02:37] [info]  [80396] update service finished. [2016-04-25 10:02:37] [info]  [80396] commons daemon procrun finished [2016-04-25 10:02:38] [info]  [70552] commons daemon procrun (1.0.15.0 64-bit) started [2016-04-25 10:02:38] [info]  [70552] updating service... [2016-04-25 10:02:38] [warn]  [70552] failed obtain service description [2016-04-25 10:02:38] [info]  [70552] service 'cmsapi' updated [2016-04-25 10:02:38] [info]  [70552] update service finished. [2016-04-25 10:02:38] [info]  [70552] commons daemon procrun finished [2016-04-25 10:02:38] [info]  [82616] commons daemon procrun (1.0.15.0 64-bit) started [2016-04-25 10:02:38] [info]  [82616] running 'cmsapi' service... [2016-04-25 10:02:38] [error] [82616] startservicectrldispatcher 'cmsapi' failed [2016-04-25 10:02:38] [error] [82616] service process not connect service controller. [2016-04-25 10:02:38] [error] [82616] commons daemon procrun failed exit value: 4 (failed run service) [2016-04-25 10:02:38] [error] [82616] service process not connect service controller. [2016-04-25 10:03:08] [info]  [ 8024] commons daemon procrun (1.0.15.0 64-bit) started [2016-04-25 10:03:08] [info]  [ 8024] running 'cmsapi' service... [2016-04-25 10:03:08] [info]  [85752] starting service... [2016-04-25 10:03:08] [error] [85440] findclass com/castsoftware/analyser/daemon failed [2016-04-25 10:03:08] [error] [85752] failed start java [2016-04-25 10:03:08] [error] [85752] servicestart returned 4 [2016-04-25 10:03:08] [info]  [ 8024] run service finished. [2016-04-25 10:03:08] [info]  [ 8024] commons daemon procrun finished 

so seems procrun cannot find main class, it's right there. i'm not sure i'm doing wrong @ point


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -