The JavaEE 8 Tutorial, deploy failed on hello1 pro

2020-08-26 03:37发布

I'm try to learn Java EE 8, I have followed the official guide at https://javaee.github.io/tutorial/ but I have this problem:

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

I have followed exactly the guide so I don't understood where is the mistake...

EDIT: This error is the same for glassfish 5 and 4.1.1. If I deploy manually the war package it's work; so the problem is the communication between maven and the glassfish server...

EDIT 2: I have found this https://netbeans.org/bugzilla/show_bug.cgi?id=247746 but it dosen't work...

5条回答
Viruses.
2楼-- · 2020-08-26 04:03

I had the same problems, but managed to solved it this way:

In the parent pom located in ../glassfish5/docs/javaee-tutorial/examples directory I change the following properties to

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

This forces Maven to use the latest version of the cargo plugin. The plugin does not support Glassfish 5 as integration container currently. However, it builds and installs the applications anyway.

After this I also had to set the asadmin password in the password.properties file located in the /glassfish5/glassfish/domains directory.

I hope this solves your problems.

查看更多
SAY GOODBYE
3楼-- · 2020-08-26 04:04

Try just editing the parent pom (in my case C:\Program Files\Java\glassfish4\docs\javaee-tutorial\pom.xml) and change this line

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

for an absolute route.

In my case:

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

It worked for me. Good luck.

查看更多
家丑人穷心不美
4楼-- · 2020-08-26 04:09

I solve it following these steps:

  1. Starting Glassfish server
  2. Starting JavaDB
  3. Setting Path environment to Glassfish and Marven
  4. Editing glassfish home properties on pom.xml in this way:

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

You Should run "mvn install -X" on your shell to verify what is happening

查看更多
Rolldiameter
5楼-- · 2020-08-26 04:11

ensure glassfish server, has started before deploying (the command $ mvn install) note that glassfish v4 needs JDK6 or JDK7. and glassfish v5 needs JDK7 or JDK8, not beyond. share

查看更多
Juvenile、少年°
6楼-- · 2020-08-26 04:12

Flemming G. Jensen has say:

I had the same problems, but managed to solved it this way:

In the parent pom located in ../glassfish5/docs/javaee-tutorial/examples directory I change the following properties to

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

This forces Maven to use the latest version of the cargo plugin. The plugin does not support Glassfish 5 as integration container currently. However, it builds and installs the applications anyway.

After this I also had to set the asadmin password in the password.properties file located in the /glassfish5/glassfish/domains directory.

I hope this solves your problems.

You can also create a symbolic link in your home dir to GlassFish and to JDK instead of modify the line

<glassfish.home>/Users/fgjensen/Java/J2EE8/glassfish5</glassfish.home>
查看更多
登录 后发表回答