Legacy Knowledge Base
Published Jul. 2, 2025

Numerous antiJarLocking warnings

Written By

Anishq Sharma

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • User encounters numerous warning messages regarding the property 'antiJarLocking' when running Liferay 6.2 and upgrading Tomcat 7.0 to Tomcat 8.5 :
    org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property 'antiJARLocking' to 'true' did not find a matching property.

Environment

  • Liferay Portal 6.2

Resolution

  • There are two ways to resolve the issue:
    • First is to manually delete the antiJARLocking="true" property in all of the below files using these commands:
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/oauth-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/sync-web/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/marketplace-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/calendar-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/kaleo-web/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/opensocial-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/web-form-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/resources-importer-web/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/notifications-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/kaleo-designer-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/sync-admin-portlet/META-INF/context.xml
      sed -i '/antiJARLocking="true"/d' $TOMCAT_DIR/webapps/kaleo-forms-portlet/META-INF/context.xml
    • Second and easier way is to create a support ticket asking to get a hotfix for LPS-127995 that would automatically delete the antiJarLocking = "true" property from context.xml file, everytime a LPKG file is deployed.

Additional Information

  • antiJARLocking is an attribute in Tomcat 7, which has been removed in Tomcat 8.
  • Issue is encountered because Tomcat 8 does not use this property.
  • For further reference, please see that the Tomcat 7 context configuration specifies antiJARLocking, while the Tomcat 8 documentation does not. The Tomcat 7 docs specifically mention that:

    antiJARLocking is a subset of antiResourceLocking and therefore, to prevent duplicate work and possible issues, only one of these attributes should be set to true at any one time. 

Did this article resolve your issue ?

Legacy Knowledge Base