Database

將 grails 應用程序部署到 iplanet 網路伺服器

  • December 22, 2014

我在stackoverflow中問了這個問題,並被建議在這裡問。我有一個連接到幾個 Oracle 11g 數據庫的項目。所以我有3個不同的登錄名。當我從我的 grails ide 在本地執行它時,這很好。一開始它是一個笨拙的開始,但它確實有效。最初我的問題與休眠版本有關。目前是 3.6.10.10。現在我的問題是將它部署到測試伺服器。使用的伺服器是 Oracle iPlanet Web Server 7.0.15。我的 datasource.groovy 中有以下內容,錯誤如下。

dataSource {
   dialect = org.hibernate.dialect.Oracle10gDialect
   pooled = true
   properties {
       maxActive = -1
       minEvictableIdleTimeMillis=1800000
       timeBetweenEvictionRunsMillis=1800000
       numTestsPerEvictionRun=3
       testOnBorrow=true
       testWhileIdle=true
       testOnReturn=true
       validationQuery="SELECT 1 from dual"
   }
}
hibernate {
   cache.use_second_level_cache = true
   cache.use_query_cache = false
   cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
   showsql = true
}

environments {
   development {
       dataSource {
           url = "jdbc:oracle:oci:@database.whatever.com"
           username="data_user"
           password = "some_pw"
           driverClassName = 'oracle.jdbc.OracleDriver'
       }
       dataSource_task {
           url = "jdbc:oracle:oci8:@someotherdatabase.whatever.com"
           username="other_user"
           password = "other_pw"
           driverClassName = 'oracle.jdbc.OracleDriver'
       }
   }

}

這不是整個堆棧跟踪。由於尺寸限制,我不得不在這裡輸入我認為相關的內容。

[02/Dec/2014:14:52:24] info  : stdout: 2014-12-02 14:52:24,569 [main] ERROR pool.ConnectionPool  - Unable to create initial connections of pool.
[02/Dec/2014:14:52:24] info  : stdout: java.sql.SQLRecoverableException: Closed Connection
[02/Dec/2014:14:52:24] info  : stdout:  at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:689)
[02/Dec/2014:14:52:24] info  : stdout:  at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:401)
[02/Dec/2014:14:52:24] info  : stdout:  at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
[02/Dec/2014:14:52:24] info  : stdout:  at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:148)
[02/Dec/2014:14:52:24] info  : stdout:  at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
[02/Dec/2014:14:52:24] info  : stdout:  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.afterPropertiesSet(LazyConnectionDataSourceProxy.java:162)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.<init>(LazyConnectionDataSourceProxy.java:106)
[02/Dec/2014:14:52:24] info  : stdout:  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[02/Dec/2014:14:52:24] info  : stdout:  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[02/Dec/2014:14:52:24] info  : stdout:  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[02/Dec/2014:14:52:24] info  : stdout:  at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:277)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1075)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:979)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:123)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:320)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:645)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1075)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:979)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:123)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:320)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:123)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:320)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:123)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.orm.support.TransactionManagerPostProcessor.initialize(TransactionManagerPostProcessor.java:74)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.orm.support.TransactionManagerPostProcessor.setBeanFactory(TransactionManagerPostProcessor.java:52)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1532)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1500)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:123)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:720)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:156)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:169)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:127)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:122)
[02/Dec/2014:14:52:24] info  : stdout:  at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:108)
[02/Dec/2014:14:52:24] info  : stdout:  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4476)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.catalina.core.StandardContext.start(StandardContext.java:5133)
[02/Dec/2014:14:52:24] info  : stdout:  at com.sun.webserver.connector.nsapi.WebModule.start(WebModule.java:240)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.catalina.core.StandardHost.start(StandardHost.java:924)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520)
[02/Dec/2014:14:52:24] info  : stdout:  at org.apache.catalina.startup.Embedded.start(Embedded.java:917)
[02/Dec/2014:14:52:24] info  : stdout:  at com.sun.enterprise.web.PwcWebContainer.onStartup(PwcWebContainer.java:70)
[02/Dec/2014:14:52:24] info  : stdout:  at com.sun.webserver.connector.nsapi.WebContainer.start(WebContainer.java:497)
[02/Dec/2014:14:52:24] info  : stdout:  at com.sun.webserver.init.J2EERunner.confPostInit(J2EERunner.java:304)




[02/Dec/2014:14:52:24] info  : stdout: 2014-12-02 14:52:24,632 [main] ERROR context.GrailsContextLoader  - Error initializing the application: 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 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLRecoverableException: Closed Connection

有什麼建議麼?

感謝一位同事,我發現問題出在我的程序啟動腳本上。它必須指向伺服器上的 jdk 主目錄。它現在正在工作。

引用自:https://serverfault.com/questions/649221