2017-10-09 137 views
3

我尝试学习Java EE 8,我已按照https://javaee.github.io/tutorial/官方指南,但我有这个问题:的JavaEE的8教程,部署失败的hello1项目

--- cargo-maven2-plugin:1.4.4:redeploy (deploy) @ hello1 --- 
[DeployerRedeployMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-glassfish:jar:1.4.4 for container glassfish5x 
------------------------------------------------------------------------ 
BUILD FAILURE 
------------------------------------------------------------------------ 
Total time: 4.730s 
Finished at: Mon Oct 09 16:16:40 CEST 2017 
Final Memory: 18M/183M 
------------------------------------------------------------------------ 
Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) on project hello1: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish5x], type = [installed]], configuration type [existing]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1] 

To see the full stack trace of the errors, re-run Maven with the -e switch. 
Re-run Maven using the -X switch to enable full debug logging. 

For more information about the errors and possible solutions, please read the following articles: 
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException 

我都严格遵循指南所以我不明白错误在哪里...

编辑: 这个错误是相同的glassfish 5和4.1.1。 如果我手动部署war包,它是可行的;所以这个问题是Maven和GlassFish服务器之间的通信...

编辑2: 我发现这个https://netbeans.org/bugzilla/show_bug.cgi?id=247746但忽略了最低工作...

回答

2

我有同样的问题,但设法解决这样说:

在父POM位于../glassfish5/docs/javaee-tutorial/examples目录更改以下属性来

<cargo.plugin.version>1.6.4</cargo.plugin.version> 
<glassfish.domain.name>domain1</glassfish.domain.name>  
<glassfish.home>/Users/fgjensen/Java/J2EE8/glassfish5</glassfish.home> 
<integration.container.id>glassfish4x</integration.container.id> 

这迫使Maven来使用最新版本的日e货物插件。该插件目前不支持Glassfish 5作为集成容器。但是,它无论如何建立和安装应用程序。

之后,我还必须在位于/ glassfish5/glassfish/domains目录中的password.properties文件中设置asadmin密码。

我希望这可以解决您的问题。

+0

事实上Glassfish的5尚未被货物支撑,从而简单地改变属性' integration.container.id'到'glassfish4x',在我身边做了诡计 –

1

弗莱明G.詹森说:

我有同样的问题,但设法解决这样说:

在父POM位于../glassfish5/docs/javaee- tutorial/examples目录我将以下属性更改为

<cargo.plugin.version>1.6.4</cargo.plugin.version> 
    <glassfish.domain.name>domain1</glassfish.domain.name>  
    <glassfish.home>/Users/fgjensen/Java/J2EE8/glassfish5</glassfish.home> 
    <integration.container.id>glassfish4x</integration.container.id> 

这迫使Maven使用最新版本的货物插件。该插件目前不支持Glassfish 5作为集成容器。但是,它无论如何建立和安装应用程序。

之后,我还必须在位于/ glassfish5/glassfish/domains目录中的password.properties文件中设置asadmin密码。

我希望这可以解决您的问题。

你也可以创建一个在您的家目录的符号链接到GlassFish和JDK,而不是修改行

<glassfish.home>/Users/fgjensen/Java/J2EE8/glassfish5</glassfish.home> 
0

我解决它按照下列步骤:

  1. 启动GlassFish服务器
  2. 启动JavaDB
  3. 设置Glassfish和Marven的路径环境
  4. 在pom上编辑玻璃鱼家居物业。XML这样:

     <properties> 
         <glassfish.home>${glassfish.home.prefix}/glassfish4</glassfish.home> 
         </properties> 
    

你应该运行在你的shell“MVN安装-X”,以验证正在发生什么