简体   繁体   中英

The JavaEE 8 Tutorial, deploy failed on hello1 project

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

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.

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>

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.

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

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

This works for me on Windows 10 with NetBeans 11.3

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

on lines 43-46 of C:\\Javatools\\glassfish5\\docs\\javaee-tutorial\\examples\\pom.xml where java_ee_sdk-8u1.zip is extracted to C:\\Javatools.

Original code that threw error:

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

I needed to use absolute path for the glassfish.home value to get it to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM