sbt / sbt-atmos

sbt plugin for running Typesafe Console in development
98 stars 11 forks source link

Error when executing `atmos:run` in SUWAS case study project #1

Closed hseeberger closed 11 years ago

hseeberger commented 11 years ago

Reproducible test case: https://github.com/typesafehub/training-akka-scala/tree/sbt-atmos.

Simple start sbt and execute atmos:run =>

[error] Exception in thread "main" java.lang.NullPointerException
...
pvlugter commented 11 years ago

sbt-atmos needs the application to run in a forked jvm, so that it can add a javaagent.

I get the same NPE if I run that app forked and without atmos. That is, on master branch:

sbt "set fork in run := true" run
hseeberger commented 11 years ago

I see, I know how to fix it, it's a simple setting. Will do tomorrow, have to sleep now ;-) Thanks a lot!

pvlugter commented 11 years ago

Ah, you're reading input. Yeah, adding a connectInput setting should get it working.

pvlugter commented 11 years ago

Also note that the atmosSettings try to automatically add trace dependencies based on the akka version of dependencies. See the readme. Having it in a separate atmos.sbt will probably mean this can't be automatic. I'll improve doing it in a separate and explicit way.

hseeberger commented 11 years ago

With these settings in atmos.sbt it works like a charm:

traceAkka("2.2.0")

connectInput in run := true

Looks like you already improved the docs and added the traceAkka helper. Thanks for the 0.1.1 release!

I wonder whether it should be possible to use:

connectInput in (Atmos, run) := true

Right now that doesn't work. Could the forked JVM be run in Atmos configuration?

pvlugter commented 11 years ago

These settings are now scoped to run in Atmos.

hseeberger commented 11 years ago

Thanks!

pvlugter commented 11 years ago

sbt-atmos 0.2.0 uses a weaving classloader for in-process run, and this is now the default. So both in-process and forked runs are supported. The connectInput setting shouldn't be needed anymore.

hseeberger commented 11 years ago

Awesome. Unfortunately an application started with atmos:run can't be stopped. I'll open an issue.