none
[Java][Web Apps] Not able to reach Java app deployed on on Azure web app RRS feed

  • Question

  • I have created a web app in Azure and configured it to use Java version 7 and the latest Tomcat 7 available. I configured FTP credentials.<o:p></o:p>

    I followed the documentation (here: https://www.visualstudio.com/en-us/docs/build/apps/java/maven-to-azure to deploy (via FTP) a .war file to the site\wwwroot\webapps directory. When I log in with my browser to look at the files, the correct .war file is located inside the webapps folder and it has expanded (therefore, it looks like the FTP step has succeeded). However, when I go to http://<WEB_APP_NAME>.azurewebsites.net/<WAR_FILE_NAME>,  I'm getting a 404 from Tomcat.

    To rule out a problem with the application, I downloaded the .war and deployed it successfully in a local instance of Tomcat 7.

    Any idea what the issue may be?




    Thursday, June 16, 2016 12:37 AM

Answers

  • Hello,

    Greetings!

    Could you please upload your .war file to tomcats webapps folder ($TOMCAT_HOME/webapps/) and try?

    Once you've uploaded your WAR file to the webapps folder, the Tomcat application server will detect that you've added it and will automatically load it. Note that if you copy files (other than WAR files) to the ROOT directory, the application server will need to be restarted before those files are used. The autoload functionality for the Tomcat Java web apps running on Azure is based on a new WAR file being added, or new files or directories added to the webapps folder.

    You may check the SO thread more details.

    Also, you may check the Kudu console for deployment.

    Hope this helps.

     

    Regards,

    Ashok

     

    If a post answers your question, please click Mark as Answer on that post and Vote as Helpful.


    Thursday, June 16, 2016 12:39 PM
  • Hi,

    Please check the Java version of your local and make sure the webapp on Azure is running the same version of Java as your local.

    Hope it helps.

    Best Regards,

    Peter

    Friday, June 17, 2016 7:49 AM
    Moderator

All replies

  • Hello,

    Greetings!

    Could you please upload your .war file to tomcats webapps folder ($TOMCAT_HOME/webapps/) and try?

    Once you've uploaded your WAR file to the webapps folder, the Tomcat application server will detect that you've added it and will automatically load it. Note that if you copy files (other than WAR files) to the ROOT directory, the application server will need to be restarted before those files are used. The autoload functionality for the Tomcat Java web apps running on Azure is based on a new WAR file being added, or new files or directories added to the webapps folder.

    You may check the SO thread more details.

    Also, you may check the Kudu console for deployment.

    Hope this helps.

     

    Regards,

    Ashok

     

    If a post answers your question, please click Mark as Answer on that post and Vote as Helpful.


    Thursday, June 16, 2016 12:39 PM
  • Hi Ashok,

    Thanks for your assistance.

    I can confirm that I am uploading the war to $TOMCAT_HOME/webapps/ and it is expanding successfully. I also confirmed that I am uploading the file to TOMCAT_HOME  (D:\home\site\wwwroot) by opening the console tool in Azure portal and echoing %TOMCAT_HOME%. However, I can't access the web application in a browser when I go to <WEB_APP_NAME>.azurewebsites.net/<WAR_FILE_NAME>.

    When I go to <WEB_APP_NAME>.azurewebsites.net, I see the blue success screen to indicate the Java web app is online. Interestingly, the variable catalina.base is reported as D:\Program Files (x86)\apache-tomcat-7.0.62, which is not the same directory as $TOMCAT_HOME. I'm wondering if this is expected.

    Thanks,

    Spencer

    Thursday, June 16, 2016 5:57 PM
  • Hi,

    Please check the Java version of your local and make sure the webapp on Azure is running the same version of Java as your local.

    Hope it helps.

    Best Regards,

    Peter

    Friday, June 17, 2016 7:49 AM
    Moderator