Search code examples
playframeworkplayframework-2.0morphia

Play 2 morphia plugin - NoSuchMethodError: MorphiaLoggerFactory.reset()


I'm trying to use the MorphiaPlugin (https://github.com/leodagdag/play2-morphia-plugin). On initialization, MorphiaPlugin tries to do this (line 45):

MorphiaLoggerFactory.reset();

Which raised the following exception:

java.lang.NoSuchMethodError: com.google.code.morphia.logging.MorphiaLoggerFactory.reset()V
 leodagdag.play2morphia.MorphiaPlugin.onStart(MorphiaPlugin.java:45)
 play.api.Play$$anonfun$start$1.apply(Play.scala:60)
 play.api.Play$$anonfun$start$1.apply(Play.scala:60)
 scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
 scala.collection.immutable.List.foreach(List.scala:45)
 play.api.Play$.start(Play.scala:60)

The plugin is linking against Morphia-1.00-snapshot (verified with play dependencies) which has the reset method. Anyone has any idea why it's not finding the method?

Thanks


Solution

  • I'm an idiot, the reason was because I had morphia-0.99 lying in lib/ which overrode the one from the plugin.

    For those of you having classpath trouble, the following command is very handy:

    play classpath