NoClassDefFoundError creating Free monad ScalaZ

I’m using ScalaZ but I’m trying to figure out why I’m having an error. I will paste here the different layer in case somebody want to reproduce it.

Action Class

trait Actions extends Algebras {
  implicit class customFree(free: ActionMonad[Any]) {
    def onNext[T](f: T => T): ActionMonad[Any] = {
      free.flatMap(any => liftF[Action, Any](_OnNext(any.toFuture(), f)))
    }
    def ~> : Id[Any] = free.foldMap(interpreter)
  }

  def interpreter: Action ~> Id

  implicit class customAny(any: Any) {
    def toFuture() = any.asInstanceOf[Future[Any]]
  }
}

Algebra class

trait Algebras {

  type Id[+A] = A

  sealed trait Action[A]

  type ActionMonad[A] = Free[Action, A]

  case class _Action(f: () => String) extends Action[Any]

  case class _OnNext[T](future: Future[Any], f: T => T) extends Action[Any]

}

DSL class

trait FutureDSL extends Actions {

  def FutureAction(function: () => String): ActionMonad[Any] = {
    val action = _Action(function)
    liftF[Action, Any](action)
  }

  override def interpreter: Action ~> Id = new (Action ~> Id) {

    def apply[A](a: Action[A]): Id[A] = a match {
      case _Action(function) => runInFuture(function);
      case _OnNext(future, f) => transformFuture(future, f)
    }
  }

  def runInFuture(function: () => Any): Future[Any] = {
    Future {
      function.apply()
    }
  }

  def transformFuture(future: Future[Any], f: Nothing => Any): Any = {
    future.map(value => {
      f.asInstanceOf[Any => Any].apply(value)
    })
  }
}

Test class

class TestFuture extends FutureDSL {

  @Test
  def main() {
    FutureAction(() => getSentence())
      .onNext[String](upperCase)
      .onNext(concat(". This is awesome!!"))
      .~>
  }

  def getSentence(): String = "hello future DSL world"

  def upperCase: (String => String) = a => a.toUpperCase

  def concat(value: String): (String => String) = a => a.concat(value)

}

When I run the test I’m having a NoClassDefFoundError exception when I’m creating my Free[Action, Any] instance of function FutureAction

Here the Error

java.lang.NoClassDefFoundError: scala/Product$class

    at scalaz.Free$Suspend.<init>(Free.scala:56)
    at scalaz.Free$.liftF(Free.scala:86)
    at com.politrons.future.FutureDSL.FutureAction(FutureDSL.scala:12)
    at com.politrons.future.FutureDSL.FutureAction$(FutureDSL.scala:10)
    at com.politrons.future.TestFuture.FutureAction(TestFuture.scala:6)
    at com.politrons.future.TestFuture.main(TestFuture.scala:10)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: scala.Product$class
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 28 more