2

我在 Windows 中运行的 scala 项目中遇到以下异常(Titan + cassandra)

调试 cttgdatabase.StandardTitanGraph - 已安装关闭挂钩 Thread[Thread-9,5,main] java.lang.Throwable:com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.(StandardTitanGraph.java:156) [titan- core-1.0.0.jar:na] 在 com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94) [titan-core-1.0.0.jar:na] 在 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$receive$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] 在 akka.dispatch.Mailbox.run(Mailbox.scala:220) [akka-actor_2.11-2.3.15.jar:na] 在akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397) [akka-actor_2.11-2.3.15.jar:na] 在 scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala -library-2.11.0.jar:na] 在 scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.11.0.jar:na] 在 scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.11.0.jar:na] 在 scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [ scala-library-2.11.0.jar:na]

我有什么遗漏吗?能否请你帮忙

4

1 回答 1

2

The stack trace is harmless. A Throwable is included in a DEBUG message.

This issue has come up before. There is a dependency conflict between 2 different logging systems: slf4j and logback. In its Maven build and gremlin.sh, Titan attempts to enforce a classpath order to keep slf4j ahead of logback. You could take the same approach when building your Scala application.

Alternatively, another workaround is to include a logback.xml file on the classpath:

<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>
于 2016-09-28T13:42:48.373 回答