2013-05-04 57 views
1

我有本地安裝的Oracle 11g XE(快速版)實例。我會把它作爲我所有環境中的Grails DB。 我對Oracle用戶的用戶名/密碼,我已經找到這裏的ojdbc6.jar文件:Grails:嘗試使用Oracle 11g進行配置時出錯XE

\ myAppName \ LIB \ ojdbc6.jar

,我還沒有創建數據庫中的任何表尚未 - 我假設Grails是足夠聰明根據需要創建表,但如果沒有,那可以清楚地是一個問題......

這裏是我的DataSource.groovy文件中的內容:

dataSource { 
    //ORACLE 
    dbCreate = "create-drop" 
    url = "jdbc:oracle:thin:@127.0.0.1:1521:XE" 
    pooled = true 
    username = "mills_gtunes" 
    password = "*******" 
    driverClassName = "oracle.jdbc.driver.OracleDriver" 
    //   dialect= "org.hibernate.dialect.Oracle10gDialect" 
    dialect= "org.hibernate.dialect.OracleDialect" 

    properties { 
     maxActive = -1 
     minEvictableIdleTimeMillis=1800000 
     timeBetweenEvictionRunsMillis=1800000 
     numTestsPerEvictionRun=3 
     testOnBorrow=true 
     testWhileIdle=true 
     testOnReturn=true 
     validationQuery="SELECT 1" 
    } 
} 


