What do you call persistent jobs? Things that deals with persitent data or
what?

About database connection, I defined a datasource a file my-app-ds.xml and
it's managed by jboss.
I don't have any jobstore to sore my single job. It's started with my
servlet i paste there.

About quartz.properties, i' haven' suceed to make quartz taking mine in
account. it always starts with
its default properties file included in its jar. Even when i tried with my
own quartz/struts plugin...

Anyway, it would be intersting to have a look on your code.

Rgds,

my servlet :


package com.equant.refce.servlet;

import java.io.IOException;

import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;

import org.apache.log4j.Logger;

import my-app.jobs.ScheduleMassTreatmentJob;
import my-app.InternalConstants;

public class QuartzInitializerServlet implements Servlet {

 /***
  * @see javax.servlet.Servlet#init(ServletConfig)
  */
 public void init(ServletConfig arg0) throws ServletException
 {
  Logger log = Logger.getLogger(QuartzInitializerServlet.class);
  log.info("init : creating SchedulerFactory");
  SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
  log.info("init : creating scheduleMassTreatmentTrigger");
  JobDetail scheduleMassTreatmentJob = new
JobDetail("scheduleMassTreatmentJob", "refceJobGroup",
ScheduleMassTreatmentJob.class);
  log.info("init : creating scheduleMassTreatmentTrigger");
  CronTrigger scheduleMassTreatmentTrigger = new
CronTrigger("scheduleMassTreatmentTrigger", "refceTriggerGroup");

  try
  {
   String cronExpression = InternalConstants.SCHEDULE_MASS_TREATMENT_TRIGGER
;
   if (cronExpression==null || cronExpression.length()==0){
    log.warn("init : null or empty property : "+
InternalConstants.PROP_SCHEDULE_MASS_TREATMENT_TRIGGER +" : creating
scheduleMassTreatmentTrigger set to default value
"+InternalConstants.DEFAULT_SCHEDULE_MASS_TREATMENT_TRIGGER);
    cronExpression=InternalConstants.DEFAULT_SCHEDULE_MASS_TREATMENT_TRIGGER
;
   }
   else{
    log.info("init : creating scheduleMassTreatmentTrigger set to value
"+cronExpression);
   }
   scheduleMassTreatmentTrigger.setCronExpression(cronExpression);
   log.info("init : getting Scheduler");
   Scheduler sched = schedFact.getScheduler();
   log.info("init : starting Scheduler");
   sched.start();
   log.info("init : starting JobDetail :
"+scheduleMassTreatmentJob.getName());
   sched.scheduleJob(scheduleMassTreatmentJob,
scheduleMassTreatmentTrigger);
  }
  catch (Exception e)
  {
   e.printStackTrace();
  }
 }

 /***
  * @see javax.servlet.Servlet#getServletConfig()
  */
 public ServletConfig getServletConfig()
 {
  return null;
 }

 /***
  * @see javax.servlet.Servlet#service(ServletRequest, ServletResponse)
  */
 public void service(ServletRequest arg0, ServletResponse arg1)
 throws ServletException, IOException {}

 /***
  * @see javax.servlet.Servlet#getServletInfo()
  */
 public String getServletInfo()
 {
  return null;
 }

 /***
  * @see javax.servlet.Servlet#destroy()
  */
 public void destroy()
 {
 }

}



2006/1/13, Marco Mistroni <[EMAIL PROTECTED]>:
>
> Hello,
>        Ok....   anyway, I have used it also outside spring..
> Basically what I did was to write a simple plugIn that initializes
> The quartz scheduler, that's all you need
>
> Now, looks to me ur error may be due to some properties not configured
> Are you using persistent jobs?
> If so, have you defined the connection to the database etc? the jobstore
> class etc?
>
> I m afraid I have the code @home, so I can't help you here, but I'll take
> Ur email (with your permissions) and If I find my old code at home, I'll
> Send you  my quartz.properties as well as the plugin that I use for
> initializing Quartz
>
> Regards
>        marco
>
> -----Original Message-----
> From: lio struts [mailto:[EMAIL PROTECTED]
> Sent: 13 January 2006 10:58
> To: Struts Users Mailing List
> Subject: Re: quartz plugin issue
>
> spring seems to be a big hammer for a little nail...
> Thanks for your advice anyway
> I gave up jgsullivan plugin (no way to make it work) and i'm to lazy and
> short in time to make my own.
>
> I just coded a another servlet that do the jbo (starting by web.xml next
> to
> struts)
>
>
> 2006/1/13, Marco Mistroni <[EMAIL PROTECTED]>:
> >
> > Hello,
> >        I have used Quartz with struts via Spring framework, and
> > Everything has worked just fine...
> > I have run it on JBoss 3.0.2 and tomcat 5.5 without problems..
> > Moving to spring avoided me having different config files just
> > For quartz.
> > I'll suggest you go that way, spring supports quartz quite easily..
> > HTH
> >        marco
> >
> > -----Original Message-----
> > From: lio struts [mailto:[EMAIL PROTECTED]
> > Sent: 12 January 2006 17:42
> > To: user@struts.apache.org
> > Subject: Re: quartz plugin issue
> >
> > I did excactly the same with quartz-1.5.1 (it seems to include jboss
> > special
> > features)and i have no problem on startup.
> > I have to go further to say it works...
> >
> >
> > 2006/1/12, lio struts <[EMAIL PROTECTED]>:
> > >
> > > Hello world,
> > >
> > > I'm trying to use http://demo.jgsullivan.com/struts/ quartz plugin for
> > > struts.
> > > I use JBoss3.2.2/Tomcat-4.1and quartz 1.4.5
> > >
> > > In my struts-config i've addded :
> > >
> > >
> > > <!-- Quartz plugin : http://demo.jgsullivan.com/struts/index.html -->
> > >
> > > <plug-in className="com.jgsullivan.struts.plugins.QuartzPlugIn ">
> > >
> > > <set-property property="configPath" value="/WEB-INF/quartz-config.xml
> "/>
> > >
> > > </plug-in> In my WEB-INF, the file quartz-config.xml :
> > >
> > >
> > > <?
> > > xml version= "1.0" encoding="ISO-8859-1" ?>
> > >
> > > <
> > > quartz-config>
> > >
> > > <trigger-group name="refCeTriggerGroup">
> > >
> > > <trigger name= "scheduleMassTreatmentTrigger"
> > >
> > > className="org.quartz.SimpleTrigger "
> > >
> > > description="A Trigger to treat mass action : save and change" >
> > >
> > > <!-- <set-property property="cronExpression" value="0 0 12 * * ?" />
> -->
> > >
> > > <set-property property= "startTime" value="01/01/2005 01:00:00"/>
> > >
> > > <set-property property= "repeatCount" value="5" />
> > >
> > > <set-property property= "repeatInterval" value="100" />
> > >
> > > </trigger>
> > >
> > > </trigger-group>
> > >
> > > <!-- Create a Job -->
> > >
> > > <job-group name= "scheduleMassTreatmentJobGroup">
> > >
> > > <job name= "scheduleMassTreatmentJob"
> > >
> > > description="A job to treat mass action : save and change"
> > >
> > > className="com.equant.refce.module.ScheduleMassTreatmentModule "
> > >
> > > durability="true" volatility ="true" />
> > >
> > > </job-group>
> > >
> > >
> > >
> > > <!-- Schedule the Job/Trigger -->
> > >
> > > <schedule job= "scheduleMassTreatmentJob"
> > >
> > > trigger="scheduleMassTreatmentTrigger" />
> > >
> > > <schedule jobGroup= "scheduleMassTreatmentJobGroup"
> > >
> > > triggerGroup="refCeTriggerGroup" job="scheduleMassTreatmentJob"
> > >
> > > trigger="scheduleMassTreatmentTrigger" />
> > >
> > >
> > >
> > > </
> > > quartz-config>
> > >
> > > And in WEB-INF/classes, the file quartz.properties :
> > >
> > > org.quartz.threadPool.class =
> > > org.quartz.simpl.SimpleThreadPool
> > >
> > > org.quartz.threadPool.threadCount =
> > > 5
> > >
> > > org.quartz.threadPool.threadPriority =
> > > 4
> > >
> > > org.quartz.jobStore.misfireThreshold =
> > > 5000
> > >
> > > org.quartz.jobStore.class =
> > > org.quartz.simpl.RAMJobStore
> > >
> > >
> > >
> > > Even if by now these values are a bit meaningless, but my issue doe
> not
> > > come from that (i guess)
> > >
> > > if have a look on error on startup :
> > >
> > >
> > >
> > > 17:13:15,235 INFO [PlugInSupport] Initializing QuartzPlugIn
> > >
> > > 17:13:15,548 INFO [RAMJobStore] RAMJobStore initialized.
> > >
> > > 17:13:15,548 INFO [StdSchedulerFactory] Quartz scheduler
> > 'QuartzScheduler'
> > > initialized from default resource file in Quartz package: '
> > > quartz.properties'
> > >
> > > 17:13:15,563 INFO [StdSchedulerFactory] Quartz scheduler version:
> 1.4.5
> > >
> > > 17:13:15,704 ERROR [STDERR]
> > > *java.lang.NullPointerException
> > >
> > > *
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > com.jgsullivan.quartz.SchedulerBuilder.setTriggerDefaults(
> > > *SchedulerBuilder.java:250*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > com.jgsullivan.quartz.SchedulerBuilder.buildScheduler(
> > > *SchedulerBuilder.java:214*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > com.jgsullivan.quartz.SchedulerBuilder.buildScheduler(
> > > *SchedulerBuilder.java:178*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > com.jgsullivan.struts.plugins.QuartzPlugIn.init(
> > > *QuartzPlugIn.java:97*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > com.jgsullivan.struts.plugins.PlugInSupport.init(
> > > *PlugInSupport.java:276*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.struts.action.ActionServlet.initModulePlugIns(
> > > *ActionServlet.java:839*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > org.apache.struts.action.ActionServlet.init
> > > (
> > > *ActionServlet.java:332*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at javax.servlet.GenericServlet.init(
> > > *GenericServlet.java:256*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.catalina.core.StandardWrapper.loadServlet(
> > > *StandardWrapper.java:935*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.catalina.core.StandardWrapper.load(
> > > *StandardWrapper.java:823*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.catalina.core.StandardContext.loadOnStartup(
> > > *StandardContext.java:3421*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.catalina.core.StandardContext.start(
> > > *StandardContext.java:3609*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.catalina.core.ContainerBase.addChildInternal(
> > > *ContainerBase.java:821*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.catalina.core.ContainerBase.addChild(
> > > *ContainerBase.java:807*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.apache.catalina.core.StandardHost.addChild(
> > > *StandardHost.java:579*)
> > >
> > > 17:13:15,719 ERROR [STDERR] at
> > > org.jboss.web.tomcat.tc4.EmbeddedTomcatService.createWebContext(
> > > *EmbeddedTomcatService.java:530*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > org.jboss.web.tomcat.tc4.EmbeddedTomcatService.performDeploy(
> > > *EmbeddedTomcatService.java:309*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> org.jboss.web.AbstractWebContainer.start(
> > > *AbstractWebContainer.java:428*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start
> (
> > > *MainDeployer.java:832*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> org.jboss.deployment.MainDeployer.deploy(
> > > *MainDeployer.java:642*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> org.jboss.deployment.MainDeployer.deploy(
> > > *MainDeployer.java:605*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > *DelegatingMethodAccessorImpl.java:25*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at java.lang.reflect.Method.invoke(
> > > *Method.java:324*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(
> > > *ReflectedMBeanDispatcher.java:284*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > org.jboss.mx.server.MBeanServerImpl.invoke(
> > > *MBeanServerImpl.java:546*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(
> > > *MBeanProxyExt.java:177*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at $Proxy6.deploy(Unknown Source)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > org.jboss.deployment.scanner.URLDeploymentScanner.deploy(
> > > *URLDeploymentScanner.java:302*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > org.jboss.deployment.scanner.URLDeploymentScanner.scan(
> > > *URLDeploymentScanner.java:476*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > >
> >
> >
>
> org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan
> > > (
> > > *AbstractDeploymentScanner.java:201* )
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(
> > > *AbstractDeploymentScanner.java:274* )
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > org.jboss.system.ServiceMBeanSupport.start(
> > > *ServiceMBeanSupport.java:192*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > sun.reflect.GeneratedMethodAccessor5.invoke(Unknown
> > > Source)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > *DelegatingMethodAccessorImpl.java:25*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at java.lang.reflect.Method.invoke(
> > > *Method.java:324*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > > org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(
> > > *ReflectedMBeanDispatcher.java:284*)
> > >
> > > 17:13:15,735 ERROR [STDERR] at
> > org.jboss.mx.server.MBeanServerImpl.invoke(
> > > *MBeanServerImpl.java:546*)
> > >
> > > 17:13:15,751 ERROR [STDERR] at
> > > org.jboss.system.ServiceController$ServiceProxy.invoke(
> > > *ServiceController.java:976*)
> > >
> > > 17:13:15,751 ERROR [STDERR] at $Proxy0.start(Unknown Source)
> > >
> > > 17:13:15,751 ERROR [STDERR] at
> org.jboss.system.ServiceController.start(
> > > *ServiceController.java:394*)
> > >
> > > 17:13:15,751 ERROR [STDERR] at
> > sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
> > > Source)
> > >
> > > 17:13:15,751 ERROR [STDERR] at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > *DelegatingMethodAccessorImpl.java:25*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at java.lang.reflect.Method.invoke(
> > > *Method.java:324*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at
> > > org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(
> > > *ReflectedMBeanDispatcher.java:284*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at
> > org.jboss.mx.server.MBeanServerImpl.invoke(
> > > *MBeanServerImpl.java:546*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(
> > > *MBeanProxyExt.java:177*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at $Proxy4.start(Unknown Source)
> > >
> > > 17:13:15,766 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(
> > > *SARDeployer.java:226*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start
> (
> > > *MainDeployer.java:832*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at
> org.jboss.deployment.MainDeployer.deploy(
> > > *MainDeployer.java:642*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at
> org.jboss.deployment.MainDeployer.deploy(
> > > *MainDeployer.java:605*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at
> org.jboss.deployment.MainDeployer.deploy(
> > > *MainDeployer.java:589*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(
> > > *Native Method*)
> > >
> > > 17:13:15,766 ERROR [STDERR] at
> > sun.reflect.NativeMethodAccessorImpl.invoke
> > > (
> > > *NativeMethodAccessorImpl.java:39*)
> > >
> > > 17:13:15,782 ERROR [STDERR] at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > *DelegatingMethodAccessorImpl.java:25*)
> > >
> > > 17:13:15,782 ERROR [STDERR] at java.lang.reflect.Method.invoke(
> > > *Method.java:324*)
> > >
> > > 17:13:15,782 ERROR [STDERR] at
> > > org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(
> > > *ReflectedMBeanDispatcher.java:284*)
> > >
> > > 17:13:15,782 ERROR [STDERR] at
> > org.jboss.mx.server.MBeanServerImpl.invoke(
> > > *MBeanServerImpl.java:546*)
> > >
> > > 17:13:15,782 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(
> > > *MBeanProxyExt.java:177*)
> > >
> > > 17:13:16,063 ERROR [STDERR] at $Proxy5.deploy(Unknown Source)
> > >
> > > 17:13:16,063 ERROR [STDERR] at
> > org.jboss.system.server.ServerImpl.doStart(
> > > *ServerImpl.java:384*)
> > >
> > > 17:13:16,063 ERROR [STDERR] at
> org.jboss.system.server.ServerImpl.start(
> > > *ServerImpl.java:291*)
> > >
> > > 17:13:16,079 ERROR [STDERR] at org.jboss.Main.boot(
> > > *Main.java:150*)
> > >
> > > 17:13:16,079 ERROR [STDERR] at org.jboss.Main$1.run(
> > > *Main.java:395*)
> > >
> > > 17:13:16,079 ERROR [STDERR] at java.lang.Thread.run(
> > > *Thread.java:534*)
> > >
> > >
> > >
> > > I have a look, on  and it seems another thread that  call
> > > com.jgsullivan.quartz.SchedulerBuilder.setTriggerDefaults(Trigger t)
> > with
> > > null value
> > >
> > > -I'm not very good at thread debugging-
> > >
> > > Any clue, any help is welcome
> > >
> > > Or should i give up jgsullivan framework and write my own quartz
> plugin
> > > (any code is welcome also...)
> > >
> > > thx,
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to