Suhail Gupta Suhail Gupta - 2 years ago 280
Java Question

What is antiJARLocking attribute?

what does the attribute

mean ? What is it's significance when I turn it to true / false ?

I have seen this attribute in
file of web-application :

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/poll">
<Resource name="jdbc/PollDatasource" auth="Container" type="javax.sql.DataSource"
// etc etc

Answer Source

Tomcat 7

From the Tomcat 7.0 documentation for Context Configuration:

"antiJARLocking - If true, the Tomcat classloader will take extra measures to avoid JAR file locking when resources are accessed inside JARs through URLs. This will impact startup time of applications, but could prove to be useful on platforms or configurations where file locking can occur. If not specified, the default value is false."

(The problem they are trying to address … I think … is that a locked JAR file will stop things like hot redeployment from working.)

Read the documentation for more information.

Tomcat 8

The antiJARLocking attribute is gone in Tomcat 8. See the antiResourceLocking attribute.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download