当play2访问oracle时,表或视图不存在

时间:2012-07-18 06:39:04

标签: oracle hibernate jpa playframework playframework-2.0

大家。我在play2.0中使用了hibernate 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"]

1 个答案:

答案 0 :(得分:0)

尝试连接到数据库并验证表是否存在(只读)。 在您的application.conf文件中执行类似的操作, 进化=禁用。