Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A0AF9991A for ; Tue, 12 Mar 2013 17:50:20 +0000 (UTC) Received: (qmail 22046 invoked by uid 500); 12 Mar 2013 17:50:18 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 21962 invoked by uid 500); 12 Mar 2013 17:50:18 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 21954 invoked by uid 99); 12 Mar 2013 17:50:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 17:50:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [134.226.56.6] (HELO mercury.scss.tcd.ie) (134.226.56.6) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 17:50:13 +0000 Received: from localhost (localhost [127.0.0.1]) by mercury.scss.tcd.ie (Postfix) with ESMTP id 8DB22BE49 for ; Tue, 12 Mar 2013 17:49:45 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at scss.tcd.ie Received: from mercury.scss.tcd.ie ([127.0.0.1]) by localhost (mercury.scss.tcd.ie [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WmZIOEVnOITV for ; Tue, 12 Mar 2013 17:49:45 +0000 (GMT) Received: from shiraz.cs.tcd.ie (unknown [IPv6:2001:770:10:200:21d:9ff:fe28:378e]) by mercury.scss.tcd.ie (Postfix) with ESMTPSA id 73228BE47 for ; Tue, 12 Mar 2013 17:49:45 +0000 (GMT) Message-ID: <513F6AB9.80308@cs.tcd.ie> Date: Tue, 12 Mar 2013 17:49:45 +0000 From: Peter Lavin Reply-To: lavinp@cs.tcd.ie Organization: School of Computer Science and Statistics, Trinity College Dublin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130110 Thunderbird/10.0.12 MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: WeakReference Returning NULL Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I'm looking to create a TermFreqVector as follows TermFreqVector[] tfvs = null; try { tfvs = indxRead.getTermFreqVectors(docId); } catch (IOException e) { e.printStackTrace(); } However, the object tfvs is returning null. I've debugged it to a class called CloseableThreadLocal to this method... public T get() { WeakReference weakRef = t.get(); if (weakRef == null) { T iv = initialValue(); if (iv != null) { set(iv); return iv; } else return null; } else { return weakRef.get(); } } where weakRef is returning null. Can anyone shed some light on why this would be happening? I'm using the code in a webservice container Peter --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org