Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails DataSource.groovy错误_Grails - Fatal编程技术网

Grails DataSource.groovy错误

Grails DataSource.groovy错误,grails,Grails,我是Grails的新手,我正试图从《Grails在行动》一书中学习一些东西。我有一个例子,它要求更改dataSource.groovy文件中的数据源url,当我这样做时,我会得到一个错误。以下是更改和错误。有人能帮我吗?提前感谢, 以前的: dataSource { dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', '' url = "jdbc:h2:mem:d

我是Grails的新手,我正试图从《Grails在行动》一书中学习一些东西。我有一个例子,它要求更改dataSource.groovy文件中的数据源url,当我这样做时,我会得到一个错误。以下是更改和错误。有人能帮我吗?提前感谢,

以前的:

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

dataSource {
        dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
        url = "jdbc:hsqldb:file:devDB;shutdown=true"
错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': 
    Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name '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 'sessionFactory':
      Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException:
    Error creating bean with name 'hibernateProperties':
      Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException:
    Error creating bean with name 'dialectDetector':
      Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException:
    Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: 
    Cannot create JDBC driver of class 'org.h2.Driver' for connect URL 'jdbc:hsqldb:file:devDB;shutdown=true' (Use --stacktrace to see the full trace)

您已将H2更改为HSQLDB-您需要向BuildConfig.groovy添加相应的依赖项:

dependencies {
    runtime 'hsqldb:hsqldb:1.8.0.10'
}
还可以在DataSource.groovy中使用以下驱动程序:

driverClassName = "org.hsqldb.jdbcDriver" 

您已将H2更改为HSQLDB-您需要向BuildConfig.groovy添加相应的依赖项:

dependencies {
    runtime 'hsqldb:hsqldb:1.8.0.10'
}
还可以在DataSource.groovy中使用以下驱动程序:

driverClassName = "org.hsqldb.jdbcDriver" 

您已将H2更改为HSQLDB-您需要向BuildConfig.groovy添加相应的依赖项:

dependencies {
    runtime 'hsqldb:hsqldb:1.8.0.10'
}
还可以在DataSource.groovy中使用以下驱动程序:

driverClassName = "org.hsqldb.jdbcDriver" 

您已将H2更改为HSQLDB-您需要向BuildConfig.groovy添加相应的依赖项:

dependencies {
    runtime 'hsqldb:hsqldb:1.8.0.10'
}
还可以在DataSource.groovy中使用以下驱动程序:

driverClassName = "org.hsqldb.jdbcDriver" 


你是根据书改的还是怎么的?您指定的数据库似乎不存在。另外,您是否将hsqldb库添加到了
/lib
?是的,我根据书中的内容对其进行了更改。我没有专门向/lib文件夹添加任何项目。我应该吗?不,H2 jar附带Grails,因此不需要在lib dir中放置jar。通常避免这种情况-在BuildConfig.groovy中使用依赖项。Grails的哪个版本?我在Spring工具套件中安装了Grails插件,很抱歉,我不知道如何在这里查找该版本。谷歌搜索也帮不了我。你知道我在哪里能找到它吗?你是根据这本书还是怎么改的?您指定的数据库似乎不存在。另外,您是否将hsqldb库添加到了
/lib
?是的,我根据书中的内容对其进行了更改。我没有专门向/lib文件夹添加任何项目。我应该吗?不,H2 jar附带Grails,因此不需要在lib dir中放置jar。通常避免这种情况-在BuildConfig.groovy中使用依赖项。Grails的哪个版本?我在Spring工具套件中安装了Grails插件,很抱歉,我不知道如何在这里查找该版本。谷歌搜索也帮不了我。你知道我在哪里能找到它吗?你是根据这本书还是怎么改的?您指定的数据库似乎不存在。另外,您是否将hsqldb库添加到了
/lib
?是的,我根据书中的内容对其进行了更改。我没有专门向/lib文件夹添加任何项目。我应该吗?不,H2 jar附带Grails,因此不需要在lib dir中放置jar。通常避免这种情况-在BuildConfig.groovy中使用依赖项。Grails的哪个版本?我在Spring工具套件中安装了Grails插件,很抱歉,我不知道如何在这里查找该版本。谷歌搜索也帮不了我。你知道我在哪里能找到它吗?你是根据这本书还是怎么改的?您指定的数据库似乎不存在。另外,您是否将hsqldb库添加到了
/lib
?是的,我根据书中的内容对其进行了更改。我没有专门向/lib文件夹添加任何项目。我应该吗?不,H2 jar附带Grails,因此不需要在lib dir中放置jar。通常避免这种情况-在BuildConfig.groovy中使用依赖项。Grails的哪个版本?我在Spring工具套件中安装了Grails插件,很抱歉,我不知道如何在这里查找该版本。谷歌搜索也帮不了我。你知道我在哪里能找到它吗?那是一次重大降级。那是一次重大降级。那是一次重大降级。那是一次重大降级。