2012-02-24 126 views
1

我想使用Cargo maven插件将WAR文件远程部署到JBoss 5.0.1 GA,但似乎我不能。 我发现了类似的线程,但没有一个最终帮助我解决了我的问题。 我遵循这些instructions。这似乎是很重要的几点是:如何使用Cargo maven插件将WAR远程部署到JBoss 5.1.0.GA?

作为货物1.0.3,货物方式支持JBoss应用服务器的远程部署的急剧演变。从JBoss 5.x开始,JBoss有一个Deployment Manager,可用于在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货物:部署)我得到这样的错误:

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文件。可能我在这里错过了一些基本的东西。

谢谢您的时间

回答

0

最后我找到了解决办法:)

我用错了RMI端口。默认的是1099. 所以,我把我的pom文件这个<cargo.rmi.port>1099</cargo.rmi.port>和问题修复!

相关问题