hibernate { 
    cache.use_second_level_cache = true 
    cache.use_query_cache = false 
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' 
} 
// environment specific settings 
environments { 
    development { 
     dataSource { 

      //H2 
      // dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', '' 
      // url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000" 

      //ORACLE 
      dbCreate = "create-drop" 
      url = "jdbc:oracle:thin:@127.0.0.1:1521:XE" 
      pooled = true 
      username = "mills_gtunes" 
      password = "******" 
      driverClassName = "oracle.jdbc.driver.OracleDriver" 
      dialect= "org.hibernate.dialect.OracleDialect" 

      properties { 
       maxActive = -1 
       minEvictableIdleTimeMillis=1800000 
       timeBetweenEvictionRunsMillis=1800000 
       numTestsPerEvictionRun=3 
       testOnBorrow=true 
       testWhileIdle=true 
       testOnReturn=true 
       validationQuery="SELECT 1" 
      } 
     } 
    } 

,這裏是我運行後收到錯誤從Windows命令行「的Grails運行應用程序」:

->> 91 | newSQLException in oracle.jdbc.driver.SQLStateMapping 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 133 | newSQLException in oracle.jdbc.driver.DatabaseError 
| 206 | throwSqlException in  '' 
| 455 | processError in oracle.jdbc.driver.T4CTTIoer 
| 413 | processError in  '' 
| 1034 | receive in oracle.jdbc.driver.T4C8Oall 
| 183 | doOall8 . in oracle.jdbc.driver.T4CStatement 
| 780 | executeForDescribe in  '' 
| 855 | executeMaybeDescribe in  '' 
| 1186 | doExecuteWithTimeout in oracle.jdbc.driver.OracleStatement 
| 1377 | executeQuery in  '' 
| 387 | executeQuery in oracle.jdbc.driver.OracleStatementWrapper 
| 208 | executeQuery in org.apache.commons.dbcp.DelegatingStatement 
| 658 | validateConnection in org.apache.commons.dbcp.PoolableConnectionFacto 
ry 
| 1558 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource 
| 1545 | createPoolableConnectionFactory in  '' 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 334 | innerRun in java.util.concurrent.FutureTask$Sync 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 
| Error 2013-05-04 14:47:22,691 [localhost-startStop-1] ERROR context.GrailsCont 
extLoader - Error initializing Grails: Error creating bean with name 'transacti 
onManagerPostProcessor': Initialization of bean failed; nested exception is org. 
springframework.beans.factory.BeanCreationException: Error creating bean with na 
me 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while 
setting bean property 'sessionFactory'; nested exception is org.springframework 
.beans.factory.BeanCreationException: Error creating bean with name 'sessionFact 
ory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean p 
roperty 'lobHandler'; nested exception is org.springframework.beans.factory.Bean 
CreationException: Error creating bean with name 'lobHandlerDetector': Invocatio 
n of init method failed; nested exception is org.springframework.jdbc.support.Me 
taDataAccessException: Error while extracting DatabaseMetaData; nested exception 
is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnection 
Factory (ORA-00923: FROM keyword not found where expected 
) 
Message: Error creating bean with name 'transactionManagerPostProcessor': Initia 
lization of bean failed; nested exception is org.springframework.beans.factory.B 
eanCreationException: Error creating bean with name 'transactionManager': Cannot 
resolve reference to bean 'sessionFactory' while setting bean property 'session 
Factory'; nested exception is org.springframework.beans.factory.BeanCreationExce 
ption: Error creating bean with name 'sessionFactory': Cannot resolve reference 
to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; nested ex 
ception is org.springframework.beans.factory.BeanCreationException: Error creati 
ng bean with name 'lobHandlerDetector': Invocation of init method failed; nested 
exception is org.springframework.jdbc.support.MetaDataAccessException: Error wh 
ile extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQL 
NestedException: Cannot create PoolableConnectionFactory (ORA-00923: FROM keywor 
d not found where expected 
) 
    Line | Method 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by BeanCreationException: Error creating bean with name 'transactionManag 
er': Cannot resolve reference to bean 'sessionFactory' while setting bean proper 
ty 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanC 
reationException: Error creating bean with name 'sessionFactory': Cannot resolve 
reference to bean 'lobHandlerDetector' while setting bean property 'lobHandler' 
; nested exception is org.springframework.beans.factory.BeanCreationException: E 
rror creating bean with name 'lobHandlerDetector': Invocation of init method fai 
led; nested exception is org.springframework.jdbc.support.MetaDataAccessExceptio 
n: Error while extracting DatabaseMetaData; nested exception is org.apache.commo 
ns.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00923: 
FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by BeanCreationException: Error creating bean with name 'sessionFactory': 
Cannot resolve reference to bean 'lobHandlerDetector' while setting bean proper 
ty 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreat 
ionException: Error creating bean with name 'lobHandlerDetector': Invocation of 
init method failed; nested exception is org.springframework.jdbc.support.MetaDat 
aAccessException: Error while extracting DatabaseMetaData; nested exception is o 
rg.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFacto 
ry (ORA-00923: FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by BeanCreationException: Error creating bean with name 'lobHandlerDetect 
or': Invocation of init method failed; nested exception is org.springframework.j 
dbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; ne 
sted exception is org.apache.commons.dbcp.SQLNestedException: Cannot create Pool 
ableConnectionFactory (ORA-00923: FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nest 
ed exception is org.apache.commons.dbcp.SQLNestedException: Cannot create Poolab 
leConnectionFactory (ORA-00923: FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00923 
: FROM keyword not found where expected 
) 
->> 1549 | createPoolableConnectionFactory in org.apache.commons.dbcp.BasicDataS 
ource 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 334 | innerRun in java.util.concurrent.FutureTask$Sync 
| 166 | run . . . in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run  in java.lang.Thread 

Caused by SQLSyntaxErrorException: ORA-00923: FROM keyword not found where expec 
ted 

->> 91 | newSQLException in oracle.jdbc.driver.SQLStateMapping 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 133 | newSQLException in oracle.jdbc.driver.DatabaseError 
| 206 | throwSqlException in  '' 
| 455 | processError in oracle.jdbc.driver.T4CTTIoer 
| 413 | processError in  '' 
| 1034 | receive in oracle.jdbc.driver.T4C8Oall 
| 183 | doOall8 . in oracle.jdbc.driver.T4CStatement 
| 780 | executeForDescribe in  '' 
| 855 | executeMaybeDescribe in  '' 
| 1186 | doExecuteWithTimeout in oracle.jdbc.driver.OracleStatement 
| 1377 | executeQuery in  '' 
| 387 | executeQuery in oracle.jdbc.driver.OracleStatementWrapper 
| 208 | executeQuery in org.apache.commons.dbcp.DelegatingStatement 
| 658 | validateConnection in org.apache.commons.dbcp.PoolableConnectionFacto 
ry 
| 1558 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource 
| 1545 | createPoolableConnectionFactory in  '' 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 334 | innerRun in java.util.concurrent.FutureTask$Sync 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 
| Error 2013-05-04 14:47:22,729 [localhost-startStop-1] ERROR [localhost].[/gTun 
es] - Exception sending context initialized event to listener instance of class 
org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 
Message: Error creating bean with name 'transactionManagerPostProcessor': Initia 
lization of bean failed; nested exception is org.springframework.beans.factory.B 
eanCreationException: Error creating bean with name 'transactionManager': Cannot 
resolve reference to bean 'sessionFactory' while setting bean property 'session 
Factory'; nested exception is org.springframework.beans.factory.BeanCreationExce 
ption: Error creating bean with name 'sessionFactory': Cannot resolve reference 
to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; nested ex 
ception is org.springframework.beans.factory.BeanCreationException: Error creati 
ng bean with name 'lobHandlerDetector': Invocation of init method failed; nested 
exception is org.springframework.jdbc.support.MetaDataAccessException: Error wh 
ile extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQL 
NestedException: Cannot create PoolableConnectionFactory (ORA-00923: FROM keywor 
d not found where expected 
) 
    Line | Method 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by BeanCreationException: Error creating bean with name 'transactionManag 
er': Cannot resolve reference to bean 'sessionFactory' while setting bean proper 
ty 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanC 
reationException: Error creating bean with name 'sessionFactory': Cannot resolve 
reference to bean 'lobHandlerDetector' while setting bean property 'lobHandler' 
; nested exception is org.springframework.beans.factory.BeanCreationException: E 
rror creating bean with name 'lobHandlerDetector': Invocation of init method fai 
led; nested exception is org.springframework.jdbc.support.MetaDataAccessExceptio 
n: Error while extracting DatabaseMetaData; nested exception is org.apache.commo 
ns.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00923: 
FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by BeanCreationException: Error creating bean with name 'sessionFactory': 
Cannot resolve reference to bean 'lobHandlerDetector' while setting bean proper 
ty 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreat 
ionException: Error creating bean with name 'lobHandlerDetector': Invocation of 
init method failed; nested exception is org.springframework.jdbc.support.MetaDat 
aAccessException: Error while extracting DatabaseMetaData; nested exception is o 
rg.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFacto 
ry (ORA-00923: FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by BeanCreationException: Error creating bean with name 'lobHandlerDetect 
or': Invocation of init method failed; nested exception is org.springframework.j 
dbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; ne 
sted exception is org.apache.commons.dbcp.SQLNestedException: Cannot create Pool 
ableConnectionFactory (ORA-00923: FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nest 
ed exception is org.apache.commons.dbcp.SQLNestedException: Cannot create Poolab 
leConnectionFactory (ORA-00923: FROM keyword not found where expected 
) 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

Caused by SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00923 
: FROM keyword not found where expected 
) 
->> 1549 | createPoolableConnectionFactory in org.apache.commons.dbcp.BasicDataS 
ource 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 334 | innerRun in java.util.concurrent.FutureTask$Sync 
| 166 | run . . . in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run  in java.lang.Thread 

Caused by SQLSyntaxErrorException: ORA-00923: FROM keyword not found where expec 
ted 

->> 91 | newSQLException in oracle.jdbc.driver.SQLStateMapping 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 133 | newSQLException in oracle.jdbc.driver.DatabaseError 
| 206 | throwSqlException in  '' 
| 455 | processError in oracle.jdbc.driver.T4CTTIoer 
| 413 | processError in  '' 
| 1034 | receive in oracle.jdbc.driver.T4C8Oall 
| 183 | doOall8 . in oracle.jdbc.driver.T4CStatement 
| 780 | executeForDescribe in  '' 
| 855 | executeMaybeDescribe in  '' 
| 1186 | doExecuteWithTimeout in oracle.jdbc.driver.OracleStatement 
| 1377 | executeQuery in  '' 
| 387 | executeQuery in oracle.jdbc.driver.OracleStatementWrapper 
| 208 | executeQuery in org.apache.commons.dbcp.DelegatingStatement 
| 658 | validateConnection in org.apache.commons.dbcp.PoolableConnectionFacto 
ry 
| 1558 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource 
| 1545 | createPoolableConnectionFactory in  '' 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 334 | innerRun in java.util.concurrent.FutureTask$Sync 
| 166 | run  in java.util.concurrent.FutureTask 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 
| Error 2013-05-04 14:47:22,761 [localhost-startStop-1] ERROR core.StandardConte 
xt - Error listenerStart 
| Error 2013-05-04 14:47:22,764 [localhost-startStop-1] ERROR core.StandardConte 
xt - Context [/gTunes] startup failed due to previous errors 
| Server running. Browse to http://localhost:8080/gTunes 
| Application loaded in interactive mode. Type 'stop-app' to shutdown. 

(任何有識之士將非常感激 - 我新到Grails。謝謝)。

回答

2

對不起不知道Grails的事情,但是這可能是問題:

validationQuery="SELECT 1" 

這不是甲骨文有效的查詢,以及ORA-00923你得到很可能是從那來的。

這種嘗試(在它出現在你的配置文件這兩個地方更換):

validationQuery="SELECT 1 from dual" 
+0

確定會盡力的,謝謝 – 2013-05-04 19:36:07

+0

你是一個聰明開溜,墊。這工作。 – 2013-05-04 19:41:30

相關問題