lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Lavin <lav...@cs.tcd.ie>
Subject WeakReference Returning NULL
Date Tue, 12 Mar 2013 17:49:45 GMT


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<T> 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


Mime
View raw message