Websphere deployments using cargo, the cargo daemon and gradle

230 views
Skip to first unread message

Ronan Derby

unread,
Oct 12, 2015, 4:56:00 PM10/12/15
to Codehaus Cargo
Hi All,

Hoping you can point me in the right direction with an issue I'm having using cargo and WebSphere.

In my team we've been using the cargo daemon successfully with gradle and tomcat for well over a year and it's been doing a great job of simplifying deployments.

Just in the last week or so we've been looking at trying to get the cargo daemon setup with WebSphere to support deployments of one of our applications, and have hit a few issues. Am looking for some pointers as to how best go about troubleshooting this.

We are using the latest version of the cargo daemon (1.4.16) and have it successfully setup with a WebSphere 8.5.5 application server instance. We've setup the container configuration in the Cargo Daemon for websphere to use the WebSphere85xInstalledLocalContainer, and are able to successfully start and stop the websphere server instance using the cargo daemon UI. We've also been able to plug in the start/stop of the container to our gradle build.

I can see in the cargo documentation a distinction between 'local' and 'remote' containers. With WebSphere can you tell me what impact this distinction has, from looking at the documentation, as far as I understand it, when using WebSphere with cargo, a 'remote' deployment is not supported. I already have the cargo daemon and websphere running on the same server (I presume that should constitute a 'local' deployment? Do I need to be running my build (ant/gradle) on the same server also? I'm using the gradle cargo plugin, which from what I can see is just wrapping the cargo ant library.  So far I've tried a local and remote deployment, and whichever one I try, I'm getting an error that looks like cargo is unable to find the websphere container details to do the deployment to. We're in the process of testing a deploy with just the cargo ant library just to rule out anything with our gradle build, but am just wondering if anyone has an example setup/instructions they could direct me to that might help us?

When I try the cargo redeploy remote option using the gradle cargo plugin I get the below error:

> org.codehaus.cargo.container.ContainerException: Cannot create configuration. There's no registered configuration for the parameters (container [id = [websphere85x], type = [remote]], configuration type [runtime]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it?

If I try the local equivalent, I get a very similar error, but the reference to 'remote', says 'installed'.

> org.codehaus.cargo.container.ContainerException: Failed to create deployer with implementation class org.codehaus.cargo.container.websphere.WebSphere85xInstalledLocalDeployer for the parameters (container [id = [websphere85x]], deployer type [installed]).

If there's nobody out there using gradle with cargo and WebSphere, does someone have an ant based example they could direct me towards (am already looking at the docs on the cargo site).

I've spent a good bit of time reading the documentation and searching the mailing list for others trying to do the same thing, but haven't found much as yet. I presume we're probably missing something here that requires the lookup of the container details as part of the deployment to work?

Would I be better off looking at the WebSphere85xInstalledLocalContainer, the documentation seems to suggest not.

Any pointers in the right direction very much appreciated.

Regards,
Ronan Derby,

S. Ali Tokmen

unread,
Oct 14, 2015, 5:33:31 AM10/14/15
to codehau...@googlegroups.com
Dear Ronan

You are perfectly right: the Codehaus Cargo WebSphere container doesn't support the remote deployer - That's why the WebSphere 8.5.x container page has no Remote Container chapter and the Remote Container row in the Container Features has red X signs. As a result, the workaround would indeed be to use the Cargo Daemon, with the WebSphere container on it.

Hope this helps

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/71662e6b-03ce-49b5-ac72-193a20045b20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ronan Derby

unread,
Oct 14, 2015, 7:31:50 AM10/14/15
to Codehaus Cargo
Hi Savaş Ali Tokmen,

Thanks for the response.

I managed to make some progress with this using the cargo ant plugin running on the same host that Websphere is on (which makes sense given that a local deployment is expected).

An ant setup with this: 

  <cargo containerId="websphere85x" action="@{action}" type="installed" home="/opt/IBM/WebSphere/AppServer/">
        <configuration type="existing" home="/opt/IBM/WebSphere/AppServer/">

I can see output now when the task runs that shows cargo is communicating with Websphere, although its still not doing exactly what I want yet, it's progress.

Is there any way that this API for the purposes of deploying my application can be exercised via the cargo daemon for a server that is already setup, i.e that the cargo daemon does the deployment for me? Or do the Java and ant APIs with a local container always require the deployment to be done from the same server that Websphere is running on.

Ronan

S. Ali Tokmen

unread,
Oct 17, 2015, 2:46:51 AM10/17/15
to codehau...@googlegroups.com
Hi Ronan

Well done :)

Unfortunately we didn't think about a function where the Daemon would serve as an "agent" for remote deployment, it can only start and stop containers. You can actually see the API details on https://codehaus-cargo.github.io/apidocs/index.html?org/codehaus/cargo/tools/daemon/DaemonClient.html and understand full capabilities.

On the other hand, I think the Daemon's start method will actually redeploy the deployables you would send over.
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.

Ronan Derby

unread,
Oct 17, 2015, 7:33:29 AM10/17/15
to Codehaus Cargo
Thanks - I'll give that a go.
Message has been deleted

Ronan Derby

unread,
Nov 4, 2015, 12:22:15 PM11/4/15
to Codehaus Cargo
Managed to get things working with the cargo-daemon, with both websphere and tomcat by using the cargo-ant plugin.

One thing I've noticed, is that it looks like there's a bug in the org.codehaus.cargo.ant.CargoTask in version 1.4.16 in the executeActions() method

Line 678, has 

else if (ACTION_DAEMON_START.equalsIgnoreCase(getAction()))

which presumably should be

else if (ACTION_DAEMON_STOP.equalsIgnoreCase(getAction()))

as the lines inside that block are trying to stop the cargo daemon!

Thanks for the help.

Regards,
Ronan.

S. Ali Tokmen

unread,
Nov 6, 2015, 1:00:57 PM11/6/15
to codehau...@googlegroups.com
Hi Ronan

Good news :) Thanks also for the bug report, CARGO-1348 / The daemon-stop ANT task doesn't stop but rather attempt restart has been submitted and will be fixed with the next release.

Have a great weekend
On 04/11/15 18:20, Ronan Derby wrote:
Managed to get things working with the cargo-daemon, with both websphere and tomcat by using the cargo-ant plugin.

One thing I've noticed, is that it looks like there's a bug in the org.codehaus.cargo.ant.CargoTask in version 1.4.16 in the executeActions() method

Link 678, has 

else if (ACTION_DAEMON_START.equalsIgnoreCase(getAction()))

which presumably should be

else if (ACTION_DAEMON_STOP.equalsIgnoreCase(getAction()))

as the lines inside that block are trying to stop the cargo daemon!

Thanks for the help.

Regards,
Ronan.
On Monday, 12 October 2015 21:56:00 UTC+1, Ronan Derby wrote:
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages