How to specify timezone in quartz scheduler

Hi,
I want to initiate a job at a particular time - 6 AM EST every Monday. The cron expression can help me do "6 AM every Monday" part, but not the EST part. How do I specify a timezone. I could not find any examples pertaining to doing this in quartz used in a web application. I found some links that talked about doing this in spring framework - http://forum.springsource.org/archive/index.php/t-16381.html
My web.xml currently looks like this:
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<!--servlet>
<servlet-name>QuartzInitializer</servlet-name>
<servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>config-file</param-name>
<param-value>bpel_quartz.properties</param-value>
</init-param>
</servlet-->
<servlet>
<servlet-name>BPELSchedulerServlet</servlet-name>
<servlet-class>com.otn.samples.BPELSchedulerServlet</servlet-class>
<init-param>
<param-name>cronExpr</param-name>
<param-value>0 0 6 ? * MON</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>BPELSchedulerServlet</servlet-name>
<url-pattern>/bpelschedulerservlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
</web-app>
TIA
Amit

Thanks, I followed your suggestion and was able to make this work. Here is what I have done.
In Web.xml, added a new init parameter, timezone.
<servlet>
<servlet-name>BPELSchedulerServlet</servlet-name>
<servlet-class>com.otn.samples.BPELSchedulerServlet</servlet-class>
<init-param>
<param-name>cronExpr</param-name>
<param-value>0 30 6 ? * MON</param-value> <!--Mondays 6:30amEST -->
</init-param>
<init-param>
<param-name>timezone</param-name>
<param-value>EST</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
then in the scheduler servlet,
String cronExprFromWebXml = null;
// Get the cron Expression as an Init parameter
cronExprFromWebXml = getInitParameter("cronExpr");
String timezone = getInitParameter("timezone");
String cronExpr = convertCronExpr(cronExprFromWebXml,timezone);
and I wrote a function in the same file,
public String convertCronExpr(String inputCronExpr, String desiredTimezone)
String outputCronExpr="";
String[] inputCronArray = inputCronExpr.split(" ");
String dateInDesiredFormat = inputCronArray[0]+":"+inputCronArray[1]+":"+inputCronArray[2]+":"+desiredTimezone;
String dateInServerFormat;
DateFormat genFormat = new SimpleDateFormat("s:m:k:z");
Date specifiedTime;
try
specifiedTime = genFormat.parse(dateInDesiredFormat);
genFormat.setTimeZone(TimeZone.getDefault());//This gets the server timezone
dateInServerFormat = genFormat.format(specifiedTime);
String[] outputCronArray = dateInServerFormat.split(":");
outputCronExpr = outputCronArray[0]+" "+outputCronArray[1]+" "+outputCronArray[2]+" "+inputCronArray[3]+" "+inputCronArray[4]+" "+inputCronArray[5];
System.out.print("inputCronExpr "+inputCronExpr);
System.out.println(" --- In "+desiredTimezone);
System.out.print("outputCronExpr "+outputCronExpr);
System.out.println(" --- In soa suite timezone,"+TimeZone.getDefault().getDisplayName());
return outputCronExpr;
catch (ParseException e)
return inputCronExpr;
ofcourse I havent done any error handling here, and the code really works only for the given situation (it would fail if we use other forms of the cron expression..)
-Amit

