Re: recovering potentially corrupt data

Rohit Mathur <[email protected]> Mon, 15 May 2006 13:11:38 -0500
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
Hi Todd,

sorry about that last message, since i saw the error i was expecting, i 
didnt think to check the export command syntax.

 >xindice.sh export -v -c  xmldb:xindice://localhost:8080/db -n 
globalJobs1 -f globalJobs1
trying to register database

Creating directory globalJobs1/db
Extracting 0 files from xmldb:xindice://localhost:8080/db
Creating directory globalJobs1/db/products
Extracting 0 files from xmldb:xindice://localhost:8080/db/products
...............
Creating directory globalJobs1/db/site
Extracting 1 files from xmldb:xindice://localhost:8080/db/site
Creating directory globalJobs1/db/jobs
Extracting 0 files from xmldb:xindice://localhost:8080/db/jobs
Creating directory globalJobs1/db/jobs/globalJobs1
XMLDB Exception 0: Failed to execute command 'ListDocuments' on server: 
http://localhost:8080/xindice/,message: java.lang.Exception: 
java.lang.NullPointerException
org.xmldb.api.base.XMLDBException: Failed to execute command 
'ListDocuments' on server: http://localhost:8080/xindice/, message: 
java.lang.Exception: java.lang.NullPointerException
        at 
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:124)
        at 
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.listResources(CollectionImpl.java:488)
        .....      
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.Exception: 
java.lang.NullPointerException
        at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
        ... 8 more
[[email protected]: java.lang.Exception: 
java.lang.NullPointerException
         ....
        at 
org.apache.xindice.tools.command.ExportTree.process(ExportTree.java:148)
        at 
org.apache.xindice.tools.command.ExportTree.execute(ExportTree.java:71)
        at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
        at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
        at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)

and listing the document is where i encountered the null pointer error 
in the first place.
I am able to list other documents/collections in this db

 >xindice.sh ld -v -c  xmldb:xindice://localhost:8080/db/jobs/globalJobs1
trying to register database
XMLDB Exception 0: Failed to execute command 'ListDocuments' on server: 
http://localhost:8080/xindice/,message: java.lang.Exception: 
java.lang.NullPointerException
org.xmldb.api.base.XMLDBException: Failed to execute command 
'ListDocuments' on server: http://localhost:8080/xindice/, message: 
java.lang.Exception: java.lang.NullPointerException
        at 
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:124)
        at 
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.listResources(CollectionImpl.java:488)
        at 
org.apache.xindice.tools.command.ListCollectionDocuments.execute(ListCollectionDocuments.java:55)
        at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
        at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
        at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.Exception: 
java.lang.NullPointerException
        at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
        at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
        at 
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:112)
        ... 5 more
[[email protected]: java.lang.Exception: 
java.lang.NullPointerException
        at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
        at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
        at 
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:112)
        at 
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.listResources(CollectionImpl.java:488)
        at 
org.apache.xindice.tools.command.ListCollectionDocuments.execute(ListCollectionDocuments.java:55)
        at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
        at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
        at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)

hope this helps/is fixable

thanks a lot for your quick responses. i'm new to this project, and i 
havent worked with xindice before so i'm all at sea here.

Rohit

Todd Byrne wrote:

