gpt4 book ai didi

model - Play Framework 错误: not found: type model

转载 作者:行者123 更新时间:2023-12-02 10:48:42 24 4
gpt4 key购买 nike

我正在将Play框架中的2.0应用程序迁移到2.2,可以在以下位置找到该应用程序:https://github.com/biesior/Play-20-Sample-FullCalendar-Java

编译时只有一个神秘错误:

\Play-20-Sample-FullCalendar-Java-master\app\models\Event.java:14: **not found: type Model**
[error] public class Event extends Model {
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed`enter code here`
[error] Total time: 3 s, completed Sep 28, 2013 12:32:00 AM
[FullCalendar] $

文件models/Event.java:
package models;


import com.avaje.ebean;
import play.data.format.Formats;
import play.data.validation.Constraints;
import play.db.ebean;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;
import java.util.List;

@Entity
public class Event extends Model {

@Id
public Long id;

plugins.sbt文件:
// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"



// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

Build.scala:
import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

val appName = "FullCalendar"
val appVersion = "1.1.2-Snapshot"

val appDependencies = Seq(
javaEbean
)

val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
)

}

有见识吗?

谢谢,。

最佳答案

注意您的进口。

您具有import com.avaje.ebean;import play.db.ebean;导入。这种进口是非法的。您可以将它们更改为import com.avaje.ebean.*;import play.db.ebean.*;(特别是import play.db.ebean.Model;)以使其正常工作

关于model - Play Framework 错误: not found: type model,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19069846/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com