2
我能重启JBoss AS 7.2.0最终使用JBoss CLI使用以下命令:重启JBoss为7编程
jboss-cli.bat --connect --controller=IP:9999 --command=:shutdown(restart=true)
现在我需要从一个Java类编程做到这一点,我已经尝试使用Jboss cli API,在我的代码之后,但它只执行一个shutdonw并且不会重新启动!
CommandContext ctx = null;
try {
ctx = org.jboss.as.cli.CommandContextFactory.getInstance().newCommandContext();
ctx.connectController(IP, 9999);
ctx.handle(":shutdown(restart=true)");
} catch (CommandLineException e) {
System.out.println(e.getMessage());
}
有什么想法吗?
谢谢,它也适用于我。为了更精确,我认为JBoss AS 7.2.0.Final相当于EAP 6.1.0.Alpha1。 – callafa 2014-08-29 08:17:09