2012-07-18 40 views
0

everyone。我在play2.0中使用hibernate jpa。首先,我使用H2,它進展順利。然後我用oracle代替,並且jpa正確地爲我創建表。但是,當我送打任何請求,它報告錯誤:當play2訪問oracle時,表或視圖不存在

[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"] 

回答

0

嘗試連接到數據庫,並驗證該表確實存在(只讀)。 在您的application.conf文件中執行類似 evolution = disabled。

+0

非常感謝您的回答。我自動驗證由jpa創建的表。我添加evolution = disabled並且它工作正常。 – 2012-07-25 11:31:23

相關問題