From issues-return-70770-archive-asf-public=cust-asf.ponee.io@commons.apache.org Thu Nov 22 19:23:11 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id EFD71180645 for ; Thu, 22 Nov 2018 19:23:10 +0100 (CET) Received: (qmail 83383 invoked by uid 500); 22 Nov 2018 18:23:05 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 83367 invoked by uid 99); 22 Nov 2018 18:23:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2018 18:23:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7CCCC18CDAA for ; Thu, 22 Nov 2018 18:23:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JFt_Z1MMiQDt for ; Thu, 22 Nov 2018 18:23:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C1D2760E2D for ; Thu, 22 Nov 2018 18:23:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E371CE2613 for ; Thu, 22 Nov 2018 18:23:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 556EC2776D for ; Thu, 22 Nov 2018 18:23:00 +0000 (UTC) Date: Thu, 22 Nov 2018 18:23:00 +0000 (UTC) From: "Otto Fowler (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (VFS-683) Thread safety issue in VFSClassLoader - NullPointerException thrown MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/VFS-683?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1669618= 1#comment-16696181 ]=20 Otto Fowler commented on VFS-683: --------------------------------- I wonder if using the static vfs default manager can be an approach. =C2=A0= So instead of using the static, create your own per thread. > Thread safety issue in VFSClassLoader - NullPointerException thrown > ------------------------------------------------------------------- > > Key: VFS-683 > URL: https://issues.apache.org/jira/browse/VFS-683 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 2.2 > Reporter: Daryl Odnert > Priority: Major > Attachments: Main.java > > > In my application, I=C2=A0have two instances of the {{VFSClassLoader}}, e= ach of which=C2=A0is being used in a distinct thread. Both {{VFSClassLoader= }}=C2=A0instances refer to the same=C2=A0compressed file resource described= by a {{FileObject}} that is passed to the class loader's constructor.=C2= =A0Intermittently, 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 {{VFSClassLoa= der}}=C2=A0instances to refer to the same resource (file), then that assump= tion should be documented. But if that is not the case, then there is a rac= e condition bug in the implementation. > {noformat} > 43789 WARN {} c.a.e.u.PreferredPathClassLoader - While loading class org= .apache.hive.jdbc.HiveDatabaseMetaData, rethrowing unexpected java.lang.Nul= lPointerException: Inflater has been closed > java.lang.NullPointerException: Inflater has been closed > =09at java.util.zip.Inflater.ensureOpen(Inflater.java:389) > =09at java.util.zip.Inflater.inflate(Inflater.java:257) > =09at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:152= ) > =09at java.io.BufferedInputStream.read1(BufferedInputStream.java:284) > =09at java.io.BufferedInputStream.read(BufferedInputStream.java:345) > =09at org.apache.commons.vfs2.util.MonitorInputStream.read(MonitorInputSt= ream.java:91) > =09at org.apache.commons.vfs2.FileUtil.getContent(FileUtil.java:47) > =09at org.apache.commons.vfs2.impl.Resource.getBytes(Resource.java:102) > =09at org.apache.commons.vfs2.impl.VFSClassLoader.defineClass(VFSClassLoa= der.java:179) > =09at org.apache.commons.vfs2.impl.VFSClassLoader.findClass(VFSClassLoade= r.java:150) > at com.atscale.engine.utils.PreferredPathClassLoader.findClass(Pr= eferredPathClassLoader.scala:54) > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)