Announcement Announcement Module
Collapse
No announcement yet.
SchedulerFactory does noet shutdown if exception while connection factory creation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 02:50 AM.
Working...
X