Announcement Announcement Module
Collapse
No announcement yet.
Gettting Isssues when Integrating Quartz with Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gettting Isssues when Integrating Quartz with Spring

    I have added the following bean definitions to my applicationContext xml.

    <bean id="batchJob" class="org.springframework.scheduling.quartz.Metho dInvokingJobDetailFactoryBean">
    <property name="targetObject" ref="test"/>
    <property name="targetMethod" value="execute"/>
    <property name="concurrent" value="false" />
    </bean>

    <bean id="test" class="gov.ed.app.ats.batch.test.Test"/>


    <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronT riggerBean">
    <property name="jobDetail" ref="batchJob" />

    <property name="cronExpression" value="0 * 10 * * ?" />

    </bean>
    <bean class="org.springframework.scheduling.quartz.Sched ulerFactoryBean">
    <property name="triggers">
    <list>
    <ref bean="cronTrigger" />
    </list>
    </property>
    </bean>

    But when I am restarting the server to kick off the job.I am getting some errors.
    I am hereby enclosing my errors.

    Can anyone please help me why I am getting this issue ASAP.

  • #2
    Code:
    Caused by: java.lang.ClassNotFoundException: org.quartz.JobExecutionException
    Looks like you are missing something from your classpath.

    Comment


    • #3
      Gettting Isssues when Integrating Quartz with Spring

      I added new quartz-all-1.6.0 jar file that comes with my Spring 2.5 version and I am getting new errors now.

      I am attaching the new errors file.

      Please help me with this.

      Comment


      • #4
        Is that your entire configuration posted? I don't see a JobDetail bean.

        Comment


        • #5
          Gettting Isssues when Integrating Quartz with Spring

          As per my understanding this should replace JobDetail bean

          <bean id="batchJob" class="org.springframework.scheduling.quartz.Metho dInvokingJobDetailFactoryBean">
          <property name="targetObject" ref="test"/>
          <property name="targetMethod" value="execute"/>
          <property name="concurrent" value="false" />
          </bean>

          Please let me know if that's not the case.

          Comment


          • #6
            I used a trigger and SchedulerFactoryBean:

            Code:
            	<bean id="myJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
            		<property name="targetObject" ref="groovyGenerator" />
            		<property name="targetMethod" value="generateEntity" />
            		<property name="concurrent" value="false" />
            	</bean>
            	<bean id="myTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
            		<property name="jobDetail" ref="myJob" />
            		<!-- every minute -->
            		<property name="cronExpression" value="01 * * * * ?" />
            	</bean>
            
            	<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
            		<property name="triggers">
            			<list>
            				<ref local="myTrigger" />
            			</list>
            		</property>
            	</bean>

            Comment


            • #7
              It looks to me like an AOP problem - something you are doing is creating a proxy of your job detail bean that is not compatible with JobDetail.

              Comment


              • #8
                Gettting Isssues when Integrating Quartz with Spring

                What does that means?How the proxy is getting created.What can I do for that.

                Comment


                • #9
                  What he's saying is that it appears that Spring isn't seeing it as a type of JobDetail, but rather is seeing the proxy instead. This can be caused by a wide array of issues with your spring configuration. But it's more spring in general than a batch issue. Perhaps you could try posting the error again in the general spring forum?

                  Comment

                  Working...
                  X