1

Need to install WSO2 API Manager as service on Windows (Have tried on Windows 7 and Windows Server 2012. The problem is the same).
Documantation: https://docs.wso2.com/display/AM210/Installing+as+a+Windows+Service
I am using yajsw. And when trying to run "runConsole.bat" for testing as it was said in the documatation I got such message/error:

D:\WSO2\yajsw-stable-12.08\yajsw-stable-12.08\bat>call setenv.bat 
"java" -Xmx30m -Djna_tmpdir="D:\WSO2\yajsw-stable-12.08\yajsw-stable-12.08\bat\/../tmp" -Djava.net.preferIPv4Stack=true -jar "D:\WSO2\yajsw-stable-12.08\yajsw-stable-12.08\bat\/../wrapper.jar" -c "D:\WSO2\yajsw-stable-12.08\yajsw-stable-12.08\bat\/../conf/wrapper.conf"       
YAJSW: yajsw-stable-12.08
OS   : Windows 7/6.1/x86
JVM  : Oracle Corporation/1.8.0_111/C:\Program Files (x86)\Java\jre_1.8.32bit/32
WARNING|wrapper|"WSO2 Carbon"|17-03-07 14:05:22|YAJSW: yajsw-stable-12.08
WARNING|wrapper|"WSO2 Carbon"|17-03-07 14:05:22|OS   : Windows 7/6.1/x86
WARNING|wrapper|"WSO2 Carbon"|17-03-07 14:05:22|JVM  : Oracle Corporation/1.8.0_111/C:\Program Files (x86)\Java\jre_1.8.32bit/32
system.env 67
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:22|started process with pid 5056
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:22|restart process due to default exit code rule
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:22|restart internal RUNNING
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:22|stopping process with pid/timeout 5056 45000
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:23|process exit code: 1
system.env 67
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:28|started process with pid 1360
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:28|restart process due to default exit code rule
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:28|restart internal RUNNING
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:28|stopping process with pid/timeout 1360 45000
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:29|process exit code: 1
system.env 67
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:34|started process with pid 1996
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:34|restart process due to default exit code rule
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:34|restart internal RUNNING
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:34|stopping process with pid/timeout 1996 45000
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:35|process exit code: 1
system.env 67
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:40|started process with pid 4952
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:40|restart process due to default exit code rule
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:40|restart internal RUNNING
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:40|stopping process with pid/timeout 4952 45000
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:41|process exit code: 1
system.env 67
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:46|started process with pid 1176
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:46|restart process due to default exit code rule
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:46|restart internal RUNNING
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:46|stopping process with pid/timeout 1176 45000
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:47|process exit code: 1
system.env 67
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:52|started process with pid 4772
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:52|too many restarts 
INFO|wrapper|"WSO2 Carbon"|17-03-07 14:05:52|Shutting down Wrapper 

CARBON_HOME - C:\wso2am-2.0.0
JAVA_HOME - C:\Program Files\Java\jdk1.8.0_91

Maksym
  • 2,650
  • 3
  • 32
  • 50
  • Can you include the output for when you execute runConsole.bat this out put looks like it is from setenv.bat? – jchaplin Mar 07 '17 at 13:24
  • It is output from "runConsole.bat" (call setenv.bat %wrapper_bat% -c %conf_file%). – Maksym Mar 07 '17 at 22:43
  • I guess it is a very similar question http://stackoverflow.com/questions/42418330/getting-wso2-iot-server-running-as-a-windows-service – Maksym Mar 07 '17 at 22:49
  • I am assuming based on documentation version that you are working on API Manager 1.10? What is your CARBON_HOME value? Attempting to reproduce and want to make sure I have settings as you do. – jchaplin Mar 07 '17 at 23:16
  • I am using wso2am-2.0.0. There is CARBON_HOME in the question now. Thank you for response. – Maksym Mar 08 '17 at 19:50

2 Answers2

2

It is the version of yajsw. I used 11.11 and it works with no issue. If I upgrade to use 12.08 I get the same result that you do. I will attempt to find out what the actual issue is but wanted to let you know how you could get it working. I will edit this post with any updates.

Joe

jchaplin
  • 211
  • 1
  • 4
  • 11
1

We use the NSSM (the Non-Sucking Service Manager) service wrapper for the WSO2 products. This works just perfectly for all products.

Just run the nssm.exe and point to the wso2server.bat file. See the NSSM documentation how easy it is.

nssm install <servicename>
Philipp
  • 4,645
  • 3
  • 47
  • 80