猿问

Java Play 框架 - NoClassDefFoundError:播放/配置

我刚刚开始使用 Java Play 框架并取得了一些进展,但现在我打算添加 JavaEbean OEM,我浏览了文档,但仍然收到错误NoClassDefFoundError: play/Configuration


应用程序.conf


    # This is the main configuration file for the application.

    # https://www.playframework.com/documentation/latest/ConfigFile


    ebean.default = ["models.*"]

插件.sbt


addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.1.0")

我的模型:


import io.ebean.Model;


public class Book extends Model {..}

构建.sbt


name := """BookStoreApp"""

organization := "com.example"


version := "1.0-SNAPSHOT"


lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)


scalaVersion := "2.12.8"


libraryDependencies += guice


蛊毒传说
浏览 117回答 1
1回答

阿晨1998

您需要更改playorebean版本。play已更改 2.7 中的默认类Configuration:https ://www.playframework.com/documentation/2.7.x/JavaConfigMigration26 。ebean插件版本及其对应于play: https : //github.com/playframework/play-ebean#releases所以接下来addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0") addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.1.0")必须改为addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.21") addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.1.0")或者addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0") addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "5.0.0")
随时随地看视频慕课网APP

相关分类

Java
我要回答