2
Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) on project dukes-tutoring-war: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy failed: Failed to create deployer with implementation class org.codehaus.cargo.container.glassfish.GlassFish4xInstalledLocalDeployer for the parameters (container [id = [glassfish4x]], deployer type [installed]). InvocationTargetException: The container configuration directory "/home/yogesh/Downloads/glassfish4/glassfish4/glassfish/domains" does not exist. Please configure the container before attempting to perform any local deployment. Read more on: http://cargo.codehaus.org/Local+Configuration -> [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

After correcting the problems, you can resume the build with the command
  mvn <goals> -rf :dukes-tutoring-war

my pom.xml fromdukes-tutoring-war ---------

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>dukes-tutoring</artifactId>
        <groupId>org.glassfish.javaeetutorial</groupId>
        <version>7.0.5</version>
    </parent>

    <groupId>org.glassfish.javaeetutorial</groupId>
    <artifactId>dukes-tutoring-war</artifactId>
    <packaging>war</packaging>

    <name>dukes-tutoring-war</name>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>dukes-tutoring-common</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${maven.exec.plugin.version}</version>
                <executions>
                    <execution>
                        <id>create-tutoring-realm</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <skip>false</skip>
                    <executable>/home/yogesh/Downloads/glassfish4/glassfish/bin/asadmin${glassfish.executables.suffix}</executable>
                    <arguments>
                        <argument>create-auth-realm</argument>
                        <argument>--classname</argument>
                        <argument>com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm</argument>
                        <argument>--property</argument>
                        <argument>jaas-context=jdbcRealm:datasource-jndi='java:global/TutoringDataSource':user-table=tutoring.PERSON:user-name-column=email:password-column=password:group-table=tutoring.PERSON:group-name-column=DTYPE:digest-algorithm=none</argument>
                        <argument>tutoringRealm</argument>
                    </arguments>
                    <successCodes>
                        <successCode>0</successCode>
                        <successCode>1</successCode>
                    </successCodes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

