Hi all,
I am using Quarz library integrated with Spring:
if the dataconnection details are wrong(let me say for instance the schema does not exist), then the exception is thrown but the process does not finishes(I guess some scheduler threads remain running).Code:<bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="configLocation" value="classpath:quartz.properties"/> <property name="autoStartup" value="false"/> <property name="jobDetails"> <list> <ref bean="commsJob"/> </list> </property> </bean>
My app is an standalone application so I am calling explicitly to:
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(resourceLocations);
The call to this function throws the exception:
And the application keeps running.Code:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schedulerFactory' defined in class path resource [cps-conf-sched-ctx.xml]: Invocation of init method failed; nested exception is org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'quartzDS': org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'ur'@'%' to database 'wrong_db') [See nested exception: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'user'@'%' to database 'wrong_db')]
Any ideas?
I would like to try shuting down the scheduler:
but the applicationcontext failed at creation time so there is no way of retrieving the scheduler :$Code:schedulerConfigurator.shutdown();
Thanks,
Zoraida


Reply With Quote