JVM crash due to issue with Win32ole and Windows server 2012 #2611
JRuby JVM crashes when using win32ole/racob to change account a Windows Service shall use to run.
require "win32ole" user = ".\\Administrator" service_id = "tomcat7" locator = WIN32OLE.new('WbemScripting.SWbemLocator') wmi = locator.connectServer("./", "root\\cimv2", "", "") services = wmi.execQuery("SELECT * FROM Win32_Service WHERE Name='%s'" % [service_id]) services.each do |service| objInParam = service.methods_('Change').inParameters.spawnInstance_ objInParam.properties_.item('StartName').value = user result = service.execMethod_('Change', objInParam) puts result.returnValue end
The user executing the code snippet is the same user.
This leads to
OS is Windows Server 2012 R2 Standard (64-bit)
Is there any way to fix or workaround the issue? The same code snippet works as expect using Windows Server 2008 R2.
The text was updated successfully, but these errors were encountered: