wood burning stoves 2.0*
The moose likes Other Application Frameworks and the fly likes Spring Quartz migration to WAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring Quartz migration to WAS" Watch "Spring Quartz migration to WAS" New topic
Author

Spring Quartz migration to WAS

Hitesh Gupta
Greenhorn

Joined: Jul 03, 2008
Posts: 15
Hi,

I had executed a spring Quartz project as a stand alone java application. Now, I am trying to deploy it on a Server, where it will deployed in to ear file and will be called automatically.

Please find the files created:

sqTest.java

package com.hitesh.java;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class sqTest {
public static void main(String[] args) {
System.out.println("Before Scheduler starts....");
ApplicationContext ctx = new ClassPathXmlApplicationContext("ApplicationContext.xml");
System.out.println("After Scheduler starts....");
}}

MyJob.java

package com.hitesh.java;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
public class MyJob extends QuartzJobBean {
protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
System.out.println("EXECUTING QUARTZ JOB");
}}

ApplicationContext.xml

<?xml version="1.0" encoding="UTF-8" ?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

<bean name="myJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.hitesh.java.MyJob"/>
</bean>


<bean id="simpleTrigger"
class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="myJob"/>
<property name="startDelay" value="2000"/>
<property name="repeatInterval" value="1000"/>
</bean>

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="simpleTrigger"/>
</list>
</property>
</bean>
</beans>

This xml is placed at project level. Jar files needed are Spring.jar, Quartz-1.5.0.jar

Please let me know how to migrate this thing EAR which can be executed on a Server and process is executed automatically.

Regards,
Hitesh
Hitesh Gupta
Greenhorn

Joined: Jul 03, 2008
Posts: 15
Hi,
I am able to do it.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring Quartz migration to WAS
 
Similar Threads
Spring AOP not working
Problem with Spring AOP
Spring AOP question
Spring 2.5 and AOP - BeanPostProcessor before instantiation of bean failed
Quartz Trigger Issue