2015-08-03 7 views
0

Я действительно пытаюсь интегрировать Kamon 0.4.0 с моим приложением (scala) (отличная рамка!).Play 2.3.8 - Невозможно запустить Kamon 0.4.0

Вот что я сделал:

  1. Добавлены следующие зависимости в моем build.sbt:

    libraryDependencies ++= Seq(
         jdbc, 
         anorm, 
         "com.typesafe.play" %% "play-mailer" % "2.4.0", 
         "org.bouncycastle" % "bcpkix-jdk15on" % "1.51", 
         "org.bouncycastle" % "bcprov-jdk15on" % "1.51", 
         "com.github.nscala-time" %% "nscala-time" % "1.8.0", 
         "io.kamon" %% "kamon-core"   % "0.4.0", 
         "io.kamon" %% "kamon-play"   % "0.4.0", 
         "org.aspectj" % "aspectjweaver"   % "1.8.6" 
        ) 
    
  2. Включение и выключение Камон в Global.scala:

    object Global extends GlobalSettings { 
    
        override def onStart(app: Application) { 
        val hsmProxyName = Play.current.configuration.getString("ngocspd.hsm.proxy.name").get 
        val supervisorName = Play.current.configuration.getString("ngocspd.ocspd.supervisor.name").get 
        val notifierName = Play.current.configuration.getString("ngocspd.notification.name").get 
        java.security.Security.addProvider(new BouncyCastleProvider) 
        // Starting Kamon 
        Kamon.start() 
        Akka.system.actorOf(Props[NotificationActor], name = notifierName) 
        Akka.system.actorOf(Props[HardwareSecurityModuleProxyActor], name = hsmProxyName) 
        Akka.system.actorOf(Props[OCSPdActor], name = supervisorName) 
        } 
    
        override def onStop(app: Application) { 
        Kamon.shutdown() 
        } 
    } 
    
  3. Запуск активации или с траекторией агента AspectJ:

    activator -J-javaagent:/Users/pantin/.ivy2/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.6.jar 
    

Я сталкиваясь с двумя проблемами.

При запуске приложения, следующие исключения выбрасываются:

[error] o.a.w.b.BcelWorld - Unable to find class 'scala.concurrent.impl.Future.PromiseCompletingRunnable' in repository 
java.lang.ClassNotFoundException: scala.concurrent.impl.Future.PromiseCompletingRunnable not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'scala.concurrent.impl.Future.PromiseCompletingRunnable' in repository 
java.lang.ClassNotFoundException: scala.concurrent.impl.Future.PromiseCompletingRunnable not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'scala.concurrent.impl.Future.PromiseCompletingRunnable' in repository 
java.lang.ClassNotFoundException: scala.concurrent.impl.Future.PromiseCompletingRunnable not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'scala.concurrent.impl.Future.PromiseCompletingRunnable' in repository 
java.lang.ClassNotFoundException: scala.concurrent.impl.Future.PromiseCompletingRunnable not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'scala.concurrent.impl.Future.PromiseCompletingRunnable' in repository 
java.lang.ClassNotFoundException: scala.concurrent.impl.Future.PromiseCompletingRunnable not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'scala.concurrent.impl.Future.PromiseCompletingRunnable' in repository 
java.lang.ClassNotFoundException: scala.concurrent.impl.Future.PromiseCompletingRunnable not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.event.Logging.LogEvent' in repository 
java.lang.ClassNotFoundException: akka.event.Logging.LogEvent not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.event.Logging.LogEvent' in repository 
java.lang.ClassNotFoundException: akka.event.Logging.LogEvent not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.event.Logging.LogEvent' in repository 
java.lang.ClassNotFoundException: akka.event.Logging.LogEvent not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.event.Logging.LogEvent' in repository 
java.lang.ClassNotFoundException: akka.event.Logging.LogEvent not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 
[error] o.a.w.b.BcelWorld - Unable to find class 'akka.dispatch.Dispatcher.LazyExecutorServiceDelegate' in repository 
java.lang.ClassNotFoundException: akka.dispatch.Dispatcher.LazyExecutorServiceDelegate not found - unable to determine URL 
    at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:292) ~[aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:418) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:392) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:107) [aspectjweaver-1.8.6.jar:1.8.6] 
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:477) [aspectjweaver-1.8.6.jar:1.8.6] 

Есть ли способ, чтобы избавиться от этих исключений?

А потом, сбой приложения со следующим StackTrace:

play.api.UnexpectedException: Unexpected exception[ConfigurationException: Could not start logger due to [akka.ConfigurationException: Logger specified in config can't be loaded [akka.event.Logging$DefaultLogger] due to [java.lang.RuntimeException: Cannot retrieve extensions while Kamon is being initialized.]]] 
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:166) ~[play_2.11-2.3.8.jar:2.3.8] 
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.3.8.jar:2.3.8] 
    at scala.Option.map(Option.scala:146) ~[scala-library-2.11.6.jar:na] 
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.3.8.jar:2.3.8] 
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:128) ~[play_2.11-2.3.8.jar:2.3.8] 
Caused by: akka.ConfigurationException: Could not start logger due to [akka.ConfigurationException: Logger specified in config can't be loaded [akka.event.Logging$DefaultLogger] due to [java.lang.RuntimeException: Cannot retrieve extensions while Kamon is being initialized.]] 
    at akka.event.LoggingBus$class.startDefaultLoggers(Logging.scala:144) ~[akka-actor_2.11-2.3.9.jar:na] 
    at akka.event.EventStream.startDefaultLoggers(EventStream.scala:26) ~[akka-actor_2.11-2.3.9.jar:na] 
    at akka.actor.LocalActorRefProvider.init(ActorRefProvider.scala:622) ~[akka-actor_2.11-2.3.9.jar:na] 
    at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:619) ~[akka-actor_2.11-2.3.9.jar:na] 
    at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:616) ~[akka-actor_2.11-2.3.9.jar:na] 

ответ

-1

Там существует SBT плагин, который позволяет выполнять LTW в SBT, и мы сможем сделать работать в режиме разработки в игре легко. sbt-aspectj-runner.

0

Реакция на https://groups.google.com/forum/#!topic/kamon-user/Wz1hVypO15E была полезной.

Вместо того, чтобы использовать активатор бежать, чтобы запустить приложение воспроизведения в режиме разработчика, после выполнения этапа SBT я использовал

target/universal/stage/bin/my-app -J-javaagent:fullPathToAspectJ/aspectjweaver-1.8.5.jar 

Пожалуйста, обратите внимание, что при использовании старт-активатор не работает.