2017-10-09 141 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」,以驗證正在發生什麼