{"id":793,"date":"2010-09-12T07:43:00","date_gmt":"2010-09-12T07:43:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/cesardelatorre\/2010\/09\/12\/developing-and-deploying-java-tomcat-apps-into-windows-azure\/"},"modified":"2010-09-12T07:43:00","modified_gmt":"2010-09-12T07:43:00","slug":"developing-and-deploying-java-tomcat-apps-into-windows-azure","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/developing-and-deploying-java-tomcat-apps-into-windows-azure\/","title":{"rendered":"Developing and Deploying Java-Tomcat apps into Windows Azure"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7652.image_621251FF.png\"><img decoding=\"async\" height=\"82\" width=\"508\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1563.image_thumb_2C4CE6D8.png\" alt=\"image\" border=\"0\" title=\"image\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a> <\/p>\n<p>As you may know, Windows Azure is a multi-platform environment, so we can run many other languages\/platforms other than .NET, like Java, PHP, Ruby, etc., and even using a whole Web-AppServer like Apache Tomcat, a DBMS like MySQL, and using IDEs like ECLIPSE. You can get more info about this here:<\/p>\n<p><a href=\"http:\/\/www.microsoft.com\/windowsazure\/interop\/\">http:\/\/www.microsoft.com\/windowsazure\/interop\/<\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1884.clip_image0015_1BF16F1F.png\"><img decoding=\"async\" height=\"276\" width=\"517\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1401.clip_image0015_thumb_056EAACB.png\" alt=\"clip_image001[5]\" border=\"0\" title=\"clip_image001[5]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>So, in this case, what I wanna show in this post is how you can develop and deploy a simple JAVA app (.JSP and SERVLET app) into Windows Azure (I&rsquo;ll show it into the Windows Azure local Dev-Fabric but also into the real Windows Azure cloud in the Internet).<\/p>\n<p>There are a few steps we need to accomplish, like installing Java SDK, Tomcat, etc. This is the software I installed in my dev machine (a Windows 7 machine):<\/p>\n<h4>SOFTWARE INSTALLATION<\/h4>\n<p>Regarding base software installation (Java, Tomcat &amp; Eclipse), it is critical that you install versions that match each other, especially talking about the processor version (x86 or x64). In my case, all versions that I installed are x86 (Even though my Windows 7 is a x64 version, there&rsquo;s no problem with that). <\/p>\n<p>So, I installed the following <b>software versions<\/b>:<\/p>\n<p><b>JDK 6 Update 21 (STANDARD) Windows <span style=\"text-decoration: underline\">x86<\/span><\/b><\/p>\n<p><a href=\"https:\/\/cds.sun.com\/is-bin\/INTERSHOP.enfinity\/WFS\/CDS-CDS_Developer-Site\/en_US\/-\/USD\/ViewProductDetail-Start?ProductRef=jdk-6u21-oth-JPR@CDS-CDS_Developer\">https:\/\/cds.sun.com\/is-bin\/INTERSHOP.enfinity\/WFS\/CDS-CDS_Developer-Site\/en_US\/-\/USD\/ViewProductDetail-Start?ProductRef=jdk-6u21-oth-JPR@CDS-CDS_Developer<\/a><\/p>\n<p><b>Eclipse IDE for Java EE Developers (GALILEO SR2) <\/b><\/p>\n<p><a href=\"http:\/\/www.eclipse.org\/downloads\/packages\/eclipse-ide-java-ee-developers\/galileosr2\">http:\/\/www.eclipse.org\/downloads\/packages\/eclipse-ide-java-ee-developers\/galileosr2<\/a><\/p>\n<p><b><\/b><\/p>\n<p><b>Apache Tomcat 6.0.29<\/b><\/p>\n<p>IMPORTANT: Download the <b>Windows zipversion<\/b>. In my case, the &lsquo;<i>32-bit Windows zip<\/i>&rsquo; version, from the following URL:<\/p>\n<p><a href=\"http:\/\/tomcat.apache.org\/download-60.cgi\">http:\/\/tomcat.apache.org\/download-60.cgi<\/a><\/p>\n<p>Do not install the &lsquo;32-bit\/64-bit Windows Service Installer&rsquo;, as this is the TomCat <i>Windows Service<\/i> version, and you won&rsquo;t be able to deploy a Windows\/NT Service in Windows Azure PaaS. We need the &lsquo;process\/command&rsquo; version of Apache Tomcat.<\/p>\n<p>Then, just unzip Tomcat in your selected directory. <\/p>\n<p>In order to run Tomcat, we also need to set the JRE_HOME environment Variable to the JAVA SDK directory. In my case, &ldquo;C:\\Program Files (x86)\\Java\\jdk1.6.0_21&rdquo;:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1016.clip_image0036_07E7B6BC.jpg\"><img decoding=\"async\" height=\"284\" width=\"468\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2577.clip_image0036_thumb_7DD31590.jpg\" alt=\"clip_image003[6]\" border=\"0\" title=\"clip_image003[6]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p><b>Install the Windows Azure Tools for ECLIPSE: <\/b><\/p>\n<p>Once you have Eclipse already installed, run Eclipse and install the &lsquo;<b>Windows Azure Tools for ECLIPSE<\/b>&rsquo; from Eclipse itself: <\/p>\n<p>&#8211;&gt; Eclipse&#8211;&gt;Help&#8211;&gt;Install New Software &#8211;&gt; Download Windows Azure Tools for ECLIPSE by clicking on <b>Add<\/b>, giving a name &lsquo;Windows Azure Tools for Eclipse&rsquo; &#8211;&gt; Location: <a href=\"http:\/\/www.windowsazure4e.org\/update\">http:\/\/www.windowsazure4e.org\/update<\/a> &#8211;&gt; Select <b>Windows Azure Java SDK<\/b>, like you can see down-below: <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2313.clip_image0055_01FCED56.jpg\"><img decoding=\"async\" height=\"373\" width=\"470\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6138.clip_image0055_thumb_0475F947.jpg\" alt=\"clip_image005[5]\" border=\"0\" title=\"clip_image005[5]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>Then, almost &ldquo;Next-Next-Next&rdquo;&hellip;<\/p>\n<p><b>Windows Azure Tomcat Solution Accelerator<\/b><\/p>\n<p>Download and unpack the &lsquo;Windows Azure Tomcat Solution Accelerator&rsquo;. You can get it from here (in my case, I used the x86 version, to match the other x86 versions):<\/p>\n<p><a href=\"http:\/\/code.msdn.microsoft.com\/winazuretomcat\/Release\/ProjectReleases.aspx?ReleaseId=3550\">http:\/\/code.msdn.microsoft.com\/winazuretomcat\/Release\/ProjectReleases.aspx?ReleaseId=3550<\/a><\/p>\n<h4>Java Demo-App creation<\/h4>\n<p>&#8211; Create a New Project in Eclipse: File&#8211;&gt;New&#8211;&gt;Other&#8211;&gt;Web&#8211;&gt;Dynamic Web Project &#8211;&gt; Set a name &#8211;&gt; &ldquo;HelloWorld&rdquo; &#8211;&gt; Create<\/p>\n<p>&#8211; Then we need to add the external JARs for JSP and Servlets support:<\/p>\n<p>&#8211; Project Properties &#8211;&gt; Java Build Path &#8211;&gt; Libraries &#8211;&gt; Add External JARs &#8211;&gt; My Compurtes-HardDrive&#8211;&gt; Eclipse folders&#8211;&gt; C:\\JavaEnv\\eclipse\\plugins &#8211;&gt;javax.servlet.jsp_2.0.0.v200806031607.jar AND javax.servlet_2.5.0.v200910301333.jar files:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6644.clip_image0075_4C740563.jpg\"><img decoding=\"async\" height=\"368\" width=\"500\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8371.clip_image0075_thumb_1E3A09A9.jpg\" alt=\"clip_image007[5]\" border=\"0\" title=\"clip_image007[5]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; If we would want to access Windows Azure storage (Blobs\/Queues\/Tables) from Java we&rsquo;d need to add the following JAR: <b>org.soyatec.windows.azure.java_1.0.0.201002091324<\/b><\/p>\n<p>&#8211; But in this case I just want to run a standard and simple JSP and SERVLET App. <\/p>\n<p>&#8211; Then, OK&#8211;&gt;OK.<\/p>\n<p>&#8211; Now, we add a simple .JSP page:<\/p>\n<p>&#8211; Expand Project &#8211;&gt; New &#8211;&gt; .JSP &#8211;&gt; Name: &ldquo;index.jsp&rdquo; &#8211;&gt; <\/p>\n<p>&#8211; We add its code, very simple HTML form code that will call\/execute our future SERVLET:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3581.clip_image0095_3B5FB1B3.jpg\"><img decoding=\"async\" height=\"331\" width=\"545\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6746.clip_image0095_thumb_03C9F0C5.jpg\" alt=\"clip_image009[5]\" border=\"0\" title=\"clip_image009[5]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Now, we cr&eacute;ate our SERVLET project: <\/p>\n<p>&#8211; From Eclipse, New&#8211;&gt;Other&#8211;&gt;Web&#8211;&gt;Servlet<\/p>\n<p>&#8211; Dialogo SERVLET &#8211;&gt;<\/p>\n<p>o Java Package &#8211;&gt; Specify a selected name for your Java Package, like &ldquo;MyJavaPackage&rdquo;<\/p>\n<p>o Class Name: &#8211;&gt; Specify &ldquo;HelloWorldServlet&rdquo;<\/p>\n<p>&#8211; Next<\/p>\n<p>&#8211; Add description &#8211;&gt; &ldquo;Simple demo Servlet App&rdquo;<\/p>\n<p>&#8211; Next<\/p>\n<p>&#8211; Methods &#8211;&gt; DoPost &amp; DoGet<\/p>\n<p>&#8211; &#8211;&gt; Click FINISH<\/p>\n<p>&#8211; Now, within the doPost() method we introduce our &lsquo;process&rsquo; code. We could put it in a different method, but for this short demo, we can directly put it there, within the doPost(): <\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">\n<tbody>\n<tr>\n<td width=\"576\" valign=\"top\">\n<p><span style=\"font-family: Courier New;font-size: x-small\">package MyJavaPackage;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">import java.io.IOException;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">import java.io.PrintWriter;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">import javax.servlet.ServletException;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">import javax.servlet.http.HttpServlet;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">import javax.servlet.http.HttpServletRequest;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">import javax.servlet.http.HttpServletResponse;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">\/**<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">* Servlet implementation class HelloWorldServlet<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">*\/<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">public class HelloWorldServlet extends HttpServlet {<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">private static final long serialVersionUID = 1L;<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">public HelloWorldServlet() {<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">\/\/ TODO Auto-generated constructor stub<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">}<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">\/\/ TODO Auto-generated method stub<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">}<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">response.setContentType(&#8220;text\/html;charset=UTF-8&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">PrintWriter out = response.getWriter();<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">String fullName = request.getParameter(&#8220;fullname&#8221;).toString();<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;html&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;head&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;title&gt;Bienvenido&lt;\/title&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;\/head&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;body&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;p&gt;Hi &#8221; + fullName + &#8220;, greetings from JAVA Server environment!! &lt;\/p&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;\/body&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.println(&#8220;&lt;\/html&gt;&#8221;);<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">out.close();<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">}<\/span><\/p>\n<p><span style=\"font-family: Courier New;font-size: x-small\">}<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#8211; You can see similar code in Eclipse:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0880.clip_image0114_15C60E85.jpg\"><img decoding=\"async\" height=\"267\" width=\"497\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2451.clip_image0114_thumb_45347D51.jpg\" alt=\"clip_image011[4]\" border=\"0\" title=\"clip_image011[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Import PrintWriter option using the rightClick mouse context.<\/p>\n<p>&#8211; START Aapche TomCat up:<\/p>\n<p>&#8211; From the Command-Prompt, within the Tomcat&rsquo;s directory, just type &rdquo;<b>startup.bat&rdquo;<\/b>:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1374.clip_image0134_3B8C0F1B.jpg\"><img decoding=\"async\" height=\"177\" width=\"510\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8156.clip_image0134_thumb_675C630A.jpg\" alt=\"clip_image013[4]\" border=\"0\" title=\"clip_image013[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; From ECLIPSE, I EXPORT my Project as a WAR FILE: <\/p>\n<p>&#8211; RightClick on Project&#8211;&gt;Export&#8211;&gt;WAR FILE<\/p>\n<p>o Destination, in my case: <b>E:\\JavaEnv\\apache-tomcat-6.0.29-windows-x86\\webapps<\/b> &#8211;&gt; and ROOT.WAR as my filename, so it will run as default webapp.<\/p>\n<p>o Check Overwrite Existing Files<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6505.clip_image0154_16CAD1D7.jpg\"><img decoding=\"async\" height=\"385\" width=\"463\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3465.clip_image0154_thumb_590DC44D.jpg\" alt=\"clip_image015[4]\" border=\"0\" title=\"clip_image015[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; And finally, test the default page (my .JSP page should be executed):<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0654.clip_image0174_1BBCE9B9.jpg\"><img decoding=\"async\" height=\"286\" width=\"461\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3312.clip_image0174_thumb_1EA2289F.jpg\" alt=\"clip_image017[4]\" border=\"0\" title=\"clip_image017[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Write any name and submit to the SERVLET, and see results:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8686.clip_image0194_5C4F105B.jpg\"><img decoding=\"async\" height=\"259\" width=\"450\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0184.clip_image0194_thumb_32F7C85D.jpg\" alt=\"clip_image019[4]\" border=\"0\" title=\"clip_image019[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; OK, so our Java app is running now on a regular Apache TomCat (In a Apache Command process).<\/p>\n<h4>Deploying the App to Windows Azure local Development-Fabric<\/h4>\n<p>&#8211; Open CMD from Windows Azure SDK (Programs&#8211;&gt; Windows Azure SDK v1.2&#8211;&gt; Windows Azure SDK Command Prompt)<\/p>\n<p>&#8211; Move to the directory where I have unpacked the <b><i>Windows Azure Tomcat Solution Accelerator<\/i><\/b>. In my case:<\/p>\n<p>&#8211; cd E:\\JavaEnv\\WATomcatAccelerator_x86\\Tomcat<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7610.clip_image0214_57A8DFD4.jpg\"><img decoding=\"async\" height=\"107\" width=\"638\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7446.clip_image0214_thumb_43AF4D3E.jpg\" alt=\"clip_image021[4]\" border=\"0\" title=\"clip_image021[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; We have 3 Command files (Buildme.cmd, Packme.cmd and Runme.cmd):<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4401.clip_image0234_2CA0CC02.jpg\"><img decoding=\"async\" height=\"284\" width=\"558\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1777.clip_image0234_thumb_5F242974.jpg\" alt=\"clip_image023[4]\" border=\"0\" title=\"clip_image023[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; <b>Buildme.cmd<\/b> creates\/builds our solution. In this step we&rsquo;ll need to provide the Apache-tomcat path, and the Java runtime path. It gives us complete control as we can deploy any particular Tomcat or Java runtime version.<\/p>\n<p>&#8211; The <b>Runme.cmd<\/b> command deploys and runs our app and base software into Windows Azure DEVELOPMENT fabric. It moves Tomcat and Java runtime into WA dev-fabric local storage, and also, our app.<\/p>\n<p>&#8211; Next thing we need to to is to configure TomCat to listen in the right TCP port. In WA we have a load-balancer for all our VM instances, but we need to run Tomcat in any other port than port 80. We need to configure it so the Load-Balancer can &lsquo;talk&rsquo; to TomCat.<\/p>\n<p>&#8211; Next thing we need to do is to start TomCat Service. <\/p>\n<p>&#8211; And finally it&rsquo;s going to monitor TomCat, so if for some reason TomCat crashes, then WA will be notified and we can re-start a WE node, etc.<\/p>\n<h5>STEP 1: Building the solution: Run the BUILDME.CMD<\/h5>\n<p>&#8211; The Buildme.cmd batch file which is available in the root folder of the solution generates the CSX folder. This batch file should be executed only from the Windows Azure SDK command prompt. On executing this, it checks if the Tomcat and Java binaries are present in the required directories. If not, it prompts for the path to the binaries and the user needs to give the path to the binaries folder (for e.g. E:\\Binaries\\Tomcat). On a successful build, it generates the CSX folder under the root folder of the solution. This is required to run the solution in development fabric.<\/p>\n<p>&#8211; It first asks for the tomcat binaries, so we provide it (E:\\JavaEnv\\apache-tomcat-6.0.29-windows-x86):<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8055.clip_image0254_3C7FEAF9.jpg\"><img decoding=\"async\" height=\"347\" width=\"542\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1780.clip_image0254_thumb_2A077477.jpg\" alt=\"clip_image025[4]\" border=\"0\" title=\"clip_image025[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Then, it asks for the Java runtime binaries path, in my case &ldquo;C:\\Program Files (x86)\\Java\\jre6&rdquo;:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3757.clip_image0274_2DC51947.jpg\"><img decoding=\"async\" height=\"148\" width=\"599\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4331.clip_image0274_thumb_325B2401.jpg\" alt=\"clip_image027[4]\" border=\"0\" title=\"clip_image027[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<h5>STEP 2: Running the solution (WA development fabric): Run the RUNME.CMD<\/h5>\n<p>&#8211; Now we build the app with the <strong>Runme.cmd<\/strong> command file:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2287.clip_image0294_01E49F8B.jpg\"><img decoding=\"async\" height=\"232\" width=\"604\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7802.clip_image0294_thumb_58212497.jpg\" alt=\"clip_image029[4]\" border=\"0\" title=\"clip_image029[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; It deploys JRE, Tomcat and our App into the WA Dev-Fabric, and finally it starts TomCat:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2625.clip_image0314_5597F2D9.jpg\"><img decoding=\"async\" height=\"497\" width=\"590\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7827.clip_image0314_thumb_77BFD892.jpg\" alt=\"clip_image031[4]\" border=\"0\" title=\"clip_image031[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Now we go to the App-Dev-Fabric where we can see it running:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2211.clip_image0334_3FDD6EA2.jpg\"><img decoding=\"async\" height=\"176\" width=\"593\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1157.clip_image0334_thumb_6FB81063.jpg\" alt=\"clip_image033[4]\" border=\"0\" title=\"clip_image033[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Then we can go and use any Browser to run our app. We need to specify the IP address and TCP port where WA-Dev-Fabric started TomCat, that in my case is, <b>http:\/\/127.0.0.1:81<\/b>:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4705.clip_image0354_42567A93.jpg\"><img decoding=\"async\" height=\"245\" width=\"571\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5488.clip_image0354_thumb_1826CCAB.jpg\" alt=\"clip_image035[4]\" border=\"0\" title=\"clip_image035[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; So finally we can see our Java app running on TomCat and Windows Azure local Development Fabric:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0676.clip_image0374_2E2D383D.jpg\"><img decoding=\"async\" height=\"287\" width=\"575\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3225.clip_image0374_thumb_12A8363A.jpg\" alt=\"clip_image037[4]\" border=\"0\" title=\"clip_image037[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Next step would be uploading our app to Windows Azure cloud in the Internet.<\/p>\n<h5>STEP 3: Uploading the solution to Windows Azure cloud in the Internet<\/h5>\n<p>&#8211; The <strong>Packme.cmd<\/strong> batch file which is available in the root folder of the solution generates the Tomcat.cspkg for the solution under the root folder itself. This batch file should be executed only from the Windows Azure SDK command prompt. . This package along with the service configuration file (.cscfg) is used for deploying the solution on the cloud. The package file and service configuration file are required to deploy the solution on cloud. Once the package is deployed on cloud, the application can be accessed via the following URLs. <\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">\n<tbody>\n<tr>\n<td width=\"91\" valign=\"top\">\n<p><b>Application<\/b><\/p>\n<\/td>\n<td width=\"266\" valign=\"top\">\n<p><b>Staging URL<\/b><\/p>\n<\/td>\n<td width=\"281\" valign=\"top\">\n<p><b>Production URL<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"91\" valign=\"top\">\n<p>Admin page<\/p>\n<\/td>\n<td width=\"266\" valign=\"top\">\n<p>http:\/\/&lt;deploymentid&gt;.cloudapp.net<\/p>\n<\/td>\n<td width=\"281\" valign=\"top\">\n<p>http:\/\/&lt;servicename&gt;.cloudapp.net<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#8211; <b>NOTE: <\/b>The ServiceDefinition.csdef and ServiceConfiguration.cscfg files should be kept under the root folder of solution for the Buildme.cmd, Packme.cmd and Runme.cmd to execute properly. So if any change has been done to these files in the solution, the latest should be copied to the root folder too.<\/p>\n<p>&#8211; So, when we run the <b>Packme.cmd<\/b>, we generate the WA package needed to upload it:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5314.clip_image0394_6231B1C3.jpg\"><img decoding=\"async\" height=\"316\" width=\"649\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1425.clip_image0394_thumb_18532A13.jpg\" alt=\"clip_image039[4]\" border=\"0\" title=\"clip_image039[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; We can see in our directory that there&rsquo;s been a new <b>.cspkg<\/b> Windows Azure file generated for us: <\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6708.clip_image0414_3C2BDBA0.jpg\"><img decoding=\"async\" height=\"384\" width=\"651\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0844.clip_image0414_thumb_2E0CECA3.jpg\" alt=\"clip_image041[4]\" border=\"0\" title=\"clip_image041[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Take into account that because of we need to upload JRE &amp; TomCat, our app&rsquo;s package is quite heavy (around 56 Mb), and therefore, deployment upload will take long. One workaround for that is uploading it just once to a Windows Azure BLOB and then we can deploy it from there much faster (in case we delete\/upload same app&rsquo;s version many times).<\/p>\n<p>&#8211; So now, we just need to upload it to the Production or staging environment in WA cloud through the WA dev portal:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2502.clip_image0434_48A962EF.jpg\"><img decoding=\"async\" height=\"412\" width=\"666\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8880.clip_image0434_thumb_5EAFCE81.jpg\" alt=\"clip_image043[4]\" border=\"0\" title=\"clip_image043[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; But, I really recommend uploading it first to a Windows Azure BLOB, for instance, using the <b><i>Azure Storage Explorer<\/i><\/b>:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4505.clip_image0454_13F8E0E7.jpg\"><img decoding=\"async\" height=\"395\" width=\"670\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8880.clip_image0454_thumb_4A868C2B.jpg\" alt=\"clip_image045[4]\" border=\"0\" title=\"clip_image045[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Then, in this other way, the deployment would be like the following:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3527.clip_image0474_7C9DB6A8.jpg\"><img decoding=\"async\" height=\"431\" width=\"687\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1462.clip_image0474_thumb_39DE6B70.jpg\" alt=\"clip_image047[4]\" border=\"0\" title=\"clip_image047[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; And selecting the files from within a BLOB container instead of my local PC:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3531.clip_image0494_76B2ED42.jpg\"><img decoding=\"async\" height=\"437\" width=\"688\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2553.clip_image0494_thumb_66577589.jpg\" alt=\"clip_image049[4]\" border=\"0\" title=\"clip_image049[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Then, we can see it uploading it (from local or from Blob container):<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0410.clip_image0514_4921A7B2.jpg\"><img decoding=\"async\" height=\"482\" width=\"691\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5684.clip_image0514_thumb_4D4B7F77.jpg\" alt=\"clip_image051[4]\" border=\"0\" title=\"clip_image051[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; And after a few minutes (after uploading the package, which would be much faster from Azure Blob), we&rsquo;ll see it deploying:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6675.clip_image0534_54A73F24.jpg\"><img decoding=\"async\" height=\"394\" width=\"619\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7750.clip_image0534_thumb_670F8FD9.jpg\" alt=\"clip_image053[4]\" border=\"0\" title=\"clip_image053[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; Once it is deployed, we need to start the node\/virtual machine:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5518.clip_image0554_362CD86E.jpg\"><img decoding=\"async\" height=\"501\" width=\"619\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8345.clip_image0554_thumb_325F0DD1.jpg\" alt=\"clip_image055[4]\" border=\"0\" title=\"clip_image055[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; And finally, after some more minutes (wait until it reaches the &lsquo;Ready&rsquo; state, starting on &lsquo;Initializing&rsquo; state, then &lsquo;Busy&rsquo; state and finally &lsquo;Ready&rsquo; state), it will be up &amp; running in our Windows Azure cloud:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7367.clip_image0574_03B8DF22.jpg\"><img decoding=\"async\" height=\"415\" width=\"628\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2480.clip_image0574_thumb_0BED04B9.jpg\" alt=\"clip_image057[4]\" border=\"0\" title=\"clip_image057[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211;<\/p>\n<p>&#8211; And now, just execute the app from your Windows Azure URL. In my case: <a href=\"http:\/\/javatomcatdemo.cloudapp.net\/\">http:\/\/javatomcatdemo.cloudapp.net\/<\/a><\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5226.clip_image0594_08F7A006.jpg\"><img decoding=\"async\" height=\"317\" width=\"578\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7608.clip_image0594_thumb_7BB116F2.jpg\" alt=\"clip_image059[4]\" border=\"0\" title=\"clip_image059[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; And then my SERVLET execution:<\/p>\n<p>&#8211; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8688.clip_image0614_62F1C9E2.jpg\"><img decoding=\"async\" height=\"242\" width=\"538\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7380.clip_image0614_thumb_27BDEE17.jpg\" alt=\"clip_image061[4]\" border=\"0\" title=\"clip_image061[4]\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/><\/a><\/p>\n<p>&#8211; COOL!. Now you could try with any other Java-TomCat App. (Web-Service, etc.).<\/p>\n<p>&nbsp;<\/p>\n<h4>Related Links<\/h4>\n<p><b>WINDOWS AZURE INTEROP<\/b><\/p>\n<p><a href=\"http:\/\/www.microsoft.com\/windowsazure\/interop\/\">http:\/\/www.microsoft.com\/windowsazure\/interop\/<\/a><\/p>\n<p><b>INTEROPERABILITY BRIDGES &#8211; LIST<\/b><\/p>\n<p><a href=\"http:\/\/www.interoperabilitybridges.com\/Projects.aspx\">http:\/\/www.interoperabilitybridges.com\/Projects.aspx<\/a><\/p>\n<p><b><\/b><\/p>\n<p><b>TomCat Solution Accelerator<\/b><\/p>\n<p><a href=\"http:\/\/code.msdn.microsoft.com\/winazuretomcat\">http:\/\/code.msdn.microsoft.com\/winazuretomcat<\/a><\/p>\n<p><b>AzureRunMe <\/b><\/p>\n<p><a href=\"http:\/\/azurerunme.codeplex.com\/\">http:\/\/azurerunme.codeplex.com\/<\/a><\/p>\n<p><b>Windows Azure Tools for Eclipse (PHP)<\/b><\/p>\n<p><a href=\"http:\/\/www.interoperabilitybridges.com\/projects\/windows-azure-tools-for-eclipse.aspx\">http:\/\/www.interoperabilitybridges.com\/projects\/windows-azure-tools-for-eclipse.aspx<\/a><\/p>\n<p><b>Windows Azure SDK for Java<\/b><\/p>\n<p><a href=\"http:\/\/www.interoperabilitybridges.com\/projects\/windows-azure-sdk-for-java.aspx\">http:\/\/www.interoperabilitybridges.com\/projects\/windows-azure-sdk-for-java.aspx<\/a><\/p>\n<p><b>AppFabric SDK for JAVA<\/b><\/p>\n<p><a href=\"http:\/\/www.jdotnetservices.com\/\">http:\/\/www.jdotnetservices.com\/<\/a><\/p>\n<p><b>TomCat Logs<\/b><\/p>\n<p><a href=\"http:\/\/code.msdn.microsoft.com\/azurediag\">http:\/\/code.msdn.microsoft.com\/azurediag<\/a><\/p>\n<p><b>Windows Azure Mediawiki <span style=\"text-decoration: underline\">MySQL<\/span> Solution Accelerator<\/b><\/p>\n<p><a href=\"http:\/\/code.msdn.microsoft.com\/winazuremediawiki\">http:\/\/code.msdn.microsoft.com\/winazuremediawiki<\/a><\/p>\n<p><b>Windows Azure <span style=\"text-decoration: underline\">Jetty<\/span> Solution Accelerator<\/b><\/p>\n<p><a href=\"http:\/\/code.msdn.microsoft.com\/winazurejetty\">http:\/\/code.msdn.microsoft.com\/winazurejetty<\/a><\/p>\n<p><b>eBay&rsquo;s page for iPad listings<\/b> &mdash; <a href=\"http:\/\/ipad.ebay.com\/\">http:\/\/ipad.ebay.com<\/a>&mdash; (hosted on the public Windows Azure platform). You may need iPad to view the page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As you may know, Windows Azure is a multi-platform environment, so we can run many other languages\/platforms other than .NET, like Java, PHP, Ruby, etc., and even using a whole Web-AppServer like Apache Tomcat, a DBMS like MySQL, and using IDEs like ECLIPSE. You can get more info about this here: http:\/\/www.microsoft.com\/windowsazure\/interop\/ So, in this [&hellip;]<\/p>\n","protected":false},"author":362,"featured_media":12806,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[114],"class_list":["post-793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cesardelatorre","tag-window-azure"],"acf":[],"blog_post_summary":"<p>As you may know, Windows Azure is a multi-platform environment, so we can run many other languages\/platforms other than .NET, like Java, PHP, Ruby, etc., and even using a whole Web-AppServer like Apache Tomcat, a DBMS like MySQL, and using IDEs like ECLIPSE. You can get more info about this here: http:\/\/www.microsoft.com\/windowsazure\/interop\/ So, in this [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts\/793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/comments?post=793"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts\/793\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/media\/12806"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/media?parent=793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/categories?post=793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/tags?post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}