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