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

6 Answers 6

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.

4
  • 1
    Indeed Glassfish 5 is not yet supported by cargo so simply changing the property integration.container.id to glassfish4x, did the trick on my side Nov 16, 2017 at 17:25
  • Worked for me too though I did not require <cargo.plugin.version>1.6.4</cargo.plugin.version> Feb 12, 2019 at 21:02
  • I still couldn't locate the directiory. If I change individual directory, will it help ? Individual directory I mean directory of individual project Sep 14, 2021 at 13:51
  • I am using glassfish 6 , how can I edit the file so that it works properly, I am still getting the same error. Sep 14, 2021 at 17:48
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>
1
  • 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 8, 2020 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.

1
  • 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 8, 2020 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

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.