You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/11/20 15:40:01 UTC
[jira] [Updated] (VFS-294) NullPointerException in
FtpFileObject.getChildFile
[ https://issues.apache.org/jira/browse/VFS-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Gregory updated VFS-294:
-----------------------------
Summary: NullPointerException in FtpFileObject.getChildFile (was: FtpFileObject is not threadsafe)
> NullPointerException in FtpFileObject.getChildFile
> --------------------------------------------------
>
> Key: VFS-294
> URL: https://issues.apache.org/jira/browse/VFS-294
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: 1.0
> Reporter: Johannes Scharf
> Priority: Major
>
> During my efforts to find a solution for VFS-293 I've discovered another bug regarding threadsafety.
> It seems that FtpFileObject is at least not fully threadsafe. When a FtpFileObject is accessed by multiple threads from time to time closing the OutputStream for a file fails with a NullPointerException.
> Stacktrace:
> {noformat}
> org.apache.commons.vfs.FileSystemException: Could not close the output stream for file "ftp://localhost/spring-framework-2.5.5/dist/resources/spring-jms-2.5.xsd".
> at org.apache.commons.vfs.provider.DefaultFileContent$FileContentOutputStream.close(DefaultFileContent.java:599)
> at at.js.jtransporter.transporter.VFSTransporter$VFSOutputStream.close(VFSTransporter.java:219)
> at at.js.jtransporter.util.Utils.close(Utils.java:40)
> at at.js.jtransporter.worker.resource.ResourceWorker.createFile(ResourceWorker.java:108)
> at at.js.jtransporter.worker.resource.ResourceWorker.processJob(ResourceWorker.java:52)
> at at.js.jtransporter.worker.AbstractRunnableWorker.run(AbstractRunnableWorker.java:82)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.commons.vfs.FileSystemException: Could not close the output stream for file "ftp://localhost/spring-framework-2.5.5/dist/resources/spring-jms-2.5.xsd".
> at org.apache.commons.vfs.provider.DefaultFileContent$FileContentOutputStream.onClose(DefaultFileContent.java:620)
> at org.apache.commons.vfs.util.MonitorOutputStream.close(MonitorOutputStream.java:63)
> at org.apache.commons.vfs.provider.DefaultFileContent$FileContentOutputStream.close(DefaultFileContent.java:595)
> ... 8 more
> Caused by: java.lang.NullPointerException
> at org.apache.commons.vfs.provider.ftp.FtpFileObject.getChildFile(FtpFileObject.java:106)
> at org.apache.commons.vfs.provider.ftp.FtpFileObject.getInfo(FtpFileObject.java:181)
> at org.apache.commons.vfs.provider.ftp.FtpFileObject.onChange(FtpFileObject.java:269)
> at org.apache.commons.vfs.provider.AbstractFileObject.endOutput(AbstractFileObject.java:1325)
> at org.apache.commons.vfs.provider.DefaultFileContent.endOutput(DefaultFileContent.java:459)
> at org.apache.commons.vfs.provider.DefaultFileContent.access$200(DefaultFileContent.java:44)
> at org.apache.commons.vfs.provider.DefaultFileContent$FileContentOutputStream.onClose(DefaultFileContent.java:616)
> ... 10 more
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)