Mirko Petrovic
Mirko Petrovic

Reputation: 21

Custom Tomcat configuration on Azure (Platform as a service)

We have recently upgraded our spring boot dependency from 1.3.5 to 1.5.8; on deployment to the Azure hosted Tomcat container, we noticed that the deployments don't start up correctly. Upon further examination of the catalina logs:

org.apache.catalina.startup.ExpandWar.deleteDir could not be completely deleted. The presence of the remaining files may cause problems.

We are aware that the issue can be corrected by adding antiResourceLocking="true" to the context.xml, however since we want to keep our platform as a service, we do not have access to modify this configuration.

Is there a way of setting this configuration in web.config or in some other manner on azure, while maintaining the tomcat container as a service?

Upvotes: 1

Views: 2091

Answers (2)

Mirko Petrovic
Mirko Petrovic

Reputation: 21

So the solution to this problem is to place a context.xml into src/main/webapp/META-INF, as explained here.

The solution is detailed in the Context Container section of Apache Tomcat Configuration reference.

Since we have read access to D:/, I just coppied the context.xml from the Tomcat installation there and modified it by changing <Context antiResourceLocking="true">.

This way, we did not need to install Tomcat from the marketplace or pack it into the war.

Upvotes: 1

Jay Gong
Jay Gong

Reputation: 23792

As I known, we have no permission for operating anything under the path D:\, besides the path D:\home when we use Azure Webapps Service.

If using Tomcat which not from marketplace, the Tomcat path is D:\Program Files (x86)\apache-tomcat-X.0.X which can't be operated by user role and get the administrator permission.

However, creating App with Tomcat from marketplace, Tomcat will exists at the path D:\home\site\wwwroot\bin which you have the configuration permission.

Or , you could publish your own Tomcat instance with your app, then you can edit the config files.

Please refer to web.config setup and tomcat template from here.

Hope it helps you.

Upvotes: 0

Related Questions