0

我已经将一个 grails 应用程序部署到了 tomcat 容器中,但是没有得到合适的驱动程序异常:任何人都可以帮助解决这个问题。

SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoader Listener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'h ibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationExc eption: 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  'oracle.jdbc.OracleDriver' for connect URL 'jdbc:xxxx:oracle://xxxxx:1521;ServiceName=xxxx'> 

        at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterce ptorAggregator.groovy:104) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve refe rence to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframewo rk.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 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:xxxx:oracle://xxxx :1521;xxxx=xxxx'
        ... 1 more


Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init meth od failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exc eption is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:in formatica:oracle://xxxx:1521;xxx=xxx'
        ... 1 more


Caused by: org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache .commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:xxx:oracle://xxxx:1521;xxxx=xxxx'
        ... 1 more


Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc: xxxx:oracle://xxxx:1521;xxxx=xxxx'
        at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
        ... 1 more Caused by: java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:264)
        at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
        ... 3 more

May 30, 2013 7:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
May 30, 2013 7:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Jarvis] startup failed due to previous errors
May 30, 2013 7:31:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
4

1 回答 1

0

更新了依赖定义示例

将以下存储库定义添加到您的BuildConfig.groovy

mavenRepo "https://code.lds.org/nexus/content/groups/main-repo"

在您的依赖项部分中,应出现以下内容:

runtime 'com.oracle:ojdbc6:11.2.0.3'

更好的方法是将 Oracle 驱动程序手动安装到您的公司存储库(Artifactory、Nexus、Archiva、文件服务器等)

于 2013-05-30T21:15:40.317 回答