我在windows中运行的scala项目中得到以下异常(Titan + cassandra)
DEBUG c.t.t.g.database.StandardTitanGraph - 已安装的关闭挂钩 Thread [Thread-9,5,main] java.lang.Throwable:Hook创建跟踪 com.thinkaurelius.titan.graphdb.database.StandardTitanGraph。(StandardTitanGraph.java:156) [titan-core-1.0.0.jar:na] at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na] at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:74) [titan-core-1.0.0.jar:na] at notificaiton.UEReportReceiver $ .connect_graph_db(UEReportReceiver.scala:62) [classes /:na] at notificaiton.UEReportReceiver.inserttoDB(UEReportReceiver.scala:159) [classes /:na] at notificaiton.UEReportReceiver $$ anonfun $获得$ 1.applyOrElse(UEReportReceiver.scala:139) [classes /:na] at akka.actor.Actor $ class.aroundReceive(Actor.scala:467) [akka-actor_2.11-2.3.15.jar:na] at notificaiton.UEReportReceiver.aroundReceive(UEReportReceiver.scala:130) [classes /:na] at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) [akka-actor_2.11-2.3.15.jar:na] at akka.actor.ActorCell.invoke(ActorCell.scala:487) [akka-actor_2.11-2.3.15.jar:na] at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) [akka-actor_2.11-2.3.15.jar:na] at akka.dispatch.Mailbox.run(Mailbox.scala:220) [akka-actor_2.11-2.3.15.jar:na] at akka.dispatch.ForkJoinExecutorConfigurator $ AkkaForkJoinTask.exec(AbstractDispatcher.scala:397) [akka-actor_2.11-2.3.15.jar:na] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.11.0.jar:na] at scala.concurrent.forkjoin.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.11.0.jar:na] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.11.0.jar:na] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [阶库-2.11.0.jar:NA]
我缺少什么?你能帮忙吗
答案 0 :(得分:2)
堆栈跟踪无害。 Throwable包含在DEBUG message。
中 This issue之前出现过。两个不同的日志系统之间有一个dependency conflict:slf4j和logback。在其Maven构建和gremlin.sh
中,Titan尝试强制执行类路径顺序以使slf4j保持在logback之前。构建Scala应用程序时可以采用相同的方法。
或者,另一个workaround是在类路径中包含logback.xml
文件:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="STDOUT" />
</root>
</configuration>