File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deployment to tomcat 6 programmatically

 
John Farrel
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am writing a Java system to deploy builds across many tomcat installations, and I'm looking for the cleanest way to do it.
Is there an API for talking to the various tomcat managers where I could undeploy an app and deploy a new version?

John
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17639
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup. I even did a little contributing to it in a way.

There was a JSR for a webapp deployment and control interface: JSR-88, which I think has since been upgraded to a newer JSR. It was based on the idea that every webapp deployment consisted of a deployable unit with container-independent deployment descriptor (WEB-INF/web.xml) and a separate container-dependent deployment descriptor (which for Tomcat is the Context).

So if it amused you, you could write your own deployment program.

But wait - there's more! Ant has a deployment task. Maven has a deployment goal. Tomcat has the ability to invoke the manager as a web service (IIRC). Possibly also via JMX.

In other words, there are more ways to automate than I can easily recall, and those are just the J2EE-approved ways. My own deployments are via OS-native packages (since things like database schema tweaks and construction of external support directories are a bit awkward using only a WAR). I put them on a provisioning server and add them to the server's software inventory profiles.
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A colleague told me weblogic deployment scripts are developed using Python.
Also you can look at how eclipse WTP does deployments.
 
John Farrel
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:Yup. I even did a little contributing to it in a way.

There was a JSR for a webapp deployment and control interface: JSR-88, which I think has since been upgraded to a newer JSR. It was based on the idea that every webapp deployment consisted of a deployable unit with container-independent deployment descriptor (WEB-INF/web.xml) and a separate container-dependent deployment descriptor (which for Tomcat is the Context).

So if it amused you, you could write your own deployment program.

But wait - there's more! Ant has a deployment task. Maven has a deployment goal. Tomcat has the ability to invoke the manager as a web service (IIRC). Possibly also via JMX.

In other words, there are more ways to automate than I can easily recall, and those are just the J2EE-approved ways. My own deployments are via OS-native packages (since things like database schema tweaks and construction of external support directories are a bit awkward using only a WAR). I put them on a provisioning server and add them to the server's software inventory profiles.


Excellent. I had known about ant and maven and my backup was to run these as external processes.
Could you point me to any resource that describes how I can do this in java? What libraries do I need?

thanks,

John

 
Tim Holloway
Saloon Keeper
Pie
Posts: 17639
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I worked with a specific JSR-88 implementation called "Ishmael" for the JOnAS J2EE server. I think that now the client SPI is part of the stock J2EE jar that Sun/Oracle distributes as part of their reference implementation.

Your best bet if you want to roll your own Java client is to get hold of the J2EE SDK and download the JSR-88 specification docs. You might want to pick up the JSR-77 docs as well. JSR-77 is more about control than deployment, but there's some overlap.

Also check out code.google.com and this page: http://tomcat.apache.org/tomcat-5.5-doc/catalina/funcspecs/mbean-names.html

And the master JavaDoc: http://docs.oracle.com/javaee/6/api/javax/enterprise/deploy/model/package-summary.html#package_description

Finally, there's this: http://cargo.codehaus.org/Home

Alternatively, look at the Tomcat Client Deployer, described here: http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html . The Tomcat Client Deployer acts as a client to the Tomcat Manager webapp. Unless I'm mistaken, this is not a JSR-88 deployer, but it probably qualifies as a Web Service-based deployer.

 
John Farrel
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks for all that.

It looks like the fastest way to get this running will be to use codehaus.
Shame that tomcat manager doesn't have a SOAP web service available, because I could get that running very quickly.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17639
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Farrel wrote:
Thanks for all that.

It looks like the fastest way to get this running will be to use codehaus.
Shame that tomcat manager doesn't have a SOAP web service available, because I could get that running very quickly.


Well, i think that Tomcat Manager uses REST, actually.
 
John Farrel
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm looking at my Tomcat installation and can find neither wsdl or wadl for the manager.
Any ideas?

John.
 
John Farrel
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh... I'm too used to SOAP. REST doesn't really work the same way.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic