簡體   English   中英

JavaEE 8 教程,在 hello1 項目上部署失敗

[英]The JavaEE 8 Tutorial, deploy failed on hello1 project

我正在嘗試學習 Java EE 8,我已經按照https://javaee.github.io/tutorial/ 上的官方指南進行操作,但是我遇到了這個問題:

--- 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但它不起作用......

我遇到了同樣的問題,但設法通過這種方式解決了它:

在位於 ../glassfish5/docs/javaee-tutorial/examples 目錄的父 pom 中,我將以下屬性更改為

<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 密碼。

我希望這能解決您的問題。

Flemming G. Jensen 曾說過:

我遇到了同樣的問題,但設法通過這種方式解決了它:

在位於 ../glassfish5/docs/javaee-tutorial/examples 目錄的父 pom 中,我將以下屬性更改為

 <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>

嘗試只編輯父 pom(在我的情況下為 C:\\Program Files\\Java\\glassfish4\\docs\\javaee-tutorial\\pom.xml)並更改這一行

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

為絕對路線。

就我而言:

<glassfish.home>C:\Program Files\Java\glassfish4</glassfish.home>

它對我有用。 祝你好運。

我按照以下步驟解決它:

  1. 啟動 Glassfish 服務器
  2. 啟動 JavaDB
  3. 將路徑環境設置為 Glassfish 和 Marven
  4. 以這種方式編輯 pom.xml 上的 glassfish home 屬性:

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

你應該在你的 shell 上運行“mvn install -X”來驗證發生了什么

確保 glassfish 服務器在部署前已經啟動(命令 $ mvn install) 注意 glassfish v4 需要 JDK6 或 JDK7。 和 glassfish v5 需要 JDK7 或 JDK8,而不是超出。 分享

這在帶有 NetBeans 11.3 的 Windows 10 上對我有用

<cargo.plugin.version>1.4.4</cargo.plugin.version>
<glassfish.domain.name>domain1</glassfish.domain.name>
<glassfish.home>C:\Javatools\glassfish5</glassfish.home>
<integration.container.id>glassfish4x</integration.container.id>

在 C:\\Javatools\\glassfish5\\docs\\javaee-tutorial\\examples\\pom.xml 的第 43-46 行,其中 java_ee_sdk-8u1.zip 被提取到 C:\\Javatools。

拋出錯誤的原始代碼:

<cargo.plugin.version>1.4.4</cargo.plugin.version>
<glassfish.domain.name>domain1</glassfish.domain.name>
<glassfish.home>${glassfish.home.prefix}/glassfish5</glassfish.home>
<integration.container.id>glassfish5x</integration.container.id>

我需要為 glassfish.home 值使用絕對路徑才能使其工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM