【问题标题】:How to deploy remotely WAR to JBoss 5.1.0.GA using Cargo maven plugin?如何使用 Cargo maven 插件远程部署 WAR 到 JBoss 5.1.0.GA?
【发布时间】:2012-03-15 05:54:14
【问题描述】:

我正在尝试使用 Cargo maven 插件将 WAR 文件远程部署到 JBoss 5.0.1 GA,但似乎我做不到。 我找到了类似的线程,但没有一个最终帮助我解决了我的问题。 我关注这些instructions。一些似乎很重要的点是:

从 CARGO 1.0.3 开始,CARGO 在 JBoss 应用服务器上支持远程部署的方式发生了巨大的变化。从 JBoss 5.x 开始,JBoss 有一个部署管理器,可用于在 JBoss 服务器上部署东西。

我的 pom 文件如下所示:

<plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.2.0</version>
            <configuration>
                <wait>true</wait>
                <container>
                    <timeout>500000</timeout>
                    <containerId>jboss51x</containerId>
                    <type>remote</type>
                </container>
                <configuration>
                    <type>runtime</type>
                    <properties>
                        <cargo.remote.username></cargo.remote.username>
                        <cargo.remote.password></cargo.remote.password>
                         <cargo.hostname>localhost</cargo.hostname>
                         <cargo.rmi.port>8080</cargo.rmi.port>
                         <cargo.jvmargs>-XX:MaxPermSize=512M -Xmx1512m</cargo.jvmargs>  
                    </properties>
                    <deployables>
                      <deployable>
                        <groupId>myGroupId</groupId>
                        <artifactId>myArtifactId</artifactId>
                        <type>war</type>
                      </deployable>
                    </deployables>
                </configuration>
            </configuration>
             <dependencies>
                <dependency>
                      <groupId>org.jboss.integration</groupId>
                      <artifactId>jboss-profileservice-spi</artifactId>
                      <version>5.1.0.GA</version>
                </dependency>
                <dependency>
                    <groupId>org.jboss.jbossas</groupId>
                     <artifactId>jboss-as-client</artifactId>
                     <version>5.1.0.GA</version>
                     <type>pom</type>
              </dependency>
            </dependencies>
        </plugin>

当我尝试部署我的战争(通过运行 mvn cargo:deploy)时,我遇到了这种错误:

Caused by: javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:8080 and discovery failed with error: javax.na
ming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.Comm
unicationException: Failed to retrieve stub from server localhost/127.0.0.1:8080 [Root exception is java.io.EOFException]]
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at org.codehaus.cargo.tools.jboss.JBossDeployer.getDeploymentManager(JBossDeployer.java:185)
        at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:70)
        at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212)
    ... 23 more
Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server localhost/127.0.0.1:8080 [Root exception is java.io.EOFException]

javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:8080 and discovery failed with error: javax.naming.CommunicationException:Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Rootexception is javax.naming.CommunicationException: Failed to retrieve stub from server localhost/127.0.0.1:8080 [Root exception is java.io.EOFException]]

你有什么建议吗?我什至不清楚我是否需​​要在我的 JBoss 中安装一些特殊的插件或库,或者我的 pom 配置是否足以远程部署我的 war 文件。可能我在这里遗漏了一些基本的东西。

感谢您的宝贵时间

【问题讨论】:

    标签: deployment jboss maven-cargo


    【解决方案1】:

    我终于找到了解决方案:)

    我使用了错误的 rmi 端口。默认值为 1099。 所以,我将这个&lt;cargo.rmi.port&gt;1099&lt;/cargo.rmi.port&gt; 放入我的 pom 文件中并修复了问题!

    【讨论】:

      猜你喜欢
      • 2011-01-17
      • 2023-03-05
      • 2012-04-02
      • 1970-01-01
      • 2017-10-01
      • 2014-08-03
      • 1970-01-01
      • 1970-01-01
      • 2011-03-15
      相关资源
      最近更新 更多