How to find out why Play 2.4 is closing

I have a Play 2.4 application that I am currently running in development mode that I would like to move to production. One problem is that every day or so it works, it just shuts down for no reason. Log message:

2015-05-14 03:06:11 -0600 [INFO] from application in play-fork-run-akka.actor.default-dispatcher-22 - Application shutdown...

How can I get Play to give me a more specific message? This is quite difficult since he doesn't say anything. I don't see any exceptions, and I am pretty detailed about registration errors.

For a little context, I'm running 3 Akka promotion systems in the background with 5-30 members. They are sending some http traffic and one system is associated with a database query.

+3


source to share


2 answers


I think I had almost the same problem a couple of days ago. In my case, I was able to find out on the stack that the actor system had closed die to NullPointerException.

To prevent the JVM from stopping, you must add:



akka.jvm-exit-on-fatal-error = false
play.akka.jvm-exit-on-fatal-error = false

      

to your .conf

file. I wasn't sure which line actually had an effect, so I added both. That helped.

+3


source


See your Actor code? Can you crop it for demo purposes?

I am doing something similar in my main actor loop. it registers very clearly if my actor explodes or not. If it exploded, I know exactly why.



 private def doWork(workSender: ActorRef, work: Work): Unit = {

      work.doWork().onComplete {
        case Success(res) =>
          log.debug("Success during doWork on {}", work)
          self ! WorkComplete(WorkStatus.Success)
        case Failure(e) =>
          log.error(e, "Failure during doWork on {}", work)
          self ! WorkComplete(WorkStatus.Error)
      }
  }

      

+1


source







All Articles