MSDN Archive Home
Help and FAQs
Starter Kit for deploying Tomcat-based Java solutions on Windows Azure
All Resource Updates
Change History (all pages)
Resource Page Description
This is a modified version of Windows Azure Tomcat Solution Accelerator. See http://code.msdn.microsoft.com/winazuretomcat for the description, disclaimers and credits for the original project.
When working on migration of real-life Tomcat Java application to Windows Azure, the original Solution Accelerator (version from November 2009) was helpful in getting the migration project off the ground. However, some design choices and implementation of the original Solution Accelerator left a lot of room for improvements and optimization.
In particular, the requirement of deploying huge packages that consisted of JRE and Tomcat binaries as well as the actual Tomcat application (war file and often by accident also extracted java class files) was almost a showstopper, especially when the application was actively being developed and changed, so there was a need for frequent re-packaging and re-deployment.
This Starter Kit addresses the above problem.
It does it by separating artifacts into two parts:
1. All that is needed to ‘bootstrap’ Java Tomcat solution: worker role binaries and config files and also JRE and Tomcat binaries. This is essentially static (until you want to use a different version of JRE or Tomcat) and can be packaged and deployed as a Windows Azure hosted service only once
2. War file that is retrieved by the ‘bootstraper’ (the worker role described above) from a blob in Windows Azure storage specified in the worker role config. This retrieval is done when the worker role starts.
This approach eliminates the need to rebuild and re-deploy huge packages every time there is a need to test a new version of the complete solution i.e. a new war file.
This starter kit is just a sample. It can be used as a basis for a package that can be deployed to Windows Azure Storage only once. Then when there is a need to test a new war file, all that is needed is to upload the war file to Windows Azure Blob storage.
This starter kit supports having multiple versions of war file in the blob storage and choosing which one should be used by changing the configuration file for the worker role. This can be done either through Windows Azure Portal or through API or PowerShell commandlets.
Here are the steps to use the starter kit sample:
1. From Windows Azure SDK Command prompt run buildme.cmd from the location where the sample was extracted to. It is similar process to the original Windows Azure Tomcat Solution Accelerator and the goal is to create a copy of Tomcat and JRE binaries.
2. Using your favorite tool for exploring Windows Azure storage and blobs, create a blob container and upload your war file there.
3. Edit Tomcat\ServiceConfiguration.cscfg file
<Setting name="DiagnosticsConnectionString" value="DefaultEndpointsProtocol=https;AccountName=!!!YOUR
<Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=!!!YOUR
<Setting name="WarFileBlobContainer" value="samplecontainer1" />
<Setting name="WarFileBlobName" value="v184.108.40.206$sample.war" />
<Setting name="WarFileTargetFileName" value="sample.war" />
Enter your Windows Azure Storage Account Name and Account Key as values for DiagnosticsConnectionString and DataConnectionString.
Enter the Blob container name and the name of the file you uploaded as the values for WarFileBlobContainer and WarFileBlobName respectively.
Enter the file name that you want the uploaded war file to have when it is downloaded to your instance of Tomcat as the value for WarFileTargetFileName.
Please note that you can use either various containers or simply a naming convention for files uploaded to blob to help you with versioning.
4. Build and publish the solution (for instance using Visual Studio)
5. Deploy the published package and configuration file to Windows Azure and test it
Feb 20 2010 at 1:26 AM
, version 7
Aug 4 2010 at 10:35 AM
The starter kit is in the Download section of this page. This is a separate and standalone download.
Also, you will need to open the Visual Studio Project under the TomcatWorkerRole folder and build it. That will create the necessary dll in TomcatWorkerRole/bin/Release
Sign in to add a comment
Fri Feb 5 2010 at 8:00 AM
Related Resource Pages
Windows Azure Diagnostics and log files that are kept open, such as Tomcat logs
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.