1

在 JBoss EAP 5.1 上,我无法停止容器。当我执行 container.stop 时,端口状态是这样的:

 TCP    127.0.0.1:2927         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2928         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2929         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2930         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2931         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2932         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2933         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2934         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2935         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2936         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2937         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2938         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2939         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2940         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2941         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2942         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2943         127.0.0.1:8080         TIME_WAIT
 TCP    127.0.0.1:2944         127.0.0.1:8080         TIME_WAIT

并有以下例外:

Caused by: org.codehaus.cargo.container.ContainerException: Server port 8080 did not shutdown within the timeout period [120000]
    at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForPortShutdown(AbstractLocalContainer.java:390)
    at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForPortShutdown(AbstractLocalContainer.java:301)
    at org.codehaus.cargo.container.jboss.internal.AbstractJBossInstalledLocalContainer.waitForCompletion(AbstractJBossInstalledLocalContainer.java:154)
    at org.codehaus.cargo.container.spi.AbstractLocalContainer.stop(AbstractLocalContainer.java:214)
    ... 33 more
org.codehaus.cargo.container.ContainerException: Server port 8080 did not shutdown within the timeout period [120000]
    at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForPortShutdown(AbstractLocalContainer.java:390)
    at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForPortShutdown(AbstractLocalContainer.java:301)
    at org.codehaus.cargo.container.jboss.internal.AbstractJBossInstalledLocalContainer.waitForCompletion(AbstractJBossInstalledLocalContainer.java:154)
    at org.codehaus.cargo.container.spi.AbstractLocalContainer.stop(AbstractLocalContainer.java:214)
    at jp.co.nri.kinshasa.util.server.JBossServerImpl.stopContainer(JBossServerImpl.java:151)

我的代码就像我使用 JBoss51xInstalledLocalContainer:

    private void prepareJBoss() {
        ConfigurationFactory configurationFactory = new DefaultConfigurationFactory();

        localConfiguration = (StandaloneLocalConfiguration) configurationFactory
                .createConfiguration("jboss51x", ContainerType.INSTALLED,
                        ConfigurationType.STANDALONE, WORK_HOME);

        localConfiguration.setProperty(JBossPropertySet.JBOSS_USER, "admin");
        localConfiguration
                .setProperty(JBossPropertySet.JBOSS_PASSWORD, "admin");
        localConfiguration.setProperty(GeneralPropertySet.JVMARGS,
                "-Xms512m -Xmx512m");
    }


    private void startContainer() {
        container = new JBoss51xInstalledLocalContainer(localConfiguration);
        container.setHome(JBOSS_HOME);
        container.setExtraClasspath(new String[] {
                PROJECT_PATH + "/target/external/kss/apl_conf",
                PROJECT_PATH + "/target/external/kss/kiban_conf" });
        container.start();

    }
4

1 回答 1

0

如果你关机,你需要让你的环境正确。

您用于shutdown --server=localhost:1099 --user=admin --password=admin关闭服务器。

但是在您的环境中,您忘记输入管理员用户/conf/props/jmx-console-users.properties

于 2014-11-28T14:33:31.320 回答