从java教程中将hello1 Web模块部署到glassfish时出错

时间:2018-04-05 06:19:39

标签: java-ee glassfish java-ee-7

我正在关注java ee文档中的this tutorial,并尝试将简单的Web模块部署到glasfish服务器。

  

6.3.2.1使用NetBeans IDE构建和打包hello1 Web模块

     
      
  1. 启动GlassFish Server,如启动GlassFish Server使用中所述   NetBeans IDE,如果您尚未这样做的话。

  2.   
  3. 从“文件”菜单中,选择“打开项目”。

  4.   
  5. 在“打开项目”对话框中,导航至:
      啧安装 /示例/网络/ JSF

  6.   
  7. 选择hello1文件夹。

  8.   
  9. 单击“打开项目”。

  10.   
  11. 在Projects选项卡中,右键单击hello1项目并选择Build。   此命令将项目部署到服务器。

  12.   

当我点击Build时,它失败并给了我以下错误

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 26.227s
Finished at: Thu Apr 05 11:38:32 IST 2018
Final Memory: 11M/80M
------------------------------------------------------------------------
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

我下载了javaEE并按照教程中的说明完成了所有操作,为什么我收到错误?

2 个答案:

答案 0 :(得分:0)

看起来你正在使用在编写EE7教程时不存在的Glassfish 5。

尝试downloading and installing the latest version of Glassfish 4(版本4.1.2),并使用它而不是Glassfish 5.

在恢复教程之前,确实需要验证Glassfish 4的安装是否正常工作:

  • 启动Glassfish 4服务器并在浏览器中输入http://localhost:4848
  • 您应该看到Glassfish 4.x管理控制台,如下所示。
  • 点击左上角的关于按钮验证版本。

glassfishAdmin

答案 1 :(得分:0)

我在 pom.xml (glassfish5\docs\javaee-tutorial\examples\pom.xml) 中更新了货物版本: <cargo.plugin.version>1.8.4</cargo.plugin.version>