Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 410
Deglans Dalpasso Avatar asked Oct 09 '17 14:10

Deglans Dalpasso


3 Answers

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.

like image 140
Flemming G. Jensen Avatar answered Nov 08 '22 10:11

Flemming G. Jensen


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.

like image 23
Andres Cárdenas Avatar answered Nov 08 '22 09:11

Andres Cárdenas


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>
like image 3
Deglans Dalpasso Avatar answered Nov 08 '22 10:11

Deglans Dalpasso