QnaList > Groups > Play-Framework > Mar 2016
faq

[play-framework] [play 2.5.1 Scala] Exceptions Take Server Down?

I've just had a crash caused by my failing to update a dependency 
(play-mailer) after updating to 2.5.1. This resulted in a NoSuchMethodError 
when someone tried to send a mail, which is to be expected. However, I did 
not expect that this would have crashed the whole Play process, with 
subsequent requests giving the following error:
[error] p.c.s.n.PlayRequestHandler - Exception caught in channelRead future
java.lang.IllegalStateException: Attempted to call materialize() after the 
ActorMaterializer has been shut down.
    at akka.stream.impl.ActorMaterializerImpl.materialize(
ActorMaterializerImpl.scala:88)
    at akka.stream.impl.ActorMaterializerImpl.materialize(
ActorMaterializerImpl.scala:79)
    at akka.stream.scaladsl.RunnableGraph.run(Flow.scala:354)
    at akka.stream.scaladsl.Source.runWith(Source.scala:93)
    at play.core.server.netty.NettyModelConversion.createStreamedResponse(
NettyModelConversion.scala:237)
    at play.core.server.netty.NettyModelConversion.convertResult(
NettyModelConversion.scala:173)
    at play.core.server.netty.
PlayRequestHandler$$anonfun$play$core$server$netty$PlayRequestHandler$$handleAction$2
.apply(PlayRequestHandler.scala:259)
    at play.core.server.netty.
PlayRequestHandler$$anonfun$play$core$server$netty$PlayRequestHandler$$handleAction$2
.apply(PlayRequestHandler.scala:255)
    at scala.util.Success$$anonfun$map$1.apply(Try.scala:237)
    at scala.util.Try$.apply(Try.scala:192)
I don't recall crashes of this type (NoSuchMethodError or NoClassDefFound) 
being quite so, erm, final, and taking the entire site down. Has anyone 
else run into this? Did it happen on 2.4? 
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/aeac1de3-2c1a-4b97-b8ba-75c7d6774560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

asked Mar 30 2016 at 15:29

Mike Bryant 's gravatar image



2 Replies for : [play-framework] [play 2.5.1 Scala] Exceptions Take Server Down?
Hi Mike,
NoSuchMethodError, like many other Errors, is generally considered a severe
issue with your code that could significantly impair its ability to
function as intended. That's why Akka's default supervisor strategy
triggers an ActorSystem shutdown in that case. You can of course override
it, but I think it's reasonable default behavior. It's hard to know what
those kind of errors actually signify and what kind of issues you'd run
into if your application tried to keep running.
It should have happened on 2.4 as well (I believe I've run into it before
with other types of errors), but you can obviously test it yourself by
manually throwing those exceptions.
*Greg Methvin*
*Senior Software Engineer*
Lightbend, Inc. 
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11Hx%3Dq25iaekXffn84WS_aPSetOdWY%2B4vQJhb9Fx20iyy%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

answered Mar 30 2016 at 15:50

Greg Methvin 's gravatar image


Actually NoSuchMethodError isn't an Exception. It's an Error:
https://docs.oracle.com/javase/7/docs/api/java/lang/Error.html
An Error is a subclass of Throwable that indicates serious problems that a 
reasonable application should not try to catch. Most such errors are 
abnormal conditions. The ThreadDeath error, though a "normal" condition, is 
also a subclass of Error because most applications should not try to catch 
it.
A method is not required to declare in its throws clause any subclasses of 
Error that might be thrown during the execution of the method but not 
caught, since these errors are abnormal conditions that should never occur. 
That is, Error and its subclasses are regarded as unchecked exceptions for 
the purposes of compile-time checking of exceptions.
Am Donnerstag, 31. März 2016 00:51:00 UTC+2 schrieb Greg Methvin:
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/8a8ef398-b7e1-47a4-a1ee-49277bab5bc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

answered Mar 30 2016 at 23:04

Christian Schmitt 's gravatar image


Related discussions

Tagged

Group Play-framework

asked Mar 30 2016 at 15:29

active Mar 30 2016 at 23:04

posts:3

users:3

Play-framework

©2013 QnaList.com