 |
Cargo support for GlassFish v2
Posted by kohsuke on October 06, 2008 at 02:24 PM | Comments (13)
In early September, Cargo project pushed 1.0 alpha-6 release, which contains my improvement of better pluggability support. With this and the cargo-core-containers-glassfish module that I just pushed, you can now automate GlassFish v2 through Cargo.
In this cargo-core-containers-glassfish release of 1.0 alpha-6, we have the support for starting/stopping GlassFish and deploying artifacts to it. For this to work, you need to have GlassFish installed first, then tell Cargo where it is.
Cargo can be used in many different ways, such as the programmatic API, Ant tasks, and Maven plugins. You can see more details about these in the Cargo website, but for example, the following Ant build script fragment shows you how to start GF with some wars deployed.
The key thing to remember is that the GlassFish has the container ID of "glassfish2".
Cargo helps automation of containers, so it's a very useful project for automated tests (and yes, you can use this with Hudson, which has a plugin to talk to Cargo.)
I hope to merge this module to the Cargo project when things are stable, so please let me know how it's working for you. Also, GlassFish v3 support is also on the TODO list.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
hi Kohsuke, where can I find the source code or the options that it accepts? It doesn't appear in the cargo's repository
Posted by: david_calavera on October 07, 2008 at 06:39 AM
-
It is in the cargo's repository, which should be mirrored into the central repository shortly.
The source code is in the cargo-contrib module (if you are trying to check out from SCM — see POM.) The source jar is also available in the Maven repository.
Posted by: kohsuke on October 08, 2008 at 09:54 PM
-
Do you have an example of a working maven2 configuration? I have looked around through the cargo documentation for hours, and have not been able to get it working.
In my POM I have:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0-alpha-6</version>
<configuration>
<container>
<containerId>glassfish2</containerId>
</container>
<type>local</type>
<home>/home/emalotau/glassfish-v2ur2/domains</home>
</configuration>
</plugin>
On the command-line I type:
mvn cargo:start
and then maven says:
Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish2], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it?
Posted by: emalotau on October 21, 2008 at 08:09 AM
-
The maven config is:
org.codehaus.cargo
cargo-maven2-plugin
1.0-alpha-6
glassfish2
${glassfish.home}
local
org.codehaus.cargo
cargo-core-container-glassfish
1.0-alpha-6
Posted by: raym0nd on December 22, 2008 at 06:53 AM
-
You need to express the plugin dependency. Sadly this page does not allow easy posting of XML so I am unable to post a working config ... how bad is that ?
Posted by: raym0nd on December 22, 2008 at 06:56 AM
-
You need to express the plugin dependency. Sadly this page does not allow easy posting of XML so I am unable to post a working config ... how bad is that ?
Posted by: raym0nd on December 22, 2008 at 06:57 AM
-
Hello Kohsuke,
I get the same error message like david. Can you mail me a working pom.xml?
oliver
Posted by: odornauf on January 22, 2009 at 03:34 AM
-
To use this with Maven, specify a plugin dependency, as raym0nd says. See http://pastebin.com/f4a20e599 for the example.
Posted by: kohsuke on May 27, 2009 at 09:26 AM
-
Hi,
I am trying to start glassfish2 using your ant script , but have error with configuration. Could you help me resolve it
1) ant target
ERROR: org.codehaus.cargo.container.ContainerException: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish2], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it?
at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:143)
at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:387)
at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:374)
at org.codehaus.cargo.ant.ConfigurationElement.createConfiguration(ConfigurationElement.java:209)
at org.codehaus.cargo.ant.CargoTask.makeContainer(CargoTask.java:751)
at org.codehaus.cargo.ant.CargoTask.execute(CargoTask.java:449)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor723.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
BUILD FAILED (total time: 0 seconds)
Posted by: tishaishy on June 03, 2009 at 04:43 AM
-
Hi Kohsuke,
I'm trying your glassfish support plugin for cargo, but I'm receiving the same error as in the previous comment:
org.codehaus.cargo.container.ContainerException: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish2], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it?
I am using the 1.0-uberjar from cargo, and the 1.0 verion of the glassfish-support jar found from the link you provide above.
The documentation on the site doesn't seem to describe the extension mechanism improvements you contributed to cargo, and I can't find the alpha6 jar (and have been too lazy to try to build my own so far). Did your improvements not make it into the 1.0 release? Am I doing something wrong?
Thanks in advance for anything you can add.
Posted by: christopherrued on June 24, 2009 at 08:57 AM
-
I found the alpha-6 jars:
* Core uberjar: http://repository.codehaus.org/org/codehaus/cargo/cargo-core-uberjar/1.0-alpha-6/cargo-core-uberjar-1.0-alpha-6.jar
* Ant Tasks: http://repository.codehaus.org/org/codehaus/cargo/cargo-ant/1.0-alpha-6/cargo-ant-1.0-alpha-6.jar
* Glassfish Support: http://repository.codehaus.org/org/codehaus/cargo/cargo-core-container-glassfish/1.0-alpha-6/cargo-core-container-glassfish-1.0-alpha-6.jar
And I tried the following:
$${libs.cargo-core-uberjar-1.0-alpha-6.classpath}
${libs.cargo-core-uberjar-1.0-alpha-6.classpath}
$${libs.cargo-ant-1.0-alpha-6.classpath}
${libs.cargo-ant-1.0-alpha-6.classpath}
$${libs.commons-discovery-0.4.classpath}
${libs.commons-discovery-0.4.classpath}
$${libs.commons-logging-1.1.classpath}
${libs.commons-logging-1.1.classpath}
$${libs.dom4j-1.6.1.classpath}
${libs.dom4j-1.6.1.classpath}
$${libs.jaxen-1.1-beta-8.classpath}
${libs.jaxen-1.1-beta-8.classpath}
$${libs.cargo-core-container-glassfish-1.0-alpha-6.classpath}
${libs.cargo-core-container-glassfish-1.0-alpha-6.classpath}
Where libs.xxx.classpath refers the the jar file for the libraries mentioned. I continue to get the same errors:
org.codehaus.cargo.container.ContainerException: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish2], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it?
at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:143)
at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:356)
at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:343)
at org.codehaus.cargo.ant.ConfigurationElement.createConfiguration(ConfigurationElement.java:201)
at org.codehaus.cargo.ant.CargoTask.makeContainer(CargoTask.java:751)
at org.codehaus.cargo.ant.CargoTask.execute(CargoTask.java:449)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor881.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:273)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:499)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Any hints?
Posted by: christopherrued on June 24, 2009 at 09:19 AM
-
It looks like the form ate my XML. The short of it is that I'm using the suggested cargo taskdef and and tasks as mentioned in the description and still get the same exception :-( .... thanks
Posted by: christopherrued on June 24, 2009 at 09:21 AM
-
No, the ID is correct --- I'm using it myself. Please use the CARGO issue tracker to report problems in glassfish cargo support. A blog comment section is not a good place for user support.
Posted by: kohsuke on June 25, 2009 at 09:29 AM
|