Similar Messages

  • Quartz Scheduler in Oracle SOA 10g clustered environment

    Hi,
    I was able to successfully test the usage of Quartz scheduler in our Oracle SOA 10g dev environment. Our dev is single instance where as our Test and Prod are clustered. I would like to know if the scheduler works in clustered environment. I wasn't able to find any documentation specific to Quartz for Bpel. If it can be done can you provide some guidance.
    I really appreciate your help
    Jagan.

    Jagan
    The schedulers do work on cluster environment. The trick is that every node has its oc4j containers, so you will need to deploy the scheduler process to every node in the cluster.
    Suppose you have two nodes, and have a requirement to run certain process every two hours. You schedule the process in DEV environment to run every two hours. But in cluster you will specify to run every four hours on both the nodes. In simple explanation, node 1 will fire the process at 0,4,8, ... hours and node 2 will fire at 2, 6, 10, ... hours. So, the result is that your process is still running every two hours.
    Hope this will help ...

  • How to create correction delivery in schedule agreement

    Hi all -
    I am loading legacy data into SAP and am creating schedule agreements.  I create the agreement using SD_SALESDOCUMENT_CREATE, then COMMIT, then update the schedule lines using BAPI_SALES_DEL_SCHEDULE_CREATE also followed by a COMMIT. This works, and creates the schedule agreement with schedule lines.
    At this same time, or even in another BAPI or function call if need be, I need to create a CORRECTION DELIVERY for this schedule agreement.  I am populating the CORR_***_QTY_IN and CORR_***_QTY_INX in BAPI_SALES_DEL_SCHEDULE_CREATE  with values in every field, and the return tells me 'CORR_CUMQTY_IN has been processed successfully', but when I look at the schedule agreement in VA32, there is no ***. issued qty or ***. delv qty, and no correction delivery has been created.
    What am I missing??
    Thanks so much...
    Sharon

    Hi Shyam -
    I am calling the BAPI_TRANSACTION_COMMIT function right after the BAPI_SALES_DEL_SCHEDULE_CREATE function.  When I call that create function, I am adding schedule lines, so my return table has all of the other successful messages you would expect -
    ORDER_HEADER_IN has been processed successfully
    CORR_CUMQTY_IN has been processed successfully
    DEL_SCHEDULE_IN has been processed successfully
    SCHEDULE_IN has been processed successfully
    Sched. Agr. w/ Rel. 1030000058 has been saved.
    It even says the corrective *** qty was successful....but when I open the schedule agreement, and go to the Forecast Delivery Schedule tab on the line item, the Cml. iss. qty and Cml. dlv. qty fields are blank, and there are no deliveries associated with the order.
    Do I have to use a seperate BAPI to create the correction delivery?  I've looked at BAPI_OUTB_DELIVERY_CREATE_SLS, but I don't see how to specify that this is a correction delivery and not a 'regular' delivery.
    Thanks,
    Sharon

  • ActivationAgent in bpel.xml and Quartz Scheduler

    Hi,
    i have added to bpel.xml to schedule my BPEL process.
    <activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent"
    partnerLink="FileFtpInboundPL" heartBeatInterval="10">
    <property name="schedulerCallout">DefaultSchedulerCalloutImpl</property>
    <property name="endpointScheduleOn">0 1 * * * ?</property>
    <property name="endpointScheduleOff">0 2 * * * ?</property>
    </activationAgent>
    Can anybody tell me like
    what is role of quartz scheduler in this case?
    Is this above code related to quartz scheduler?
    what is the BPM concept befing this scheduling property?
    Thanks inadvance. It would be great help.
    Edited by: PraveenT2 on Apr 16, 2009 7:15 AM
    Edited by: PraveenT2 on Apr 16, 2009 7:16 AM

    Hi,
    Thank you for the reply.
    Yes,bpel.xml is replaced by composite.xml but i was talking about sceduling the BPEL processes through bpml.xml files.
    The example of which is given in following URL but is related to 10.x version and not 11G:
    Re: How to schedule to invoke BPEL process
    Thank you.

  • PropertyAccessExceptionsException in quartz scheduler with Spring

    Exception:
    org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: PropertyAccessExceptionsException (1 errors)]
         at org.quartz.core.JobRunShell.run(JobRunShell.java:214)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
        * Nested Exception (Underlying Cause) ---------------
        PropertyAccessExceptionsException (1 errors)
        org.springframework.beans.MethodInvocationException: Property 'methodInvoker' threw exception; nested exception is com.sun.enterprise.InvocationException
        Caused by:
        com.sun.enterprise.InvocationException
         at com.sun.enterprise.distributedtx.UserTransactionImpl.getStatus(UserTransactionImpl.java:249)
         at org.springframework.transaction.jta.JtaTransactionManager.isExistingTransaction(JtaTransactionManager.java:605)
         at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:294)
         at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:234)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:93)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         at $Proxy32.toString(Unknown Source)
         at java.lang.String.valueOf(String.java:2615)
         at java.lang.StringBuffer.append(StringBuffer.java:220)
         at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.setMethodInvoker(MethodInvokingJobDetailFactoryBean.java:190)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:737)
         at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:575)
         at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
         at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:68)
         at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:85)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)All works fine in tomcat.
    Any body can help me?

    Project Properties -> J2EE Application (then see Embedded OC4J Command Line)
    Searching Google for "jdeveloper userthreads" finds this one in the first hit, as does searching this forum for "userThreads"
    A better title for your post would have been "How do I set userThreads option in JDeveloper" - Quartz Scheduler is what I would call a "red herring" ;)
    best,
    John

  • Trouble executing quartz scheduler

    Hi All,
    I am trying to run this eample http://www.roseindia.net/quartz/quartz-scheduler-tutorial.shtml
    When I run the helloSchedule as a java application I get this
    Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.collections.SetUtils.orderedSet(Ljava/util/Set;)Ljava/util/Set;
         at org.quartz.JobDetail.<init>(JobDetail.java:85)
         at com.aexp.ctrdb.schedule.HelloSchedule.<init>(HelloSchedule.java:14)
         at com.aexp.ctrdb.schedule.HelloSchedule.main(HelloSchedule.java:21)
    Also how should I instantiate the scheduler from the web application?
    Thanks

    Downloaded the collections API from http://commons.apache.org/downloads/download_collections.cgi
    Still the same.

  • How to specify -preview when launching via AppleScript

    I have an InDesign Server CS5.5.I have a shell script that waits for xml files to be placed into a certain directory on the server. When it sees a file in the folder it launches an applescript that controls InDesign Server. I need to know how to specify the -preview option for the InDesign Server binary so the files generated by the server will have previews when they are opened in InDesign client. The apple scripts look like this:
    tell application "InDesign Server"
         -- do some stuff
    end tell
    Where/how would I specify the -preview option. I see nothing referring to the -preview option in the Library for indesign.

    There's two ways to set it:
    1) in command line when you launch the executable, there's a preview option. I don't remember off hand the exact syntax.
    2) In the script itself (using Javascript syntax -- Applescript would be similar) app.serverSettings.imagePreview = true;
    Harbs

  • How to specify a variable in the script logic

    I want to pass a variable from the process chain using the prompt statement.
    I  want to refer to the variable name in the script. When I used the following statement in the script file, I got an error when validating the statement below:
    //Increase Wage and Salary & Personnel Exp. by entered percentage
    [P_ACCT].[#CE0004020] = [P_ACCT].[CE0004020] * ( 1 + $WS_PERCT$ / 100)
    Syntax error:Reference Error: $WS_PERCT$  is not defined
    One of the how-to guides indicated that I should use the dollar sign before and after the variable name.
    Can someone explain how to specify a variable name in the script.
    Thanks.

    Thanks, Pravin.
    I tried using the syntax with the # sign (as shown below) but when I validate the code I get an error. The message indicates there is an issue with $WS_PERCT$.
    Syntax error:Reference Error: $WS_PERCT$ is not defined
    P_ACCT].[#CE0004020] = [P_ACCT].[CE0004020] * ( 1 + $WS_PERCT$ / 100)
    Can you please advise if am missing something here in the code.
    Edited by: Sanjay Kumar on Sep 24, 2009 10:06 PM
    Edited by: Sanjay Kumar on Sep 24, 2009 10:08 PM

  • How to specify  tablespace for a primary key inde in create table statement

    How to specify the tablespace for a primary key index in a create table statement?
    Does the following statement is right?
    CREATE TABLE 'GPS'||TO_CHAR(SYSDATE+1,'YYYYMMDD')
                ("ID" NUMBER(10,0) NOT NULL ENABLE,
                "IP_ADDRESS" VARCHAR2(32 BYTE),
                "EQUIPMENT_ID" VARCHAR2(32 BYTE),
                "PACKET_DT" DATE,
                "PACKET" VARCHAR2(255 BYTE),
                "PACKET_FORMAT" VARCHAR2(32 BYTE),
                "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
                 CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") TABLESPACE "INDEX_DATA"
                 TABLESPACE "SBM_DATA";   Thank you
    Edited by: qkc on 09-Nov-2009 13:42

    As orafad indicated, you'll have to use the USING INDEX clause from the documentation, i.e.
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE TABLE GPS
      2              ("ID" NUMBER(10,0) NOT NULL ENABLE,
      3              "IP_ADDRESS" VARCHAR2(32 BYTE),
      4              "EQUIPMENT_ID" VARCHAR2(32 BYTE),
      5              "PACKET_DT" DATE,
      6              "PACKET" VARCHAR2(255 BYTE),
      7              "PACKET_FORMAT" VARCHAR2(32 BYTE),
      8              "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
      9               CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") USING INDEX TABLESP
    ACE "USERS"
    10               )
    11*              TABLESPACE "USERS"
    SQL> /
    Table created.Justin

  • How to specify a variable in the path prefix of an External HTTP (RFC) connection (in transaction SM59)

    Hi There,
    Please can someone tell me how to specify a variable in the  path prefix of an External HTTP (RFC) connection in transaction SM59?
    For example if my path prefix is /invoke/test/example?input=XYZ; how do I replace "XYZ" with a variable so that I can pass in any value after "=" ?
    Thanks,
    Brendon

    Hi,
    This is SAP Business one system administration forum. Please find correct forum and repost above discussion to get quick assistance.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

  • Quartz Scheduled Application not working. Please help...

    Hi All,
    I have deployed a WAR file which has implemented Quartz Scheduler to run a job.
    There were no errors in the whitelist scan, but while deploying I found an error in the server log as shown below
    "BEA-000903 [Net]" "Incident Error"
    I could not make out what the error was, but I am using a listener class to run the scheduler as below in my web.xml.
    <listener>
      <listener-class>com.crmit.scheduler.QuartzSchedulerListener</listener-class>
    </listener>
    Can anyone please advice??
    Regards,
    Abhishek

    Can you please check your service logs to see what errors are reported in the logs. The Logs can be accessed using Java Service Console,
    Please refer Administering Oracle Java Cloud Service - Release 13.1

  • Deployment Queries related to Quartz Scheduler for SOA 11g???

    Dear All,
    We are using Quartz Scheduler for SOA 11g and have queries on its testing:
    1. Can we change the cron expression(say, previously cron expression was with the interval of 15 minutes every hour and we are changing it to 5 minutes every hour) in the scheduler table after we deployed the scheduler application? Should this require redeployment of Scheduler Application or the scheduler java class needs to be be run again to trigger the newly updated cron expression. Or, Will commiting the scheduler details table alone update the application to schedule for every 5 minutes in an hour?
    2. Also, if we are trying to schedule a new application(say, previously only 2 of our applications are scheduled and trying to add newly built application in the Scheduler table), will commiting the table alone will schedule the new application or require redeployment of Scheduler Application or the scheduler java class needs to be be run again?
    Please share your thoughts!
    Thanks in advance

    Were you able to control the frequency from the table. Can you please share the detials..

  • How to specify URL in server.xml of Tomcat

    Hi Everybody,
    I need help.How to specify url in the server.xml.
    I developed one application in the Tomcat 3.3.I want to access the by entering uri(like:http:test.com).
    What are tags to enter in the server.xml.
    Right now i am accessing like:http://localhost:8080/Test/Login.jsp
    I want replace this with (www.test.com).
    This site will access from anywhere means it is going to live.
    So what are things have to do in the server.xml
    Please provide the solution.
    Regards
    Sridhar

    Hi Raktim:
    I looked around on SDN and it seems that i have found what you have been looking for.
    Kindly look at page number 24 and 25 of this page
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4d46fb8a-0b01-0010-9fbe-e4b96533b222
    P.S: Kindly assign points if your query is resolved, also close the question to assist other users narrow the search and find solutions

  • How to specify HTML meta tags?

    I'm trying to get a portal to always have the following an HTML meta tag in the head of the generated HTML:
    <meta name="ROBOTS" content="NOFOLLOW" />
    I haven't seen any documentation about doing this in particular, but looking at some of the XML schema (*.xsd) files in various weblogic-specific jars, it seems like maybe the following would work in the <netuix:head> tag of the .portal configuration file for the portal:
    <netuix:head>
    <netuix:meta name="ROBOTS" content="NOFOLLOW" />
    </netuix:head>
    However, this does not seem to work.
    Also, I've checked the skin.properties file to see if there are any comments about how to specify meta tags, but there aren't any.

    Turns out there are a number of ways to do this. A BEA consultant recommended modifying the "head.jsp" for the portal's skin.
    Alternatively, it dawned on me that all I had to do was put the meta tags in a jsp and use that jsp in the head area of the .portal file. For example:
    <netuix:head>
    <netuix:jspContent contentUri="/resources/jsp/customHead.jsp"/>
    </netuix:head>

  • How to specify page encoding for XML reports.

    Hi,
    Environment: Apps:11.5.10, Oracle Reports: 10g
    I'm trying to generate XML tags by using a "rdf" report (10g).
    Initially I generated the XML tags before moving the report to server. In the output file I got
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    Then I moved the report to server and made the concurrent program output to XML.
    In the concurrent program output the tag is
    <?xml version="1.0" encoding="&Encoding"?>
    The output shows error
    ===============
    XML Parsing Error: XML declaration not well-formed
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    <?xml version="1.0" encoding="&Encoding"?>
    Its clear that there is something wrong with page encoding format which has to get assigned while run time. But its not happening so.
    How to specify the page encoding format?
    Any help would be appreciated.
    Thank you
    BKR.
    Edited by: BalaKrishna Reddy Avuthu on Aug 14, 2009 2:00 PM

    Remove the encoding so it says:
    <?xml version="1.0"?>
    Also, you will get a similar error if your xml tags for fields contain any special characters like & or #.

Maybe you are looking for

  • Creating a Business Partner from XML

    I have a problem creating a Business Partner from an XML First I did get the XML from an existing one.  Deleted the DocEntry element but I always get this error : -5002 : Employee is not a Technician  [OCRD.DfTcnician] , '0' Even if I go to this elem

  • How do I know if I received LUV?

    QuestionHow do I know if I received LUV? AnswerSo you received LUV from a friend, but can't quite tell who sent you LUV and how much. Lets take a look at your LUV page. The screenshot below shows my LUV page. You can see that I have some activity on

  • Front Row won't launch iPhoto, no black menu

    I just got my new Intel iMac. All works great but not the Front Row's photo show. When I press Photos on the rotating desktop, the menu just fades and shows Desktop. No error message, just desktop. I deleted iPhoto, re-installed it (v. 6.0). Does not

  • How do i set up the wireless option for printing rather than using an usb

    how do I set up wireless printing function on my hp photosmart C4780

  • Mac os x Leopard for windows

    I am downloading windows to my mac. Do I need the Mac os x leopard disk? Or will windows work without it?