0

我是 Jena 和 Triplestore 的新手,当我在 tomcat 7 中部署我的应用程序时,我遇到了以下异常。

感谢您的帮助谢谢。

例外是

  Jun 20, 2014 1:23:23 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet [ServletAdaptor] in context with path [/triplestore] threw exception [A MultiException has 2 exceptions.  They are:   

  1. com.hp.hpl.jena.tdb.TDBException: Root blocks must be at position zero
  2. java.lang.IllegalStateException: Unable to perform operation: create on au.com.rdf.triplestore.web.TripleStoreServlet ] with root cause

  com.hp.hpl.jena.tdb.TDBException: Root blocks must be at position zero
  at com.hp.hpl.jena.tdb.index.bplustree.BPTreeNodeMgr.createEmptyBPT(BPTreeNodeMgr.java:55)
  at com.hp.hpl.jena.tdb.index.bplustree.BPlusTree.createIfAbsent(BPlusTree.java:215)
  at com.hp.hpl.jena.tdb.index.bplustree.BPlusTree.create(BPlusTree.java:141)
  at com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.createBPTree(Builder.java:167)
  at com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.buildRangeIndex(Builder.java:134)
  at com.hp.hpl.jena.tdb.setup.Builder$TupleIndexBuilderStd.buildTupleIndex(Builder.java:64)
  at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.makeTupleIndex(DatasetBuilderStd.java:283)
  at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.makeTupleIndexes(DatasetBuilderStd.java:272)
  at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.makeTupleIndexes(DatasetBuilderStd.java:261)
  at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.makeTripleTable(DatasetBuilderStd.java:193)
  at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd._build(DatasetBuilderStd.java:163)
  at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:149)
  at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:64)
  at com.hp.hpl.jena.tdb.StoreConnection.make(StoreConnection.java:217)
  at com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction.<init> (DatasetGraphTransaction.java:75) 
  at com.hp.hpl.jena.tdb.sys.TDBMaker._create(TDBMaker.java:57)
  at com.hp.hpl.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:45)
  at com.hp.hpl.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:104)
  at com.hp.hpl.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:73)
  at com.hp.hpl.jena.tdb.TDBFactory.createDataset(TDBFactory.java:52)
  at com.hp.hpl.jena.tdb.TDBFactory.createDataset(TDBFactory.java:48)
  at au.com.traleerdf.xmldi.triplestore.core.impl.TripleStoreImpl.<init>(TripleStoreImpl.java:159) 

  at au.com.traleerdf.xmldi.triplestore.web.TripleStoreRs.<init>(TripleStoreRs.java:44)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)   
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at  org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1117)
  at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:261)
  at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:337)
  at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456)
  at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:158)
  at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2350)
  at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:612)
  at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:597)
  at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:173)
  at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)   

 at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:103)   

 at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:128)
 at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:131)
 at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:131)
 at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:131)
 at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:131)
 at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:110)
 at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:65)
 at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
 at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:250)
 at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
 at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
 at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
 at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
 at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
 at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:318)
 at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:236)
 at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1010)
 at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373)
 at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
 at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
 at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
 at  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)  

 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)  

 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)  
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)   

 at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
 at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:744)

它失败的代码是

TDBFactory.createDataset(datasetPath);

4

1 回答 1

1

您可能一直在以非事务方式更新数据集并且没有同步它。数据库已损坏,您需要重建它。

使用事务将意味着磁盘上的数据库对于服务器退出是健壮的。

于 2014-06-20T11:44:47.480 回答