Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Scheduler Servlet not working properly  RSS feed

 
Durgesh Rajbhar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning All,

I needed a scheduler which could upload some xml files from remot server to my server location through FTP but
when I restart the server it upload the files from remote server to my server location but when I put xml files in between
(when server running) at remote server then it does not upload the files to my server.

Can any one tell me the reason/solution.


import java.util.Timer;
import java.util.TimerTask;

import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;

import com.broadvision.action.xmlrequest.XMLRequestUtil;

import corp.broadvision.org.util.BVLog;

public class SchedularServlet extends HttpServlet {
public void init(ServletConfig conf) {

try {


int initialDelay = Integer.parseInt(conf.getInitParameter("initialDelay")); // start after 30 seconds 30000
int period = Integer.parseInt(conf.getInitParameter("period")); // repeat every 5 minutes 300000300000

Timer timer = new Timer();

TimerTask task = new TimerTask() {
public void run() {


boolean rssobj=new com.broadvision.action.xmlrequest.XMLRequestUtil().getXMLRequestFiles2DB();
if(!rssobj){
BVLog.error(20,"Either no file at RIL server location or getXMLRequestFiles2DB return false:"+rssobj);

}

}
};

timer.scheduleAtFixedRate(task, initialDelay, period);


}
catch (Exception e) {
BVLog.error(20,"Exception inside SchedularServlet class:::"+e.toString());
e.printStackTrace();
}
}
}

Thanks in advance.

Regards,
Durgesh Pratap Rajbhar
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
 
Durgesh Rajbhar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear.
I will keep in mind from next time.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next time? Why not fix it this time?
 
Durgesh Rajbhar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!