Kamon を使用するようにプレイ アプリケーションを構成しようとしています。を使用して新しいプレイアプリケーションを作成しました
activator new kamon-play play-scala
次に、 github に投稿しました。私は OS X 10.11.1 で実行しており、JDK 1.8.0_65-b17 を実行しており、プロジェクトは scala 2.11.6 で構成されています。Play の設定手順とsbt-aspectj-runner kamon- play exampleに基づいて (私の理解の範囲内で)設定しました。ただし、次のいずれかを使用してアプリケーションを実行しようとすると:
sbt run
また
activator run
次のエラーが表示されます。
[ERROR] [11/25/2015 09:04:39.574] [ForkJoinPool-1-worker-9] [ModuleLoader(akka://kamon)]
___ _ ___ _ _ ___ ___ _ _
/ _ \ | | |_ | | | | | | \/ |(_) (_)
/ /_\ \ ___ _ __ ___ ___ | |_ | | | | | | ___ __ _ __ __ ___ _ __ | . . | _ ___ ___ _ _ __ __ _
| _ |/ __|| '_ \ / _ \ / __|| __| | | | |/\| | / _ \ / _` |\ \ / // _ \| '__| | |\/| || |/ __|/ __|| || '_ \ / _` |
| | | |\__ \| |_) || __/| (__ | |_ /\__/ / \ /\ /| __/| (_| | \ V /| __/| | | | | || |\__ \\__ \| || | | || (_| |
\_| |_/|___/| .__/ \___| \___| \__|\____/ \/ \/ \___| \__,_| \_/ \___||_| \_| |_/|_||___/|___/|_||_| |_| \__, |
| | __/ |
|_| |___/
It seems like your application was not started with the -javaagent:/path-to-aspectj-weaver.jar option but Kamon detected
the following modules which require AspectJ to work properly:
kamon-akka, kamon-scala, kamon-play
If you need help on setting up the aspectj weaver go to http://kamon.io/introduction/get-started/ for more info. On the
other hand, if you are sure that you do not need or do not want to use the weaver then you can disable this error message
by changing the kamon.show-aspectj-missing-warning setting in your configuration file.
私は次のすべてを試しました:
plugins.sbt ファイルへの追加
aspectj-play-runner:run
(コンパイルしない)javaagent 引数をアクティベーターに渡します。
activator -J-javaagent::~/.ivy2/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.5.jar
しかし、それは次のエラーになります:
Error opening zip file or JAR manifest missing : :~/.ivy2/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.5.jar
Error occurred during initialization of VM
agent library failed to init: instrument
javaagent 引数を sbt に渡します。
sbt run -Djavaagent:~/.ivy2/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.5.jar
も試した
sbt run -Djavaagent:~/.ivy2/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.5.jar -Daspectj-play-runner:run
アップデート
私は、aspectj-play-runner:run が sbt タスク/コマンドであることを理解したので、それを試しました:
sbt
aspectj-runner:run
出力:
[WeavingURLClassLoader] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
java.lang.RuntimeException: Kamon has not been started yet. You must either explicitlt call Kamon.start(...) or enable automatic startup by adding -Dkamon.auto-start=true to your JVM options.
それで、私は試しました:
sbt -Dkamon.auto-start=true
aspectj-runner:run
どの出力:
[WeavingURLClassLoader] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
com.typesafe.config.ConfigException$IO: application.conf: java.io.IOException: resource not found on classpath: application.conf
最後に、ドキュメントには実際に実行する必要があると記載されています
sbt
aspectj-play-runner:run
しかし、コマンド/タスクは認識されません。