我有一个使用 play 的应用程序,该应用程序是使用 Java 构建的。我希望为我的应用程序使用 Typesafe 控制台来监视 Akka,但是我无法配置它,因为我无法找到 Java 的配置详细信息。此外,找不到任何对适用于 Java 应用程序的 Typesafe 控制台的引用。
我用谷歌搜索并找到了显示 Scala 应用程序的 Typesafe 控制台配置的示例。尝试遵循相同的 java 指南,但没有产生任何结果。
我已经下载了二进制分发版并用 Java 编写了示例应用程序。在引用 Scala 示例应用程序的 build.scala
中进行更改,然后启动 Atmos(bin/typesafe-console atmos) & Console UI (bin/typesafe-console ui)。
我收到错误:
[info] Running com.typesafe.atmos.sample.GreetingApplication
[error] No such file or class on classpath: com.typesafe.atmos.sample.GreetingApplication
java.lang.RuntimeException: Nonzero exit code returned from runner: 1
at scala.sys.package$.error(package.scala:27)
如果您对 Java 应用程序的 Build.scala
配置有任何帮助,我们将不胜感激。
最佳答案
在另一个论坛上收到了“Peter Vlugter”对同一问题的回复。
对他的宝贵贡献深表感谢。
Configuration is the same for Java as it is for Scala.
Play projects use sbt, whether they're Scala or Java projects, and sbt configuration is always in Scala.
I've created a sample project that adds Typesafe Console to a Play Java project:
https://github.com/pvlugter/hello-atmos-play-java
I've started with the java hello world sample project:
https://github.com/playframework/playframework/tree/2.1.3/samples/java/helloworld
I've added a simple actor to this sample to be traced. I assume you have an Akka actor system to trace within your Play application.
Adding the developer Typesafe Console to the project with sbt-atmos is in this commit:
https://github.com/pvlugter/hello-atmos-play-java/commit/b9d6e5590e10b2ac8cbbb6254b3298a73e356799
Cheers,
Peter Vlugter
关于java - Java 应用程序的类型安全控制台配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17938994/