Results 1 to 1 of 1

Thread: SchedulerFactory does noet shutdown if exception while connection factory creation

  1. #1
    Join Date
    May 2010
    Posts
    14

    Default SchedulerFactory does noet shutdown if exception while connection factory creation

    Hi all,

    I am using Quarz library integrated with Spring:
    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>
    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).

    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:

    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')]
    And the application keeps running.
    Any ideas?

    I would like to try shuting down the scheduler:
    Code:
    schedulerConfigurator.shutdown();
    but the applicationcontext failed at creation time so there is no way of retrieving the scheduler :$

    Thanks,

    Zoraida
    Last edited by zeta; May 8th, 2012 at 01:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •