2012-06-27 102 views
16

我試圖在遠程Glassfish服務器(版本3.1.1(build 12))上使用Cargo Maven插件部署web應用程序。 Glassfish服務器以及位於不同Linux服務器上的Java代碼(Ubuntu)。我已經在pom文件中配置了所有必要的屬性,並在Windows機器上測試了部署。有用。但它在Linux Ubuntu上失敗,出現了一些有趣的異常:Cargo插件在Glassfish上部署時拋出CargoException - 部署失敗:null

27-Jun-2012 14:36:05 [ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy (default-cli) on project my-web-project-app: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null -> [Help 1] 
27-Jun-2012 14:36:05 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy (default-cli) on project mca-staff-app: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 
27-Jun-2012 14:36:05   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) 
27-Jun-2012 14:36:05   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
27-Jun-2012 14:36:05   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 
27-Jun-2012 14:36:05   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
27-Jun-2012 14:36:05   at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
27-Jun-2012 14:36:05   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
27-Jun-2012 14:36:05   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
27-Jun-2012 14:36:05   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
27-Jun-2012 14:36:05   at java.lang.reflect.Method.invoke(Method.java:597) 
27-Jun-2012 14:36:05   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) 
27-Jun-2012 14:36:05   at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 
27-Jun-2012 14:36:05   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 
27-Jun-2012 14:36:05   at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 
27-Jun-2012 14:36:05 Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null 
27-Jun-2012 14:36:05   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110) 
27-Jun-2012 14:36:05   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
27-Jun-2012 14:36:05   ... 19 more 
27-Jun-2012 14:36:05 Caused by: org.codehaus.cargo.util.CargoException: Deployment has failed: null 
27-Jun-2012 14:36:05   at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.waitForProgressObject(AbstractJsr88Deployer.java:285) 
27-Jun-2012 14:36:05   at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.deploy(AbstractJsr88Deployer.java:126) 
27-Jun-2012 14:36:05   at org.codehaus.cargo.maven2.DeployerDeployMojo.performDeployerActionOnSingleDeployable(DeployerDeployMojo.java:56) 
27-Jun-2012 14:36:05   at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionOnAllDeployables(AbstractDeployerMojo.java:178) 
27-Jun-2012 14:36:05   at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:98) 
27-Jun-2012 14:36:05   at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:311) 
27-Jun-2012 14:36:05   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 
27-Jun-2012 14:36:05   ... 20 more 

有沒有人在Linux上使用Maven Cargo插件進行遠程應用程序部署?或者,也許有人知道這裏有什麼問題?

+0

你有沒有找到解決方案?當我嘗試部署到不同的服務器時,我遇到了這個問題,但是如果將主機更改爲'localhost',則部署將按預期工作。 – Snekse

+2

這也許相關:http://stackoverflow.com/questions/26599957/cargo-remote-deployment-glassfish-4-1-fails-glassfish-uses-100-cpu(也有一些建議) – wemu

+1

你可以粘貼你的'pom.xml'的一部分描述了貨物的部署?另外,你是直接運行它還是由像詹金斯或其他CI服務器運行?我記得使用Cargo + Glassifsh 3是純粹的痛苦,所以現在我通過Jenkins部署使用Glassfish REST API + curl – PierreF

回答

0

您有沒有找到解決方案?當我嘗試部署到不同的服務器時,我遇到了這個問題,但是如果將主機更改爲本地主機,則部署將按預期工作。

我面臨同樣的問題,與localhost它一切都很好,當我試圖遠程部署相同的空錯誤來了。

我所做的是,我刪除了,並在遠程服務器上從頭開始安裝所有東西。因此,我的本地機器和遠程服務器上存在相同的Glassfish安裝。

之後,一切都很好。

P.S:這可以通過在遠程主機上覆制本地域來實現。