Announcement Announcement Module
Collapse
No announcement yet.
Spring + Quartz issue: Couldn't clean volatile data Invalid Number error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring + Quartz issue: Couldn't clean volatile data Invalid Number error

    I'm using spring and quartz to schedule jobs to trigger at different time intervals. I've created a test case in which I want the job to run every minute and i want the job details and info stored in my oracle database. When ran i get the following errors:

    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.scheduling.quartz.SchedulerFa ctoryBean' defined in file [C:\AtlasView\AtlasPro\projects\scheduler\web\WEB-INF\applicationContext.xml]: Initialization of bean failed; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery.
    org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn't clean volatile data: ORA-01722: invalid number
    [See nested exception: java.sql.SQLException: ORA-01722: invalid number


    My tables are already created in the db. Any assistance would be greatly appreciated. Thanks!


    applicationContext.xml
    Code:
    <beans>
    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false" >
    	<property name="waitForJobsToCompleteOnShutdown" value="true"/>
    	<property name="applicationContextSchedulerContextKey" value="applicationContext"/>
    	<property name="quartzProperties">
    	<props>
    	<!--  Main Scheduler Properties -->
    	<prop key="org.quartz.scheduler.instanceName"> DefaultQuartzScheduler</prop>
    	<prop key="org.quartz.scheduler.instanceId"> AUTO</prop>
    	<prop key="org.quartz.scheduler.rmi.export"> false</prop>
    	<prop key="org.quartz.scheduler.rmi.proxy"> false</prop>
    	<prop key="org.quartz.scheduler.wrapJobExecutionInUserTransaction"> false</prop>
    	<!-- ThreadPool -->
    	<prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
    	<prop key="org.quartz.threadPool.threadCount">10</prop>
    	<prop key="org.quartz.threadPool.threadPriority">5</prop>
    	<prop key="org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread">true</prop>
    	<!-- Job store -->
    	<prop key="org.quartz.jobStore.misfireThreshold">60000</prop>
    	<!-- <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>-->
    	<prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreCMT</prop>
    	<prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.oracle.OracleDelegate</prop>
    	<prop key="org.quartz.jobStore.dataSource">myDS</prop>
    	<prop key="org.quartz.jobStore.nonManagedTXDataSource">myDS</prop>
    	<prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop> 
    	<prop key="org.quartz.jobStore.useProperties">false</prop>
    	<!-- Configure Datasources -->
    	<prop key="org.quartz.dataSource.myDS.driver">oracle.jdbc.driver.OracleDriver</prop>
    	<prop key="org.quartz.dataSource.myDS.URL">jdbc:oracle:thin:</prop>
    	<prop key="org.quartz.dataSource.myDS.user">uno</prop>
    	<prop key="org.quartz.dataSource.myDS.password">uno</prop>
    	<!-- Quartz Job Plugin Information -->
    	<prop key="org.quartz.plugin.shutdownhook.class">org.quartz.plugins.management.ShutdownHookPlugin</prop>
    	<prop key="org.quartz.plugin.shutdownhook.cleanShutdown">true</prop>
    	
    	</props>
    	</property>
    	</bean>
    
    <bean id="scheduler" class="org.springframework.scheduling.quartz.JobDetailBean">
    <property name="jobClass" value="com.bah.scheduler.utilities.NewJob"/>
    </bean>
    NewJob.java
    Code:
    public class NewJob implements Job  {
    	public void execute(JobExecutionContext context)throws JobExecutionException{
    		System.out.println("Hello World " +new java.util.Date());	
    	}}
    NewScheduler.java
    Code:
    public class NewScheduler {
    	public static void main(String[] args) throws Exception {
    		
    		try{
    		System.out.println("Starting Spring Timer Version");
    		ApplicationContext context = new FileSystemXmlApplicationContext("web/WEB-INF/applicationContext.xml");
    		Scheduler scheduler = (Scheduler)context.getBean("scheduler");
    		
    		System.out.println("Starting Scheduler");
    		scheduler.start();}
    catch(SchedulerException se){
    			se.printStackTrace();
    		}}}
    Last edited by bkc6m; Mar 11th, 2009, 10:07 AM.

  • #2
    What are the details of the interaction between your code and the database? It's very possible I'm blind, but I don't see any code which interacts with the database.

    ORA-01722 is thrown when it tries to convert a non-numeric string into a number. Could you be passing an invalid or null value to Oracle?

    Here's some more info on the Oracle error:

    http://www.orafaq.com/wiki/ORA-01722

    Also, you can write [CODE ] ... [ /CODE] around your source code when you post to the forum, and it will be much easier to read.

    Comment


    • #3
      Maybe i'm confused on how jobs are stored in the DB, but my understanding is that by configuring the jobstore and datasource in the quartzproperties defined within my applicationContext.xml file, that allows a connection to the database. By defining jobs and triggers (within applicationContext.xml) and then running the scheduler (NewScheduler.java), will fire those jobs and save them to the DB. Is that not what happens? Is more code needed to save jobs to the DB?

      Comment


      • #4
        Hi friends, I was looking for some information about the garden tools but still unable to find the rarlevent information so it would be great if any one can refer me a page with the required information.

        Comment

        Working...
        X