Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

weblogic timer >> scheduler is running at server start up not at setting time to the notification

 
chandra kunchala
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I am using weblogic 10 server,

i've the requirement to generate a file from the perticular site on perticular time.
in my code they used the weblogic timer.

but the problem is
>> schedular is running at startup of the server time not at the specified time.
the code is like the following

public void contextInitialized(ServletContextEvent event)
{
System.out.println(">>> contextInitialized called.");
// Instantiating the Timer MBean
timer = new Timer();
// Registering this class as a listener
timer.addNotificationListener(this, null, "some handback object");
// Adding the notification to the Timer and assigning the
// ID that the Timer returns to a variable
/*
* This below code is to set the timer to the midnight
*/
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,10);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,5);
Date midnight = calendar.getTime();
notificationId = timer.addNotification("oneMinuteTimer","a recurring call", this,midnight, PERIOD);


timer.start();
System.out.println(">>> timer started.");
}


that is working fine for the weblogic 8 server.

is there any extra settings required...

appreciate your reply

thanks
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This appears to be a WebLogic question, not an IDE question - moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic