OpenNTF/org.openntf.nsfodp

Encountered FileSystemAlreadyExistsException in server-based compilation

Closed this issue · 1 comments

My guess is that both the NSF-ODP-side util and the Bazaar SourceFileManager objects tried to open the same one, since they don't share their cache.

Domino 11, Linux

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.nio.file.FileSystemAlreadyExistsException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at org.openntf.nsfodp.compiler.servlet.ODPCompilerServlet.doPost(ODPCompilerServlet.java:216)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:59)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at com.ibm.domino.xsp.adapter.osgi.OSGIModule.invokeServlet(OSGIModule.java:167)
	at com.ibm.domino.xsp.adapter.osgi.OSGIModule.access$0(OSGIModule.java:153)
	at com.ibm.domino.xsp.adapter.osgi.OSGIModule$1.invokeServlet(OSGIModule.java:134)
	at com.ibm.domino.xsp.adapter.osgi.AbstractOSGIModule.invokeServletWithNotesContext(AbstractOSGIModule.java:181)
	at com.ibm.domino.xsp.adapter.osgi.OSGIModule.doService(OSGIModule.java:128)
	at com.ibm.domino.xsp.adapter.osgi.OSGIService.doService(OSGIService.java:418)
	at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)
	at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)
	at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Caused by: java.lang.RuntimeException: java.nio.file.FileSystemAlreadyExistsException
	at com.sun.tools.javac.main.Main.compile(Main.java:559)
	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
	at com.ibm.xsp.extlib.javacompiler.JavaSourceClassLoader.lambda$4(JavaSourceClassLoader.java:234)
	at com.ibm.xsp.extlib.javacompiler.JavaSourceClassLoader$$Lambda$107.000000008C54BFA0.run(Unknown Source)
	at java.security.AccessController.doPrivileged(AccessController.java:678)
	at com.ibm.xsp.extlib.javacompiler.JavaSourceClassLoader.addClasses(JavaSourceClassLoader.java:232)
	at com.ibm.xsp.extlib.javacompiler.JavaSourceClassLoader.addClasses(JavaSourceClassLoader.java:206)
	at org.openntf.nsfodp.compiler.ODPCompiler.compileJavaSources(ODPCompiler.java:454)
	at org.openntf.nsfodp.compiler.ODPCompiler.compile(ODPCompiler.java:354)
	at org.openntf.nsfodp.compiler.ODPCompiler.compile(ODPCompiler.java:300)
	at org.openntf.nsfodp.compiler.servlet.ODPCompilerServlet.lambda$3(ODPCompilerServlet.java:213)
	at org.openntf.nsfodp.compiler.servlet.ODPCompilerServlet$$Lambda$44.000000009437BA90.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at lotus.domino.NotesThread.run(Unknown Source)
Caused by: java.nio.file.FileSystemAlreadyExistsException
	at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:113)
	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:326)
	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276)
	at com.ibm.xsp.extlib.javacompiler.impl.SourceFileManager.openZipPath(SourceFileManager.java:531)
	at com.ibm.xsp.extlib.javacompiler.impl.SourceFileManager$$Lambda$110.000000008C4DDDD0.apply(Unknown Source)
	at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
	at com.ibm.xsp.extlib.javacompiler.impl.SourceFileManager.listJarFile(SourceFileManager.java:490)
	at com.ibm.xsp.extlib.javacompiler.impl.SourceFileManager.listPackage(SourceFileManager.java:454)
	at com.ibm.xsp.extlib.javacompiler.impl.SourceFileManager.list(SourceFileManager.java:349)
	at com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.list(ClientCodeWrapper.java:231)
	at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2796)
	at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2446)
	at com.sun.tools.javac.jvm.ClassReader.access$000(ClassReader.java:76)
	at com.sun.tools.javac.jvm.ClassReader$1.complete(ClassReader.java:240)
	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
	at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:300)
	at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:518)
	at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:258)
	at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:272)
	at com.sun.tools.javac.comp.Enter.complete(Enter.java:486)
	at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
	at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
	at com.sun.tools.javac.main.Main.compile(Main.java:523)
	... 16 more

Actually coordinating between these two might be difficult, since the lifetimes of the components are different. It may be better to instead catch this exception and then just move on to opening the FS.