sbt / sbt-atmos

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

Play returns empty responses when run using atmos-run #12

Open diegovar opened 10 years ago

diegovar commented 10 years ago

I added the sbt plugin for atmos and the necessary settings in my Build.scala. I am using Play 2.1.4 and sbt-atmos 0.3.0. When I run atmos-run I get

[info] Starting Atmos and Typesafe Console ...
[info] Typesafe Console is available at http://localhost:9900
--- (Running the application from SBT, auto-reloading is enabled) ---

INFO play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

The console is accessible at localhost:9900, but my application returns empty responses when I hit any endpoints in localhost:9000. Play doesn't even receive the requests it seems, as the app doesn't even start or log anything.

$ curl localhost:9000/health
curl: (52) Empty reply from server

Error 52 is: Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.

If I run my app using the regular run, I don't have this problem.

pvlugter commented 10 years ago

Can you reduce this to a sample project that does this, so we can look more closely? Thanks!

diegovar commented 10 years ago

I'm having a hard time reproducing this on a vanilla Play project, but here's more information on what I get. Apparently I get a NoClassDefFoundError with the message Could not initialize class com.typesafe.atmos.trace.ActionTracer$ in the following place:

New I/O worker #4@6468, prio=5, in group 'main', status: 'RUNNING'
      at com.typesafe.atmos.trace.ActionTracer.global(ActionTracer.scala:-1)
      at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived_aroundBody1$advice(ReplayingDecoder.java:109)
      at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:1)
      at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
      at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
      at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555)
      at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
      at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
      at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
      at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
      at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
      at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
      at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
      at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
      at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)

This seems to be similar in symptoms to the following issue: https://groups.google.com/forum/#!topic/play-framework/NBpokitYVJs

pvlugter commented 10 years ago

Okay, that's useful.

Can you send the output of:

sbt> show atmos:trace-dependencies

and

sbt> show atmos:full-classpath
diegovar commented 10 years ago

Here you go (replaced and removed a couple of values for security reasons):

[platform-project] $ show atmos:trace-dependencies 
[info] List(com.typesafe.atmos:trace-play-2.1.4:1.3.0:atmos-trace-compile)  

