RE: Start Jonas locally with Maven and Cargo

Anthony BOUQUET <[email protected]> Tue, 22 Feb 2011 14:42:26 +0100
Newsgroups gmane.comp.java.objectweb.jonas
Message-ID <[email protected]>
Hi,

I'm not really an expert on Jonas but you should maybe add  $JONAS_ROOT/lib/client.jar to cargo's classpath by using dependencies plugins.

http://repo1.maven.org/maven2/org/objectweb/jonas/jonas-client/5.0-M1/jonas-client-5.0-M1.pom


 Cordialement,

Anthony BOUQUET

LOGIC
47-49 rue Gutenberg
42100 SAINT-ETIENNE
[email protected]<mailto:[email protected]>

[cid:[email protected]]

De : Celinio [mailto:[email protected]]
Envoyé : mardi 22 février 2011 12:49
À : [email protected]
Objet : [jonas] Start Jonas locally with Maven and Cargo

Hi,
I am trying to fix my POM.xml file so that i can start/stop Jonas (and later deploy) with the Cargo plugin for Maven.

So far, this is what i have come with in my POM.xml file :

<profiles>
        <profile>
            <id>cargo</id>
            <activation>
            </activation>
            <build>
                <plugins>
                    <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>1.0</version>
                    <executions>
                        <execution>
                            <id>start-jonas</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                              <goal>start</goal>
                            </goals>
                          </execution>
                          <execution>
                            <id>stop-jonas</id>
                            <phase>post-integration-test</phase>
                            <goals>
                              <goal>stop</goal>
                            </goals>
                          </execution>
                    </executions>

                    <configuration>
                        <container>
                            <containerId>jonas5x</containerId>
                            <type>installed</type>
                            <home>E:\appft2\jonas-full-5.1.5\bin</home>
                        </container>
                        <configuration>
                            <type>existing</type>
                            <home>E:\appft2\jonas-full-5.1.5\</home>
                            <properties>
                                <cargo.servlet.port>9000</cargo.servlet.port>
                                <cargo.hostname>localhost</cargo.hostname>
                                <cargo.protocol>http</cargo.protocol>
                                <cargo.jonas.server.name>jonas</cargo.jonas.server.name>
                                <cargo.jonas.domain.name>jonas</cargo.jonas.domain.name>
                            </properties>
                        </configuration>
                        <deployer>
                            <deployables>
                                <deployable>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <type>${project.packaging}</type>
                                    <classifier>${config.classifier}</classifier>
                                </deployable>
                            </deployables>
                        </deployer>
                    </configuration>
                </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

This is giving me the following error :

[INFO] ------------------------------------------------------------------------
[INFO] Building voltage-ear(ear) 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.0:start (default-cli) @ voltage-ear ---
[INFO] [talledLocalContainer] JOnAS 5.x starting...
[WARNING] [talledLocalContainer] java.lang.NoClassDefFoundError: org/ow2/jonas/commands/admin/ClientAdmin
[WARNING] [talledLocalContainer] Caused by: java.lang.ClassNotFoundException: org.ow2.jonas.commands.admin.ClientAdmin
[WARNING] [talledLocalContainer]     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[WARNING] [talledLocalContainer]     at java.security.AccessController.doPrivileged(Native Method)
[WARNING] [talledLocalContainer]     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[WARNING] [talledLocalContainer]     at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
[WARNING] [talledLocalContainer]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[WARNING] [talledLocalContainer]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[WARNING] [talledLocalContainer]     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
[WARNING] [talledLocalContainer] Could not find the main class: org.ow2.jonas.commands.admin.ClientAdmin.  Program will exit.
[WARNING] [talledLocalContainer] Exception in thread "main"
[WARNING] [talledLocalContainer] Java Result: 1

What am i missing ?
Thanks.
image001.jpg (image/jpeg, 1.8 KB) - not displayed