commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Otto Fowler (JIRA)" <>
Subject [jira] [Commented] (VFS-683) Thread safety issue in VFSClassLoader - NullPointerException thrown
Date Thu, 22 Nov 2018 18:21:00 GMT


Otto Fowler commented on VFS-683:


So, with your example the issue is that each time you get the tar archive input stream, it
needs to create a new stream, closing the old, so they are taking each other out, which is
because as you state the sample File object is resolving.


In the end, the file object content and streams are not going to be thread safe.  The issue,
as you thought is the cache.

Let me see what I can come up with.

> Thread safety issue in VFSClassLoader - NullPointerException thrown
> -------------------------------------------------------------------
>                 Key: VFS-683
>                 URL:
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Daryl Odnert
>            Priority: Major
>         Attachments:
> In my application, I have two instances of the {{VFSClassLoader}}, each of which is
being used in a distinct thread. Both {{VFSClassLoader}} instances refer to the same compressed
file resource described by a {{FileObject}} that is passed to the class loader's constructor. Intermittently,
the application throws an exception with the stack trace shown below. So, there seems to be
either a race condition in the code or an undocumented assumption here. If it is unsupported
for two {{VFSClassLoader}} instances to refer to the same resource (file), then that assumption
should be documented. But if that is not the case, then there is a race condition bug in the
> {noformat}
> 43789 WARN  {} c.a.e.u.PreferredPathClassLoader - While loading class org.apache.hive.jdbc.HiveDatabaseMetaData,
rethrowing unexpected java.lang.NullPointerException: Inflater has been closed
> java.lang.NullPointerException: Inflater has been closed
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at org.apache.commons.vfs2.FileUtil.getContent(
> 	at org.apache.commons.vfs2.impl.Resource.getBytes(
> 	at org.apache.commons.vfs2.impl.VFSClassLoader.defineClass(
> 	at org.apache.commons.vfs2.impl.VFSClassLoader.findClass(
>         at com.atscale.engine.utils.PreferredPathClassLoader.findClass(PreferredPathClassLoader.scala:54)
> {noformat}

This message was sent by Atlassian JIRA

View raw message