使用Maven停止Jboss服务器时出错

时间:2012-10-04 13:23:13

标签: maven jboss pom.xml

我手动启动了Jboss Server 5.1.0.GA并使用以下pom.xml来停止。 下面给出的代码用于Maven 2.2.1

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>1.0.6</version>
  <configuration>
    <container>
      <timeout>400000</timeout>
      <containerId>jboss51x</containerId>
      <home>C:/jboss-5.1.0.GA-PaletteConfig-9.5.0.0</home>
    </container>
    <configuration>
      <type>existing</type>
      <home>C:/jboss-5.1.0.GA-PaletteConfig-9.5.0.0/server/default</home>
      <properties>
        <cargo.remote.username>admin</cargo.remote.username>
        <cargo.remote.password>admin</cargo.remote.password>
        <cargo.hostname>127.0.0.1</cargo.hostname>
        <cargo.rmi.port>1080</cargo.rmi.port>
      </properties>
    </configuration>
  </configuration>
  <executions>
    <execution>
      <id>stop-container</id>
      <phase>install</phase>
      <goals>
        <goal>stop</goal>
      </goals>
    </execution>
  </executions>
</plugin>

但是我收到了如下所示的错误:

[WARNING] [talledLocalContainer] Exception in thread "main" 
    javax.naming.CommunicationException: 
  Could not obtain connection to any of these urls: 127.0.0.1:1080
  [Root exception is javax.naming.CommunicationException: Failed to retrieve 
      stub from server /127.0.0.1:1080 
  [Root exception is java.io.EOFException]]
[WARNING] [talledLocalContainer] at 
    org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)

为什么会这样?

1 个答案:

答案 0 :(得分:1)

你确定端口是1080吗?默认端口通常为1099。