Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java org.postgresql.util.PSQLException:错误:关系;错误报告模型;不存在_Java_Postgresql_Heroku_Playframework_Sbt - Fatal编程技术网

Java org.postgresql.util.PSQLException:错误:关系;错误报告模型;不存在

Java org.postgresql.util.PSQLException:错误:关系;错误报告模型;不存在,java,postgresql,heroku,playframework,sbt,Java,Postgresql,Heroku,Playframework,Sbt,我正在尝试在heroku上运行一个简单的java play 2.5应用程序。我能够打开主页,这通常意味着连接到数据库是成功的。但是,当我试图调用route向它显示的表中添加一个伪值时 play.api.UnexpectedException: Unexpected exception[PersistenceException: ERROR executing DML bindLog[] error[ERROR: relation "bug_report_model" does not exist

我正在尝试在heroku上运行一个简单的java play 2.5应用程序。我能够打开主页,这通常意味着连接到数据库是成功的。但是,当我试图调用route向它显示的表中添加一个伪值时

play.api.UnexpectedException: Unexpected exception[PersistenceException: ERROR executing DML bindLog[] error[ERROR: relation "bug_report_model" does not exist\n   Position: 13]]
将值添加到数据库的代码是

 public Result enterDummyTextInDb() {
    BugReportModel model = new BugReportModel();
    model.save();
    return ok(Json.toJson(model));
}
模型类是

@Entity
public class BugReportModel extends Model {
@Id
private Long id;
private Long timestamp = System.currentTimeMillis();

public BugReportModel() {
}

public static Finder<Long, BugReportModel> find = new Model.Finder<Long, BugReportModel>(BugReportModel.class);

public static List<BugReportModel> findAll() {
    return BugReportModel.find.orderBy("id").findList();
}


public Long getId() {
    return id;
}

public void setId(Long id) {
    this.id = id;
}

public Long getTimestamp() {
    return timestamp;
}

public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
}

但对于java play 2.5,您还不确定,您需要通过如下方式配置应用程序以运行演进:

web: target/universal/stage/bin/myapp -Dhttp.port=${PORT} -Dplay.evolutions.db.default.autoApply=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL}

有关更多信息,请参见

数据库中是否存在“缺陷报告模型”表?也许它被称为其他东西?数据库中现在没有表。就像我最后提到的。找到了与spring/hibernate相关的内容,但无法确定如何在java play中创建db。在入门scala play heroku代码中找到了一些东西,但不确定如何在java中实现它
web: target/universal/stage/bin/myapp -Dhttp.port=${PORT} -Dplay.evolutions.db.default.autoApply=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL}