2014-10-30 41 views
2

我已在Windows 8.1創建服務的GlassFish

開始glassfishs服務一個問題,我得到這個錯誤:

c:\glassfishv3\bin>asadmin create-service

Found the Windows Service and successfully uninstalled it. 
WMI.WmiException: AccessDenied 
    at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result) 
    at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] 
args) 
    at WMI.Win32ServicesProxy.Create(String , String , String , ServiceType , Err 
orControl , StartMode , Boolean , String[]) 
    at winsw.WrapperService.Run(String[] args) 
    at winsw.WrapperService.Main(String[] args) 
Error while trying to install GlassFish as a Windows Service. 
The return value was: 2. 
STDERR: 
STDOUT: WMI.WmiException: AccessDenied 
    at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result) 
    at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] 
args) 
    at WMI.Win32ServicesProxy.Create(String , String , String , ServiceType , Err 
orControl , StartMode , Boolean , String[]) 
    at winsw.WrapperService.Run(String[] args) 
    at winsw.WrapperService.Main(String[] args) 

Usage: asadmin [asadmin-utility-options] create-service [--name <name>] 
     [--serviceproperties <serviceproperties>] 
     [--dry-run[=<dry-run(default:false)>]] [--domaindir <domaindir>] 
     [-?|--help[=<help(default:false)>]] [domain_name] 
Command create-service failed. 

用戶帳戶是管理員。

我不知道該怎麼辦,你能否給我一個推薦來解決這個錯誤。

回答

1

您的帳戶可能是管理員,但您是否啓動了cmd/shell「以管理員身份」?好的舊窗戶UAC。

我有這個問題,不得不右擊CMD.EXE /命令提示符,然後選擇「以管理員身份運行」

然後運行:asadmin的創建服務--name「Glassfish的YourDomainName」 YourDomainName