Hello Junie Bonifacio,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Problem
I understand that you are experiencing issues with the deployment of your updated WAR file to Azure App Service running JBoss EAP 7, specifically with JSP changes not being reflected despite various troubleshooting steps.
Solution
Firstly, regarding your question:
Is this a caching issue? And if yes how do I clear and disable the cache?
Based on your description, it does seem likely that a caching issue is involved, especially since old JSP code is appearing after restarts and deployments. However, I will provide detail steps to clear and disable the cache later here.
To resolve this issue, you will need to check couple of things to resolve this:
- Review the deployment logs in Azure App Service to see if there are any errors or warnings during the deployment process that might indicate why the changes are not being applied.
- Try deploying your WAR file using Azure CLI or PowerShell commands to ensure that the deployment process is not the issue. Here is an example using Azure CLI:
az webapp deploy --resource-group <YourResourceGroup> --name <YourAppName> --src-path <path-to-your-war-file>
- Ensure that all instances of your Azure App Service are updated with the new WAR file. Sometimes, one or more instances might not be updated properly.
- Ensure that the
WEBSITE_LOCAL_CACHE_OPTION
andWEBSITE_DYNAMIC_CACHE
settings are correctly applied and that there are no typos or misconfigurations. You can also try settingWEBSITE_LOCAL_CACHE_OPTION
toAlways
orNever
explicitly. - Verify that there are no configuration files or startup scripts overriding your deployment settings. Sometimes, startup scripts can redeploy an old version of the WAR file.
- Consider using a deployment slot for staging your updates. This can help ensure that the changes are correctly applied before swapping them into production.
- Ensure that the WAR file you are deploying contains the updated JSP files. Sometimes, the build process might not include the latest changes. Double-check the contents of the WAR file before deploying.
- Use version numbers in your WAR file name to force a fresh deployment.
az webapp deploy --resource-group <YourResourceGroup> --name <YourAppName> --src-path <path-to-your-war-file>/myapp-v1.war
To Clear Cache
JBoss EAP might be caching the JSP pages. You can try disabling the cache by setting the development
attribute in the JSP configuration to true
. This can usually be done in the jboss-web.xml
file within your WEB-INF
directory:
<jboss-web>
<jsp-configuration>
<development>true</development>
</jsp-configuration>
</jboss-web>
Secondly, manually clear any cache that JBoss might be using. This can be done by removing the contents of the standalone/tmp
, standalone/data
, and standalone/work
directories. To do this use the Kudu console to navigate to the JBoss cache directories and clear them.
- Access Kudu:
https://<your-app-name>.scm.azurewebsites.net/DebugConsole
- Navigate to the cache directories, typically found at
D:\home\site\wwwroot\standalone\tmp
,D:\home\site\wwwroot\standalone\data
, andD:\home\site\wwwroot\standalone\work
. - Delete the contents of these directories.
Thirdly, to clear Azure App Service Cache > in the App Settings > ensure WEBSITE_LOCAL_CACHE_OPTION
is set to Always
or Never
and WEBSITE_DYNAMIC_CACHE
is set to 0
. Double-check these settings in the Azure portal under your App Service's Configuration settings. Perform a full restart of the Azure App Service after clearing cache settings.
- In Azure Portal: Navigate to your App Service > Overview > Restart.
- In Azure CLI:
az webapp restart --name <YourAppName> --resource-group <YourResourceGroup>
To Disabling Cache
In JBoss EAP Configuration you will have to Disable JSP Caching by update your jboss-web.xml
to disable caching for JSP files.
<jboss-web>
<jsp-configuration>
<development>true</development>
</jsp-configuration>
</jboss-web>
Then, configure standalone.xml to ensure JSP recompilation is enabled.
<subsystem xmlns="urn:jboss:domain:web:1.5">
<configuration>
<jsp-configuration development="true"/>
</configuration>
</subsystem>
Secondly, in Azure App Service Settings you will need to Disable Local Cache by verify that WEBSITE_LOCAL_CACHE_OPTION
is set to Never
and WEBSITE_DYNAMIC_CACHE
is set to 0
. This will ensure that no local caching is happening.
- In the Azure portal, navigate to your App Service > Configuration > Application settings.
- Set
WEBSITE_LOCAL_CACHE_OPTION
toNever
. - Set
WEBSITE_DYNAMIC_CACHE
to0
.
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam