Scala Lift MongoDB = NoClassDefFoundError错误

我是Scala和Lift的新手 . 试图创建简单的休息服务 .

这是我的用户对象:

object User extends MongoDocumentMeta[User]{
  override def collectionName = "users"
  override def formats = super.formats + new ObjectIdSerializer + new DateSerializer
}

case class User(_id: ObjectId, login: String, email: String, password: String, created: Date) extends MongoDocument[User] {
  def meta = User
}

这是一项休息服务:

object users extends RestHelper {
  serve {
    case "users" :: Nil JsonGet _ => Extraction.decompose(User.findAll)
    case "users" :: userId :: Nil JsonGet _ => Extraction.decompose(User.find(userId))
  }
}

GET http://localhost:8080/users 请求它返回

访问/用户有问题 . 原因:

scala/reflect/Manifest$

引起:

java.lang.NoClassDefFoundError:scala / reflect / Manifest $ at net.liftweb.mongodb.JObjectParser $$ anon $ 1.(JObjectParser.scala:39)at net.liftweb.mongodb.JObjectParser $ . (JObjectParser.scala:39) at net.liftweb.mongodb.JObjectParser $ . (JObjectParser.scala)at net.liftweb.mongodb.MongoDocumentMeta $ class.create(MongoDocument.scala:55)at code.model.User $ .create(User.scala:16)在net.liftweb.mongodb.MongoDocumentMeta $$ anonfun $ findAll $ 1 $$ anonfun $ apply $ 1.apply(MongoDocument.scala:111)at net.liftweb.mongodb.MongoDocumentMeta $$ anonfun $ findAll $ 1 $$ anonfun $ apply $ 1 . 申请(MongoDocument.scala:111)at scala.collection.Aterator $ anon $ 11.next(Iterator.scala:328)at scala.collection.Iterator $ class.foreach(Iterator.scala:727)at scala.collection.AbstractIterator .foreach(Iterator.scala:1156)...

哪里弄错了?

回答(0)