windows将Java JRE安装为service fabric中的启动任务
我加了jre-8u121-windows-x64.exe
并做了一个install.cmd
start /B /WAIT jre-8u121-windows-x64.exe /s SPONSORS=0
在我的/PackageRoot/Code
文件夹中
补充说
<SetupEntryPoint>
<ExeHost>
<Program>install.cmd</Program>
<WorkingFolder>CodePackage</WorkingFolder>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048"/>
</ExeHost>
</SetupEntryPoint>
我的服务清单
将主体添加到应用程序清单
<Principals>
<Users>
<User Name="Admin">
<MemberOf>
<SystemGroup Name="Administrators" />
</MemberOf>
</User>
</Users>
并运行策略
<Policies>
<RunAsPolicy CodePackageRef="Code" UserRef="Admin" EntryPointType="All" />
</Policies>
但由于某些原因,没有安装JRE
当使用上面的CMD版本时,它不会失败,我也没有任何日志文件来说明原因
我还直接在程序和服务清单的Arguments元素中尝试了jre-8u121-windows-x64.exe /s
,它给出了一个问题,事件日志中的退出代码为1,但也没有关于失败原因的真实信息
SetupEntryPoint:ExeEntryPointDescription { Program = jre-8u121-windows-x64.exe, Arguments = /s /L d:/javainstall.log, WorkingFolder = Work, PeriodicIntervalInSeconds = 0 ConsoleRedirectionEnabled = true ConsoleRedirectionFileRetentionCount = 5 ConsoleRedirectionFileMaxSizeInKb = 2048 } terminated with exitcode 1. CodePackageIdentifier { ServicePackageId = S-Innovations.Elastic.ElasticApplicationType_App31:S-Innovations.Elastic.ElasticServicePkg, CodePackageName = Code }:131369814689037041
# 1 楼答案
我正在运行一个安装程序。在我的应用程序中,cmd文件以类似的方式运行,使用CodeBase而不是CodePackage运行良好。也许值得一试。见https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-deploy-existing-app
汉斯