>I wasn't quite clear but try this:
>
>xindice.sh export -v -c  xmldb:xindice://localhost:8080/db -n
>globalJobs1 -f globalJobs1
>
>Also try listing the documents from database and retriving them one by one.
>
>$XINDICE_HOME/bin/xindice ld -c
>xmldb:xindice://localhost:8080/db/globalJobs1
>
>Todd
>
>
>Rohit Mathur wrote:
>  
>
>>Hi Todd,
>>
>>So the original db was running off an application that was a wrapper
>>around xindice, which is why i didnt want to send details.
>>I have since copied the db over to another machine where I'm running the
>>xindice 1.1b4.
>>
>>I tried what you recommended on a subset of the db (i.e. db/jobs).
>>Here is the error i get
>>
>>$ xindice.sh export -v -c  xmldb:xindice://localhost:8080/db/jobs -n
>>test -f test
>>trying to register database
>>
>>Creating directory test/jobs
>>Extracting 0 files from xmldb:xindice://localhost:8080/db/jobs
>>Creating directory test/jobs/globalJobs1
>>XMLDB Exception 0: Failed to execute command 'ListDocuments' on server:
>>http://localhost:8080/xindice/,message: java.lang.Exception:
>>java.lang.NullPointerException
>>org.xmldb.api.base.XMLDBException: Failed to execute command
>>'ListDocuments' on server: http://localhost:8080/xindice/, message:
>>java.lang.Exception: java.lang.NullPointerException
>>        at
>>org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:124)
>>        at
>>org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.listResources(CollectionImpl.java:488)
>>        at
>>org.apache.xindice.tools.command.ExportTree.process(ExportTree.java:111)
>>        at
>>org.apache.xindice.tools.command.ExportTree.process(ExportTree.java:148)
>>        at
>>org.apache.xindice.tools.command.ExportTree.execute(ExportTree.java:71)
>>        at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
>>        at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
>>        at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)
>>Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.Exception:
>>java.lang.NullPointerException
>>        at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
>>        at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
>>        at
>>org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:112)
>>        ... 7 more
>>[[email protected]: java.lang.Exception:
>>java.lang.NullPointerException
>>        at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
>>        at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
>>        at
>>org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:112)
>>        at
>>org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.listResources(CollectionImpl.java:488)
>>        at
>>org.apache.xindice.tools.command.ExportTree.process(ExportTree.java:111)
>>        at
>>org.apache.xindice.tools.command.ExportTree.process(ExportTree.java:148)
>>        at
>>org.apache.xindice.tools.command.ExportTree.execute(ExportTree.java:71)
>>        at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
>>        at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
>>        at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)
>>
>>thanks,
>>
>>Rohit
>>
>>P.S. I am able to add/remove collections from db/jobs, but not from
>>db/globalJobs1
>>
>>[email protected] wrote:
>>
>>    
>>
>>>You could try running  xindice command line tool like this to export the 
>>>data and then reload it.
>>>
>>>$XINDICE_HOME/bin/xindice export -c  xmldb:xindice://localhost:8080/db/ -n test -f test
>>>
>>>Maybe I can work with you to narrow down where this null pointer is coming 
>>>from. Are you using the latest release?
>>>
>>>Todd
>>>
>>>
>>>On Fri, 12 May 2006, Rohit Mathur wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>Is there any utility out there that can recover the data from a collection.
>>>>
>>>>Is it at all possible to do this at all?
>>>>
>>>>One particular collection has "gone bad". The rest of the db is working 
>>>>great.
>>>>I am unable to query it or create a collection within it.
>>>>
>>>>I get a null pointer exception from the data.
>>>>
>>>>thanks
>>>>
>>>>Rohit
>>>>
>>>>java.lang.NullPointerException at 
>>>>org.apache.xindice.core.filer.BTree$BTreeNode.query(BTree.java:937) at 
>>>>org.apache.xindice.core.filer.BTree$BTreeNode.query(BTree.java:937) at 
>>>>org.apache.xindice.core.filer.BTree.query(BTree.java:221) at 
>>>>org.apache.xindice.core.filer.BTreeFiler$BTreeFilerRecordSet.(BTreeFiler.java:191) 
>>>>at 
>>>>org.apache.xindice.core.filer.BTreeFiler.getRecordSet(BTreeFiler.java:174) 
>>>>at 
>>>>org.apache.xindice.core.Collection.listDocuments(Collection.java:1007) 
>>>>at 
>>>>org.apache.xindice.server.UglyBrowser.getHierarchy(UglyBrowser.java:157) 
>>>>at org.apache.xindice.server.UglyBrowser.doGet(UglyBrowser.java:78) at 
>>>>org.apache.xindice.server.XindiceServlet.doGet(XindiceServlet.java:82) 
>>>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at 
>>>>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
>>>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 
>>>>at 
>>>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 
>>>>at 
>>>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>>>>at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>>>>at 
>>>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>>>>at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>>>>at 
>>>>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 
>>>>at 
>>>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 
>>>>at 
>>>>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 
>>>>at 
>>>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 
>>>>at 
>>>>org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>>>>at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>>>>at 
>>>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 
>>>>at 
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>>>>at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>>>>at 
>>>>org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) 
>>>>at 
>>>>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432) 
>>>>at 
>>>>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386) 
>>>>at 
>>>>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534) 
>>>>at 
>>>>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530) 
>>>>at java.lang.Thread.run(Thread.java:534)
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>