> On Tue, Sep 25, 2012 at 7:03 AM, Peter Ledbrook <
[hidden email]
> <mailto:
[hidden email]>> wrote:
> Also, do you have a stacktrace? That will at least help determine what
> is throwing the exception and hence where you should focus on coding
> your own solution.
On 9/25/12 5:22 PM, Brian Saville wrote:> We've noticed this as well and
always happens in the internals of
> grails. It would GREAT to have the application continue to start and
> keep trying, or just to start and report the datasource as down, as it
> does after the application is started and the datasource goes down. Do
> you think we could file a JIRA on this to get it addressed in grails-core?
Yes that would be a great feature, especially for applications with
multiple datasources.
I'm currently working on an application with many datasources, and not
being able to start it just because 5% of the functionality isn't there
somehow sucks.
Here's a stack trace of what happens in our application if e.g. a
Oracle-based datasource is not available during startup (sorry, long and
badly line-wrapped):
| Loading Grails 2.1.0
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Running Grails application
ERROR web.context.GrailsContextLoader - Error executing bootstraps:
Error creating bean with name 'voice.BusinessunitValidator_voice':
Cannot resolve reference to bean 'sessionFactory_voice' while setting
bean property 'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'sessionFactory_voice': Cannot resolve reference to bean
'lobHandlerDetector_voice' while setting bean property 'lobHandler';
nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'lobHandlerDetector_voice': 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
PoolableConnectionFactory (Io exception: The Network Adapter could not
establish the connection)
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'voice.BusinessunitValidator_voice': Cannot resolve
reference to bean 'sessionFactory_voice' while setting bean property
'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'sessionFactory_voice': Cannot resolve reference to bean
'lobHandlerDetector_voice' while setting bean property 'lobHandler';
nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'lobHandlerDetector_voice': 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
PoolableConnectionFactory (Io exception: The Network Adapter could not
establish the connection)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory_voice': Cannot resolve
reference to bean 'lobHandlerDetector_voice' while setting bean property
'lobHandler'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'lobHandlerDetector_voice': 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
PoolableConnectionFactory (Io exception: The Network Adapter could not
establish the connection)
... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'lobHandlerDetector_voice': 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
PoolableConnectionFactory (Io exception: The Network Adapter could not
establish the connection)
... 5 more
Caused by: org.springframework.jdbc.support.MetaDataAccessException:
Error while extracting DatabaseMetaData; nested exception is
org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Io exception: The Network Adapter could not
establish the connection)
... 5 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Io exception: The Network Adapter could not
establish the connection)
at
org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
... 5 more
Caused by: java.sql.SQLException: Io exception: The Network Adapter
could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at
org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email