Java Java.io.IOException:No locks available exception handling solution

Source: Internet
Author: User

try {
Randomaccessfile = new Randomaccessfile (file, "RW");
Lock = Randomaccessfile.getchannel (). Trylock ();
} catch (IOException e) {
E.printstacktrace ();
}
The following exception occurred:
caused By:java.io.IOException:No locks available
At Sun.nio.ch.FileChannelImpl.lock0 (Native Method)
At Sun.nio.ch.FileChannelImpl.tryLock (filechannelimpl.java:871)
At Java.nio.channels.FileChannel.tryLock (filechannel.java:962)
At Org.apache.jackrabbit.core.util.RepositoryLock.tryLock (repositorylock.java:153)
... 141 more
No locks are available because the disk does not support lock locks, or the disk Nfslock service is not turned on.
Execute the df-t-H command to see if the type of directory that contains the file is NFS.
If "NFS", the directory where the generic files are located is mounted on the disk on the other server! Start the NFS server Nfslock service, the specific Linux command itself Baidu.
View Nfslock service startup status by command Ps-ef|grep NFSD or service Nfslock status

Java java.io.IOException:No locks available exception handling resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.