每个人。我在 play2.0 中使用休眠 jpa。首先我使用 H2,它运行良好。然后我改用 oracle,jpa 为我正确创建表。但是当我发送任何播放请求时,它会报告错误:
[info] play - datasource [jdbc:oracle:thin:@58.215.201.110:1521:orcl2167] bound
to JNDI as DefaultDS
[info] play - database [default] connected at jdbc:oracle:thin:@58.215.201.110:1
521:orcl2167
[warn] application - play_evolutions table already existed
[error] application -
! @6b43j2ce2 - Internal server error, for request [GET /] ->
play.api.UnexpectedException: Unexpected exception [sqlexception ora-00942 table or view does not exist]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anon
fun$1.apply(ApplicationProvider.scala:134) ~[play_2.9.1.jar:2.0]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anon
fun$1.apply(ApplicationProvider.scala:112) ~[play_2.9.1.jar:2.0]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.2]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3.apply
(ApplicationProvider.scala:112) ~[play_2.9.1.jar:2.0]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3.apply
(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
at scala.Either$RightProjection.flatMap(Either.scala:277) ~[scala-librar
y.jar:0.11.2]
Caused by: java.sql.SQLException: ORA-00942: table or view does not exist
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:111) ~[classes12.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330) ~[class
es12.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287) ~[class
es12.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742) ~[classes12.ja
r:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:206) ~[clas
ses12.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:
789) ~[classes12.jar:Oracle JDBC Driver version - "10.2.0.1.0"]