[platform-project] $ show atmos:full-classpath 
[info] List(Attributed(C:\git\adsk\platform-main-project\target\scala-2.10\classes), Attributed(C:\Users\username\.sbt\boot\scala-2.10.0\lib\scala-library.jar), Attributed(C:\Users\username\.ivy2\cache\org.javassist\javassist\jars\javassist-3.16.1-GA.jar), Attributed(C:\Users\username\.ivy2\cache\com.github.scala-incubator.io\scala-io-file_2.10\jars\scala-io-file_2.10-0.4.2.jar), Attributed(C:\Users\username\.ivy2\cache\com.github.scala-incubator.io\scala-io-core_2.10\jars\scala-io-core_2.10-0.4.2.jar), Attributed(C:\Users\username\.ivy2\cache\com.jsuereth\scala-arm_2.10\jars\scala-arm_2.10-1.3.jar), Attributed(C:\Users\t _vared\.ivy2\cache\org.scala-stm\scala-stm_2.10.0\jars\scala-stm_2.10.0-0.6.jar), Attributed(C:\Users\username\.ivy2\cache\io.netty\netty\bundles\netty-3.6.3.Fin al.jar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe.netty\netty-http-pipelining\jars\netty-http-pipelining-1.1.1.jar), Attributed(C:\Users\username\.iv y2\cache\org.slf4j\jul-to-slf4j\jars\jul-to-slf4j-1.6.6.jar), Attributed(C:\Users\username\.ivy2\cache\ch.qos.logback\logback-core\jars\logback-core-1.0.7.jar), Attributed(C:\Users\username\.ivy2\cache\ch.qos.logback\logback-classic\jars\logback-classic-1.0.7.jar), Attributed(C:\Users\username\.ivy2\cache\org.slf4j\slf4j- api\jars\slf4j-api-1.7.2.jar), Attributed(C:\Users\username\.ivy2\cache\joda-time\joda-time\jars\joda-time-2.1.jar), Attributed(C:\Users\username\.ivy2\cache\org. joda\joda-convert\jars\joda-convert-1.2.jar), Attributed(C:\Users\username\.ivy2\cache\org.apache.commons\commons-lang3\jars\commons-lang3-3.1.jar), Attributed(C :\Users\username\.ivy2\cache\com.ning\async-http-client\jars\async-http-client-1.7.6.jar), Attributed(C:\Users\username\.ivy2\cache\oauth.signpost\signpost-core\j ars\signpost-core-1.2.1.2.jar), Attributed(C:\Users\username\.ivy2\cache\oauth.signpost\signpost-commonshttp4\jars\signpost-commonshttp4-1.2.1.2.jar), Attributed (C:\Users\username\.ivy2\cache\commons-logging\commons-logging\jars\commons-logging-1.1.1.jar), Attributed(C:\Users\username\.ivy2\cache\org.codehaus.jackson\jack son-core-asl\jars\jackson-core-asl-1.9.10.jar), Attributed(C:\Users\username\.ivy2\cache\org.codehaus.jackson\jackson-mapper-asl\jars\jackson-mapper-asl-1.9.10.j ar), Attributed(C:\Users\username\.ivy2\cache\xerces\xercesImpl\jars\xercesImpl-2.11.0.jar), Attributed(C:\Users\username\.ivy2\cache\xml-apis\xml-apis\jars\xml-a pis-1.4.01.jar), Attributed(C:\Users\username\.ivy2\cache\net.sf.ehcache\ehcache-core\jars\ehcache-core-2.6.0.jar), Attributed(C:\Users\username\.ivy2\cache\javax .transaction\jta\jars\jta-1.1.jar), Attributed(C:\Users\username\.ivy2\cache\org.scala-lang\scala-reflect\jars\scala-reflect-2.10.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.mongodb\casbah-core_2.10\jars\casbah-core_2.10-2.6.1.jar), Attributed(C:\Users\username\.ivy2\cache\org.mongodb\casbah-commons_2.10\jars\casbah-commons_2.10-2.6.1.jar), Attributed(C:\Users\username\.ivy2\cache\com.github. nscala-time\nscala-time_2.10\jars\nscala-time_2.10-0.2.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.mongodb\mongo-java-driver\jars\mongo-java-driver-2.11 .1.jar), Attributed(C:\Users\username\.ivy2\cache\org.mongodb\casbah-query_2.10\jars\casbah-query_2.10-2.6.1.jar), Attributed(C:\Users\username\.ivy2\cache\com.fo ursquare\fongo\jars\fongo-1.1.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.mockito\mockito-core\jars\mockito-core-1.9.0.jar), Attributed(C:\Users\username \.ivy2\cache\org.hamcrest\hamcrest-core\jars\hamcrest-core-1.1.jar), Attributed(C:\Users\username\.ivy2\cache\org.objenesis\objenesis\jars\objenesis-1.0.jar), At tributed(C:\Users\username\.ivy2\cache\com.novus\salat-core_2.10\jars\salat-core_2.10-1.9-SNAPSHOT.jar), Attributed(C:\Users\username\.ivy2\cache\com.novus\salat- util_2.10\jars\salat-util_2.10-1.9-SNAPSHOT.jar), Attributed(C:\Users\username\.ivy2\cache\org.scala-lang\scalap\jars\scalap-2.10.1.jar), Attributed(C:\Users\t_v ared\.sbt\boot\scala-2.10.0\lib\scala-compiler.jar), Attributed(C:\Users\username\.ivy2\cache\org.json4s\json4s-native_2.10\jars\json4s-native_2.10-3.1.0.jar), A ttributed(C:\Users\username\.ivy2\cache\com.thoughtworks.paranamer\paranamer\jars\paranamer-2.5.2.jar), Attributed(C:\Users\username\.ivy2\cache\org.json4s\json4s -jackson_2.10\jars\json4s-jackson_2.10-3.2.4-either-support.jar), Attributed(C:\Users\username\.ivy2\cache\org.json4s\json4s-core_2.10\jars\json4s-core_2.10-3.2. 4-either-support.jar), Attributed(C:\Users\username\.ivy2\cache\org.json4s\json4s-ast_2.10\jars\json4s-ast_2.10-3.2.4-either-support.jar), Attributed(C:\Users\t_ vared\.ivy2\cache\com.fasterxml.jackson.core\jackson-databind\jars\jackson-databind-2.1.2.jar), Attributed(C:\Users\username\.ivy2\cache\com.fasterxml.jackson.co re\jackson-annotations\jars\jackson-annotations-2.1.1.jar), Attributed(C:\Users\username\.ivy2\cache\com.fasterxml.jackson.core\jackson-core\jars\jackson-core-2. 1.1.jar), Attributed(C:\Users\username\.ivy2\cache\org.json4s\json4s-ext_2.10\jars\json4s-ext_2.10-3.2.4-either-support.jar), Attributed(C:\Users\username\.ivy2\c ache\com.typesafe.akka\akka-testkit_2.10\bundles\akka-testkit_2.10-2.1.2.jar), Attributed(C:\Users\username\.ivy2\cache\com.amazonaws\aws-elasticache-client\jars \aws-elasticache-client-1.0.0.jar), Attributed(C:\Users\t_v ared\.ivy2\cache\ch.qos.logback\logback-access\jars\logback-access-1.0.7.jar), Attributed(C:\Users\username\.ivy2\cache\org.apache.thrift\libfb303\jars\libfb303- 0.8.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.apache.thrift\libthrift\jars\libthrift-0.8.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.apache.ht tpcomponents\httpclient\jars\httpclient-4.1.2.jar), Attributed(C:\Users\username\.ivy2\cache\org.apache.httpcomponents\httpcore\jars\httpcore-4.1.3.jar), Attribu ted(C:\Users\username\.ivy2\cache\log4j\log4j\bundles\log4j-1.2.17.jar), Attributed(C:\Users\username\.ivy2\cache\com.google.code.gson\gson\jars\gson-2.2.2.jar), Attributed(C:\Users\username\.ivy2\cache\com.amazonaws\aws-java-sdk\jars\aws-java-sdk-1.3.30.jar), Attributed(C:\Users\username\.ivy2\cache\org.slf4j\jcl-over-slf 4j\jars\jcl-over-slf4j-1.7.2.jar), Attributed(C:\Users\username\.ivy2\cache\org.fusesource.jansi\jansi\jars\jansi-1.10.jar), Attributed(C:\Users\username\.ivy2\ca che\play\play_2.10\jars\play_2.10-2.1.5.jar), Attributed(C:\Users\username\.ivy2\cache\play\sbt-link\jars\sbt-link-2.1.5.jar), Attributed(C:\Users\username\.ivy2\ cache\play\play-exceptions\jars\play-exceptions-2.1.5.jar), Attributed(C:\Users\username\.ivy2\cache\play\templates_2.10\jars\templates_2.10-2.1.5.jar), Attribut ed(C:\Users\username\.ivy2\cache\play\play-iteratees_2.10\jars\play-iteratees_2.10-2.1.5.jar), Attributed(C:\Users\username\.ivy2\cache\play\play-test_2.10\jars\p lay-test_2.10-2.1.5.jar), Attributed(C:\Users\username\.ivy2\cache\junit\junit-dep\jars\junit-dep-4.10.jar), Attributed(C:\Users\username\.ivy2\cache\org.specs2\s pecs2_2.10\jars\specs2_2.10-1.13.jar), Attributed(C:\Users\username\.ivy2\cache\org.specs2\scalaz-core_2.10\jars\scalaz-core_2.10-7.0.0.jar), Attributed(C:\Users \username\.ivy2\cache\org.specs2\scalaz-concurrent_2.10\jars\scalaz-concurrent_2.10-7.0.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.specs2\scalaz-effect_ 2.10\jars\scalaz-effect_2.10-7.0.0.jar), Attributed(C:\Users\username\.ivy2\cache\com.novocode\junit-interface\jars\junit-interface-0.10.jar), Attributed(C:\User s\username\.ivy2\cache\org.scala-tools.testing\test-interface\jars\test-interface-0.5.jar), Attributed(C:\Users\username\.ivy2\cache\org.fluentlenium\fluentlenium -festassert\jars\fluentlenium-festassert-0.7.3.jar), Attributed(C:\Users\username\.ivy2\cache\org.fluentlenium\fluentlenium-core\jars\fluentlenium-core-0.7.3.jar ), Attributed(C:\Users\username\.ivy2\cache\org.seleniumhq.selenium\selenium-java\jars\selenium-java-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.sel eniumhq.selenium\selenium-android-driver\jars\selenium-android-driver-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.seleniumhq.selenium\selenium-remo te-driver\jars\selenium-remote-driver-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\cglib\cglib-nodep\jars\cglib-nodep-2.1_3.jar), Attributed(C:\Users\t_ vared\.ivy2\cache\org.json\json\jars\json-20080701.jar), Attributed(C:\Users\username\.ivy2\cache\org.seleniumhq.selenium\selenium-api\jars\selenium-api-2.25.0.j ar), Attributed(C:\Users\username\.ivy2\cache\com.google.guava\guava\jars\guava-12.0.jar), Attributed(C:\Users\username\.ivy2\cache\com.google.code.findbugs\jsr30 5\jars\jsr305-1.3.9.jar), Attributed(C:\Users\username\.ivy2\cache\org.apache.commons\commons-exec\jars\commons-exec-1.1.jar), Attributed(C:\Users\username\.ivy2\ cache\net.java.dev.jna\jna\jars\jna-3.4.0.jar), Attributed(C:\Users\username\.ivy2\cache\net.java.dev.jna\platform\jars\platform-3.4.0.jar), Attributed(C:\Users\ username\.ivy2\cache\org.seleniumhq.selenium\selenium-chrome-driver\jars\selenium-chrome-driver-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.selenium hq.selenium\selenium-htmlunit-driver\jars\selenium-htmlunit-driver-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\net.sourceforge.htmlunit\htmlunit\jars\h tmlunit-2.9.jar), Attributed(C:\Users\username\.ivy2\cache\xalan\xalan\jars\xalan-2.7.1.jar), Attributed(C:\Users\username\.ivy2\cache\xalan\serializer\jars\seria lizer-2.7.1.jar), Attributed(C:\Users\username\.ivy2\cache\commons-collections\commons-collections\jars\commons-collections-3.2.1.jar), Attributed(C:\Users\t_var ed\.ivy2\cache\commons-lang\commons-lang\jars\commons-lang-2.6.jar), Attributed(C:\Users\username\.ivy2\cache\org.apache.httpcomponents\httpmime\jars\httpmime-4. 1.2.jar), Attributed(C:\Users\username\.ivy2\cache\commons-codec\commons-codec\jars\commons-codec-1.6.jar), Attributed(C:\Users\username\.ivy2\cache\net.sourcefor ge.htmlunit\htmlunit-core-js\jars\htmlunit-core-js-2.9.jar), Attributed(C:\Users\username\.ivy2\cache\net.sourceforge.nekohtml\nekohtml\jars\nekohtml-1.9.15.jar) , Attributed(C:\Users\username\.ivy2\cache\net.sourceforge.cssparser\cssparser\jars\cssparser-0.9.5.jar), Attributed(C:\Users\username\.ivy2\cache\org.w3c.css\sac \jars\sac-1.3.jar), Attributed(C:\Users\username\.ivy2\cache\commons-io\commons-io\jars\commons-io-2.0.1.jar), Attributed(C:\Users\username\.ivy2\cache\org.seleni umhq.selenium\selenium-firefox-driver\jars\selenium-firefox-driver-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.seleniumhq.selenium\selenium-ie-driv er\jars\selenium-ie-driver-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.seleniumhq.selenium\selenium-iphone-driver\jars\selenium-iphone-driver-2.25. 0.jar), Attributed(C:\Users\username\.ivy2\cache\org.seleniumhq.selenium\selenium-safari-driver\jars\selenium-safari-driver-2.25.0.jar), Attributed(C:\Users\t_va red\.ivy2\cache\org.webbitserver\webbit\jars\webbit-0.4.6.jar), Attributed(C:\Users\username\.ivy2\cache\org.seleniumhq.selenium\selenium-support\jars\selenium-s upport-2.25.0.jar), Attributed(C:\Users\username\.ivy2\cache\org.easytesting\fest-assert\jars\fest-assert-1.4.jar), Attributed(C:\Users\username\.ivy2\cache\org.e asytesting\fest-util\jars\fest-util-1.1.6.jar), Attributed(C:\Users\username\.ivy2\cache\org.scalatest\scalatest_2.10\jars\scalatest_2.10-2.0.M5b.jar), Attribute d(C:\Users\username\.ivy2\cache\com.typesafe.atmos\trace-play-2.1.4\jars\trace-play-2.1.4-1.3.0.jar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe.atmos\ trace-akka-2.1.4\jars\trace-akka-2.1.4-1.3.0.jar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe.atmos\trace-scala-2.10.2\jars\trace-scala-2.10.2-1.3.0.j ar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe.atmos\atmos-trace_2.10\jars\atmos-trace_2.10-1.3.0.jar), Attributed(C:\Users\username\.ivy2\cache\com.t ypesafe.atmos\atmos-event_2.10\jars\atmos-event_2.10-1.3.0.jar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe\config\bundles\config-1.0.2.jar), Attribut ed(C:\Users\username\.ivy2\cache\com.google.protobuf\protobuf-java\jars\protobuf-java-2.4.1.jar), Attributed(C:\Users\username\.ivy2\cache\org.aspectj\aspectjrt\j ars\aspectjrt-1.7.2.jar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe.akka\akka-actor_2.10\bundles\akka-actor_2.10-2.1.4.jar), Attributed(C:\Users\t_va red\.ivy2\cache\com.typesafe.akka\akka-remote_2.10\bundles\akka-remote_2.10-2.1.4.jar), Attributed(C:\Users\username\.ivy2\cache\org.uncommons.maths\uncommons-ma ths\jars\uncommons-maths-1.2.2a.jar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe.akka\akka-slf4j_2.10\bundles\akka-slf4j_2.10-2.1.4.jar), Attributed(C :\Users\username\.ivy2\cache\org.fusesource\sigar\jars\sigar-1.6.4.jar), Attributed(C:\Users\username\.ivy2\cache\com.typesafe.atmos\trace-play-common\jars\trace- play-common-1.3.0.jar), Attributed(C:\git\adsk\platform-main-project\target\atmos\conf\trace)) 
[success] Total time: 97 s, completed Sep 24, 2013 5:34:12 PM 
pvlugter commented 10 years ago

Thanks. Classpath looks okay.

It does look like the issue you've linked to. There's some problem in the initialisation of the tracer, and whatever it is, is being swallowed silently.

If you do find a sample that reproduces it, that would be really useful. I'll also forward to the team, and we'll get something in there to try and catch and display this at least.