Hi there,

I don't know, maybe it popped somewhere else, if so ignore it.

I   have   a   "stress   test"   where  I  add  about  10000 simple to some
collection. Collection has two indices on it. SOMETIMES, not always,
I  get  an  exception  upon  removal of the documents, which I traced to be
NullPointer in DocumentCache.java

(removing a Document)
> java.lang.NullPointerException
>         at 
> org.apache.xindice.core.DocumentCache$CacheKey.equals(DocumentCache.java:171)
>         at java.util.WeakHashMap.eq(WeakHashMap.java:256)
>         at java.util.WeakHashMap.get(WeakHashMap.java:348)
>         at 
> org.apache.xindice.core.DocumentCache.getDocument(DocumentCache.java:79)
>         at org.apache.xindice.core.Collection.getDocument(Collection.java:711)
>         at org.apache.xindice.core.Collection.remove(Collection.java:684)
>         at 
> org.apache.xindice.client.corba.CollectionServant.removeDocument(CollectionServant.java:336)
>         at 
> org.apache.xindice.client.corba.db.CollectionPOA._invoke(CollectionPOA.java:200)
>         at org.openorb.adapter.poa.POA.dispatch(POA.java:975)
>         at 
> org.openorb.net.AbstractServerRequest.dispatch(AbstractServerRequest.java:750)
>         at 
> org.openorb.net.ServerManagerImpl.serve_request(ServerManagerImpl.java:1467)
>         at 
> org.openorb.net.ServerManagerImpl.thread_pool_main(ServerManagerImpl.java:1410)
>         at 
> org.openorb.net.ServerManagerImpl.access$200(ServerManagerImpl.java:77)
>         at 
> org.openorb.net.ServerManagerImpl$PoolThread.run(ServerManagerImpl.java:1557)

(XPath)
>java.lang.NullPointerException
>         at 
> org.apache.xindice.core.DocumentCache$CacheKey.equals(DocumentCache.java:171)
>         at java.util.WeakHashMap.eq(WeakHashMap.java:256)
>         at java.util.WeakHashMap.get(WeakHashMap.java:348)
>         at 
> org.apache.xindice.core.DocumentCache.getDocument(DocumentCache.java:79)
>         at org.apache.xindice.core.Collection.getDocument(Collection.java:711)
>         at 
> org.apache.xindice.core.query.XPathQueryResolver$ResultSet.prepareNextNode(XPathQueryResolver.java:1003)
>         at 
> org.apache.xindice.core.query.XPathQueryResolver$ResultSet.<init>(XPathQueryResolver.java:995)
>         at 
> org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.execute(XPathQueryResolver.java:247)
>         at 
> org.apache.xindice.core.query.XPathQueryResolver.query(XPathQueryResolver.java:151)
>         at 
> org.apache.xindice.core.query.QueryEngine.query(QueryEngine.java:147)
>         at 
> org.apache.xindice.core.Collection.queryCollection(Collection.java:847)
>         at 
> org.apache.xindice.client.corba.CollectionServant.queryCollection(CollectionServant.java:428)
>         at 
> org.apache.xindice.client.corba.db.CollectionPOA._invoke(CollectionPOA.java:332)
>         at org.openorb.adapter.poa.POA.dispatch(POA.java:975)
>         at 
> org.openorb.net.AbstractServerRequest.dispatch(AbstractServerRequest.java:750)
>         at 
> org.openorb.net.ServerManagerImpl.serve_request(ServerManagerImpl.java:1467)
>         at 
> org.openorb.net.ServerManagerImpl.thread_pool_main(ServerManagerImpl.java:1410)
>         at 
> org.openorb.net.ServerManagerImpl.access$200(ServerManagerImpl.java:77)
>         at 
> org.openorb.net.ServerManagerImpl$PoolThread.run(ServerManagerImpl.java:1557)

It's hard to say what exactly causes it: the bug occurs only sometimes, and
I  noticed it happens on JDK1.4, I can't quite remember if it also happened
on my JDK1.3.1

The code fragment responsible for the exception is:

      public boolean equals(Object o) {
         CacheKey comp = (CacheKey)o;
         if ( col != comp.col )
            return false;
         return key.equals(comp.key );
      }

So  basically,  there  is a CacheKey with null collection reference inside.
How come? I have little knowledge about Xindice's internals, I don't know.

--

Also,  is  there  a  way  of  dumping  stack traces of "vendor" and runtime
exceptions  occurring  in xindice? I had to modify FaultCodes.java a little
bit to find out where the problem was.

Cheers,
Dawid

Reply via email to