The pom in examples folder for <glassfish.home.prefix> settings

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.glassfish.javaeetutorial</groupId>
    <artifactId>javaeetutorial</artifactId>
    <version>7.0.5</version>
    <packaging>pom</packaging>
    <name>javaeetutorial</name>

    <scm>
        <connection>scm:svn:https://svn.java.net/svn/javaeetutorial~svn/tags/javaeetutorial-7.0.0</connection>
        <developerConnection>scm:svn:https://svn.java.net/svn/javaeetutorial~svn/tags/javaeetutorial-7.0.0</developerConnection>
    </scm>
    <issueManagement>
        <system>IssueTracker</system>
        <url>http://java.net/jira/browse/JAVAEETUTORIAL</url>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <javaee.api.version>7.0</javaee.api.version>
        <maven.compiler.plugin.version>3.1</maven.compiler.plugin.version>
        <maven.source.plugin.version>2.2.1</maven.source.plugin.version>
        <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
        <maven.war.plugin.version>2.3</maven.war.plugin.version>
        <maven.acr.plugin.version>1.0</maven.acr.plugin.version>
        <maven.ear.plugin.version>2.8</maven.ear.plugin.version>
        <maven.ejb.plugin.version>2.3</maven.ejb.plugin.version>
        <maven.jar.plugin.version>2.4</maven.jar.plugin.version>
        <maven.rar.plugin.version>2.3</maven.rar.plugin.version>
        <maven.license.plugin.version>1.10.b1</maven.license.plugin.version>
        <maven.release.plugin.version>2.4.1</maven.release.plugin.version>
        <maven.exec.plugin.version>1.2.1</maven.exec.plugin.version>
        <junit.version>4.11</junit.version>
        <eclipselink.version>2.5.0</eclipselink.version>
        <glassfish.embedded.version>4.0</glassfish.embedded.version>
        <cargo.plugin.version>1.4.4</cargo.plugin.version>
        <glassfish.domain.name>domain1</glassfish.domain.name>
        <glassfish.home>${glassfish.home.prefix}/glassfish4</glassfish.home>
        <integration.container.id>glassfish4x</integration.container.id>
    </properties>

    <profiles>
        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <glassfish.home.prefix>c:/</glassfish.home.prefix>
                <glassfish.executables.suffix>.bat</glassfish.executables.suffix>
            </properties>
        </profile>
        <profile>
            <id>unix</id>
            <activation>
                <os>
                    <family>unix</family>
                </os>
            </activation>
            <properties>
                <glassfish.home.prefix>/home/yogesh/Downloads/glassfish4</glassfish.home.prefix>
                <glassfish.executables.suffix />
            </properties>
        </profile>
        <profile>
            <id>sdk</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <glassfish.home>${basedir}/../../../</glassfish.home>
            </properties>
        </profile>
        <profile>
            <id>development</id>
            <activation>
                <file>
                    <exists>${basedir}/../bundle</exists>
                </file>
            </activation>
            <properties>
                <glassfish.home>${glassfish.home.prefix}/glassfish4</glassfish.home>
            </properties>
        </profile>
        <profile>
            <id>standalone</id>
            <properties>
                <glassfish.home>${basedir}/target/cargo/installs/glassfish</glassfish.home>
                <cargo.maven.containerUrl>http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/latest-glassfish.zip</cargo.maven.containerUrl>
            </properties>
        </profile>
    </profiles>

    <modules>
        <module>archetypes</module>
        <module>batch</module>
        <module>case-studies</module>
        <module>cdi</module>
        <module>concurrency</module>
        <module>connectors</module>
        <module>ejb</module>
        <module>jaxrs</module>
        <module>jaxws</module>
        <module>jms</module>
        <module>persistence</module>
        <module>security</module>
        <module>web</module>
    </modules>

    <repositories>
        <repository>
            <id>snapshot-repository.java.net</id>
            <name>Java.net Snapshot Repository for Maven</name>
            <url>https://maven.java.net/content/repositories/staging/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>releases-repository.java.net</id>
            <name>Java.net releases Repository for Maven</name>
            <url>https://maven.java.net/content/repositories/releases/</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven.clean.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven.war.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>${cargo.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>deploy</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>redeploy</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <container>
                        <containerId>${integration.container.id}</containerId>
                        <type>installed</type>
                        <home>${glassfish.home}</home>
                    </container>
                    <configuration>
                        <type>existing</type>
                        <home>${glassfish.home}/glassfish/domains</home>
                        <properties>
                            <cargo.glassfish.domain.name>${glassfish.domain.name}</cargo.glassfish.domain.name>
                            <!--cargo.remote.username></cargo.remote.username-->
                            <cargo.remote.password />
                        </properties>
                    </configuration>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>${maven.license.plugin.version}</version>
                <configuration>
                    <header>common/license.txt</header>
                    <excludes>
                        <exclude>common/**</exclude>
                        <exclude>**/META-INF/**</exclude>
                        <exclude>**/WEB-INF/**</exclude>
                        <exclude>**/nbactions.xml</exclude>
                        <exclude>**/nb-configuration.xml</exclude>
                        <exclude>**/glassfish-resources.xml</exclude>
                        <exclude>**/simple-flow-flow.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven.release.plugin.version}</version>
                <configuration>
                    <!--
                     During release:perform, enable the "sdk" profile
                    -->
                    <releaseProfiles>sdk</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>${javaee.api.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>

my glassfish4 location: /home/yogesh/Downloads/glassfish4 apache maven location: /opt/apache-maven-3.3.9

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Yogesh Doke
  • 1,706
  • 2
  • 12
  • 20

3 Answers3

0

I had a similar issue when I tried to build the hello1 project, and this was mainly due to the fact that I installed Netbeans with glassfish: I suppose you did the same thing.

I'm not too sure, but it appears installing Netbeans with glassfish causes some path problems when attempting to build projects.

This is what I did to resolve it on my openSUSE Leap computer:

  1. Stop the glassfish server if it's running and close your Netbeans IDE

  2. Open a terminal and uninstall glassfish

    cd /path/to/glassfish/installation/directory (e.g: cd ~/glassfish-4.1.1)

    ./uninstall.sh

  3. Download Java EE 7 SDK Update 2 (or the latest update) from http://www.oracle.com/technetwork/java/javaee/downloads/index.html

  4. Unzip the downloaded file (this creates the glassfish4 directory)

    cd /path/to/downloaded/file/directory

    unzip java_ee_sdk-7u2.zip

  5. At this stage, the glassfish server is already installed, but it's not yet integrated in the Netbeans IDE (You will find out that it is not listed as a server in the Netbeans IDE). Instructions on how to add glassfish server as a server in Netbeans IDE can be found here: https://docs.oracle.com/cd/E19798-01/821-1770/gioew/

  6. You can now open Netbeans IDE and try to build your project again; you should have BUILD SUCCESS as I did.

I really hope this helps.

mtchuente
  • 334
  • 5
  • 9
0

This might also relate to the version of you glassfish server, I solved the same problem by switching to glassfish4.1.

this line in the exception message:

(container [id = [glassfish4x]], deployer type [installed])

is probably searching for the glassfish4 version,

Michael0x2a
  • 58,192
  • 30
  • 175
  • 224
0

I had this issue with guessnumber-jsf example, but it was fixed by starting my glassfish server.

Rizu
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 19 '22 at 02:50