I don’t think this is necessarily a Lucee issue but might be a Java / Windows issue. We are running Lucee 4.x on Windows with Tomcat. I have a set of web services that uses an .XSLT to transform XML from one format to another. The issue is under high load I think Java is locking our .xslt file during the transformation and subsequent requests are failing due to an “Access is Denied” error. I’m pulling my hair out on this one. During some of my testing, I can get the error 2 times out of every 250 calls in a one minute test.
I traced through the Lucee code and I noticed it does not request a lock on the bufferedinputstream it creates…but I think java.io.bufferedinputstream locks the file it is reading be default…or Windows is locking the file on it’s own?
I’m about to turn on antiResourceLocking in Tomcat but that sounds like a poor solution. Here is the trace I’m analyzing.
D:\xxx\xxx\xxx\xxx\utils (Access is denied)
at java.io.FileInputStream.open0(Native Method):-2
at java.io.FileInputStream.open(FileInputStream.java:195):195
at java.io.FileInputStream.<init>(FileInputStream.java:138):138
at lucee.commons.io.res.type.file.FileResource.getInputStream(FileResource.java:195):195
at lucee.commons.io.IOUtil.getReader(IOUtil.java:541):541
at lucee.commons.io.IOUtil.toString(IOUtil.java:766):766
at lucee.runtime.text.xml.XMLUtil.toInputSource(XMLUtil.java:1120):1120
at lucee.runtime.text.xml.XMLUtil.toInputSource(XMLUtil.java:1167):1167
at lucee.runtime.text.xml.XMLUtil.toInputSource(XMLUtil.java:1155):1155
at lucee.runtime.functions.xml.XmlTransform.call(XmlTransform.java:46):46
This is the Lucee code I believe is throwing the exception
@Override
public InputStream getInputStream() throws IOException {
//provider.lock(this);
provider.read(this);
try {
//return new BufferedInputStream(new ResourceInputStream(this,new FileInputStream(this)));
return new BufferedInputStream(new FileInputStream(this));
}
catch(IOException ioe) {
//provider.unlock(this);
throw ioe;
}
}