Grails:尝试使用Oracle 11g XE进行配置时出错

Grails:尝试使用Oracle 11g XE进行配置时出错,grails,oracle11g,Grails,Oracle11g,我在本地安装了一个Oracle 11g XE(express edition)实例。我想让它成为适用于所有环境的Grails DB。 我有Oracle用户的用户名/密码,这里有ojdbc6.jar文件: \myAppName\lib\ojdbc6.jar 我还没有在数据库中创建任何表——我假设Grails足够聪明,可以根据需要创建表,但如果没有,那显然是个问题 以下是我的DataSource.groovy文件内容: 下面是从Windows命令行运行“grails run app”后出现的错误:

我在本地安装了一个Oracle 11g XE(express edition)实例。我想让它成为适用于所有环境的Grails DB。 我有Oracle用户的用户名/密码,这里有ojdbc6.jar文件:

\myAppName\lib\ojdbc6.jar

我还没有在数据库中创建任何表——我假设Grails足够聪明,可以根据需要创建表,但如果没有,那显然是个问题

以下是我的DataSource.groovy文件内容:

下面是从Windows命令行运行“grails run app”后出现的错误:


(非常感谢您的任何见解-我是Grails新手。谢谢)。很抱歉,我对Grails一无所知,但这可能是问题所在:

validationQuery="SELECT 1"
对于Oracle来说,这不是一个有效的查询,您得到的
ORA-00923
很可能来自于此

尝试使用此选项(在配置文件中显示的两个位置替换):

->>   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.
validationQuery="SELECT 1"
validationQuery="SELECT 1 from dual"