[scala-metrics 3.0.3] AbstractMethodError with Play 2.2.1

1,295 views
Skip to first unread message

Timo Hirt

unread,
Dec 4, 2013, 10:07:08 AM12/4/13
to metric...@googlegroups.com
Hi!

I try to include scala-metrics into a Play! 2.2.1 project. This version of play comes with Akka in version 2.2.0. After adding the the dependeny and without any code modification I get the following Exceptions:

Dependency: libraryDependencies += "nl.grons" %% "metrics-scala" % "3.0.3"

2013-12-04 15:29:01,865 [info] play - Application started (Dev)
2013-12-04 15:29:02,159 [info] play - Starting application default Akka system.
[ERROR] [12/04/2013 15:29:02.497] [play-akka.actor.default-dispatcher-2] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.AbstractMethodError
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
    at akka.actor.ActorCell.invoke(ActorCell.scala:456)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
    at akka.dispatch.Mailbox.run(Mailbox.scala:219)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

[ERROR] [12/04/2013 15:29:02.497] [play-akka.actor.default-dispatcher-3] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-3] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.AbstractMethodError
    at akka.actor.ActorCell.create(ActorCell.scala:562)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:425)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
    at akka.dispatch.Mailbox.run(Mailbox.scala:218)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Uncaught error from thread [
play-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[Uncaught error from thread [play-akka.actor.default-dispatcher-3] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[playplay]
]
[ERROR] [12/04/2013 15:29:02.497] [play-akka.actor.default-dispatcher-2] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.AbstractMethodError
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
    at akka.actor.ActorCell.invoke(ActorCell.scala:456)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
    at akka.dispatch.Mailbox.run(Mailbox.scala:219)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
java.lang.AbstractMethodError

    at akka.actor.ActorCell.create(ActorCell.scala:562)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:425)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
    at akka.dispatch.Mailbox.run(Mailbox.scala:218)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)[ERROR] [12/04/2013 15:29:02.497] [play-akka.actor.default-dispatcher-3] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-3] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.AbstractMethodError
    at akka.actor.ActorCell.create(ActorCell.scala:562)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:425)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
    at akka.dispatch.Mailbox.run(Mailbox.scala:218)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)


    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
java.lang.AbstractMethodError
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
    at akka.actor.ActorCell.invoke(ActorCell.scala:456)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
    at akka.dispatch.Mailbox.run(Mailbox.scala:219)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

With scala-metrics 3.0.3_a2.1.0 it works very well.

Any suggestions how to fix that or what actually is the problem?

Erik van Oosten

unread,
Dec 4, 2013, 10:50:54 AM12/4/13
to metric...@googlegroups.com
This version of play comes with Akka in version 2.2.0.
With scala-metrics 3.0.3_a2.1.0 it works very well.

That is strange. Are you 100% sure your project depends (only) on Akka 2.2.0?
Play probably has some way to see the exact libraries you are using.

Kind regards,
    Erik.


Timo Hirt schreef op 04-12-13 16:07:
--
You received this message because you are subscribed to the Google Groups "metrics-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metrics-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/

Timo Hirt

unread,
Dec 4, 2013, 3:18:32 PM12/4/13
to metric...@googlegroups.com

That is strange. Are you 100% sure your project depends (only) on Akka 2.2.0?
Play probably has some way to see the exact libraries you are using

Yes, this is possible in the play console. If I add metrics-scala 3.0.3_a2.1.0 to the dependencies, akka 2.2.0 is included.

+---------------------------------------------------------------------------+--------------------------------------------------------+
| com.typesafe.akka:akka-actor_2.10:2.2.0                | com.typesafe.play:play_2.10:2.2.1                     
| As akka-actor_2.10-2.2.0.jar                                   | com.typesafe.akka:akka-slf4j_2.10:2.2.0    
|                                                                             | nl.grons:metrics-scala_2.10:3.0.3_a2.1.0  

And if I add metrics-scala 3.0.3 (or 3.0.2 or 3.0.1) to the dependencies, then it takes akka 2.3-M1 for unclear reasons

+---------------------------------------------------------------------------+--------------------------------------------------------+
| com.typesafe.akka:akka-actor_2.10:2.3-M1             | nl.grons:metrics-scala_2.10:3.0.3                     
| As akka-actor_2.10-2.3-M1.jar                                | com.typesafe.play:play_2.10:2.2.1  
                                                                              | com.typesafe.akka:akka-slf4j_2.10:2.2.0   

David Kowis

unread,
Dec 4, 2013, 4:20:42 PM12/4/13
to metric...@googlegroups.com
On 12/04/2013 02:18 PM, Timo Hirt wrote:
>
> That is strange. Are you 100% sure your project depends (only) on
> Akka 2.2.0?
> Play probably has some way to see the exact libraries you are using
>
>
> Yes, this is possible in the play console. If I add metrics-scala
> 3.0.3_a2.1.0 to the dependencies, akka 2.2.0 is included.

http://www.playframework.com/documentation/2.2.x/ScalaAkka

I believe that's because the Play Framework includes a dependency on
Akka 2.2, and you're going to get the latest version included by any
dependency.

Since metrics_scala (without the specific akka version) includes akka
2.3, you'll get that version, because it's newer.

--
David

Timo Hirt

unread,
Dec 4, 2013, 4:29:16 PM12/4/13
to metric...@googlegroups.com

http://www.playframework.com/documentation/2.2.x/ScalaAkka

I believe that's because the Play Framework includes a dependency on
Akka 2.2, and you're going to get the latest version included by any
dependency.

Since metrics_scala (without the specific akka version) includes akka
2.3, you'll get that version, because it's newer.


Yes, this is exactly what I think is happening here. But how can I prevent play from including akka 2.3 and instead use the included akka 2.2.

David Kowis

unread,
Dec 4, 2013, 4:31:20 PM12/4/13
to metric...@googlegroups.com
On 12/04/2013 03:29 PM, Timo Hirt wrote:
>
> http://www.playframework.com/documentation/2.2.x/ScalaAkka
I'm not sure, according to the README page, it should be using akka 2.2
with 3.0.3.

Might file an issue on the githubs.

>
> --
> You received this message because you are subscribed to the Google
> Groups "metrics-user" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to metrics-user...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> !DSPAM:529f9eb4301751368819913!


signature.asc

Erik van Oosten

unread,
Dec 5, 2013, 3:33:04 PM12/5/13
to metric...@googlegroups.com
Hi Timo,

I now see that metrics-scala depends on Akka version [2.2,)
That is definitely wrong. Overriding the version in Play (as you describe in https://github.com/timohirt/metrics-scala/commit/c824f72266e84a4b5242b7bfbbcfde11ba639f09) is therefore the right thing to do (as a quick fix).

The really right thing to do is for me to make a new release that fixes the Akka dependency version.

Thanks for noticing!

Kind regards,
    Erik.


Timo Hirt schreef op 04-12-13 22:29:
--
You received this message because you are subscribed to the Google Groups "metrics-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metrics-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages