运行Apache Jackrabbit GarbageCollector时出错

时间:2017-10-09 14:32:35

标签: jcr jackrabbit jackrabbit-oak

我正在尝试使用此链接中提供的方法在我的DataStore上运行GarbageCollector:https://wiki.apache.org/jackrabbit/DataStore

我正在使用Jackrabbit 2.6

public void runGC(){
        LOG.info("Inside runGC() method :: START ");

        DataStoreGarbageCollector gc = null;
        RepositoryManager rm = null;
        try {
            // need to login to start the repository
            rm = DMSRepositoryFactory.instance.getRepositoryFactory().getRepositoryManager((JackrabbitRepository)DMSRepositoryFactory.instance.getRepository());
            session = DMSRepositoryFactory.instance.getRepository().login();
            LOG.info("Inside runGC() method :: before starting Garbage Collector()");

            gc = rm.createDataStoreGarbageCollector();
            gc.mark();
            gc.sweep();
            LOG.info("Inside runGC() method :: after executing Garbage Collector()");
        } catch (RepositoryException e) {
            LOG.error("Error While Runining GC", e); 
            e.printStackTrace();
        }finally {
            LOG.info("Inside runGC() method :: inside finally closing Garbage Collector()");
            gc.close();
        }

        session.logout();
        rm.stop();
    }

在运行代码时,我遇到异常

2017-10-09 09:01:16,844 INFO  [SplitDesign] Inside runGC() method :: START
2017-10-09 09:07:07,785 INFO  [SplitDesign] Inside runGC() method :: before starting Garbage Collector()
2017-10-09 09:07:13,807 ERROR [SplitDesign] Error While Runining GC
javax.jcr.RepositoryException: mark failed to access a property
        at org.apache.jackrabbit.core.data.GarbageCollector.checkLengths(GarbageCollector.java:341)
        at org.apache.jackrabbit.core.data.GarbageCollector.recurse(GarbageCollector.java:282)
        at org.apache.jackrabbit.core.data.GarbageCollector.recurse(GarbageCollector.java:294)
        at org.apache.jackrabbit.core.data.GarbageCollector.recurse(GarbageCollector.java:294)
        at org.apache.jackrabbit.core.data.GarbageCollector.recurse(GarbageCollector.java:294)
        at org.apache.jackrabbit.core.data.GarbageCollector.recurse(GarbageCollector.java:294)
        at org.apache.jackrabbit.core.data.GarbageCollector.recurse(GarbageCollector.java:294)
        at org.apache.jackrabbit.core.data.GarbageCollector.scanNodes(GarbageCollector.java:181)
        at org.apache.jackrabbit.core.data.GarbageCollector.mark(GarbageCollector.java:162)
        at gov.ms.mdes.access.framework.dms.migration.SplitSsnDesign.runGC(SplitSsnDesign.java:1653)
        at gov.ms.mdes.access.framework.dms.migration.Migration.runGC(Migration.java:156)
        at gov.ms.mdes.access.framework.dms.jackrabbit.server.DmsRepository.runGC(DmsRepository.java:493)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
        at sun.rmi.transport.Transport$1.run(Transport.java:200)
        at sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2017-10-09 09:07:15,696 INFO  [SplitDesign] Inside runGC() method :: inside finally closing Garbage Collector()

0 个答案:

没有答案