9

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

Deglans Dalpasso
  • 495
  • 5
  • 14

6 Answers6

11

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.

3

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>
Deglans Dalpasso
  • 495
  • 5
  • 14
  • What is the name of the symbolic link in the home directory ? Can you provide an example ? or did you mean substitute "${glassfish.home.prefix}" for a symlink in the "pom.xml" ? – mvanle May 08 '20 at 17:48
2

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.

Andres Cárdenas
  • 720
  • 1
  • 5
  • 26
  • This only works if people are using Glassfish 4.x. The root cause is the "cargo.plugin.version" 1.4.4 in the root "pom.xml" does not support Glassfish 5.x. For this particular example, the problem can be fixed by using a version that does support Glassfish 5.x (eg. latest is 1.7.12 as at time of writing); or revert "integration.container.id" to "glassfish4x". – mvanle May 08 '20 at 17:56
0

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

Renan
  • 1
  • 1
0

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

Shadyar
  • 709
  • 8
  • 16
0

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.

Aaron Rykhus
  • 96
  • 1
  • 4