We want to use DCOM to control the Windows slaves/nodes because we'd like to fully automate the slave provisioning process and just point Jenkins to a slave and have it connect without having to manually log and in and do the JNLP thing.
Connecting to computer.example.com
Checking if Java exists
java -version returned 1.8.0.
Copying jenkins-slave.xml
Copying slave.jar
Starting the service
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy148.start(Unknown Source)
at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:334)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:253)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor82593.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.kohsuke.jinterop.JInteropInvocationHandler.invoke(JInteropInvocationHandler.java:140)
... 8 more
Caused by: org.jinterop.dcom.common.JIException: Service Already Running
at org.jvnet.hudson.wmi.Win32Service$Implementation.start(Win32Service.java:149)
... 12 more
If I then RDP into the Windows machine and stop the service the master is subsequently able to start it. Is there a way to have the master attempt to stop the slave agent on Windows prior to attempting to start it? This would allow reboots of Windows slaves not to require manual intervention if they are restared for whatever reason (updates, etc).
Thanks,
Fred.